Fix PR c++/66857
gcc/cp/ChangeLog:
PR c++/66857
* cvt.c (ocp_convert): Don't call scalar_constant_value when
converting to a class type.
gcc/testsuite/ChangeLog:
PR c++/66857
* g++.dg/init/pr66857.C: New test.
From-SVN: r226228
+2015-07-25 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/66857
+ * cvt.c (ocp_convert): Don't call scalar_constant_value when
+ converting to a class type.
+
2015-07-24 Jason Merrill <jason@redhat.com>
PR c++/64969
}
/* FIXME remove when moving to c_fully_fold model. */
- e = scalar_constant_value (e);
+ if (!CLASS_TYPE_P (type))
+ e = scalar_constant_value (e);
if (error_operand_p (e))
return error_mark_node;
+2015-07-25 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/66857
+ * g++.dg/init/pr66857.C: New test.
+
2015-07-25 Uros Bizjak <ubizjak@gmail.com>
PR target/66648
--- /dev/null
+// PR c++/66857
+// { dg-do run }
+
+const int i = 0;
+
+struct Test
+{
+ Test (const int &rhs)
+ {
+ if (&rhs != &i)
+ __builtin_abort ();
+ }
+};
+
+int
+main (void)
+{
+ Test test = i;
+}