PR c++/60951
* typeck2.c (massage_init_elt): Use maybe_constant_init.
From-SVN: r209933
+2014-04-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/60951
+ * typeck2.c (massage_init_elt): Use maybe_constant_init.
+
2014-04-30 Marek Polacek <polacek@redhat.com>
* typeck.c (cp_build_binary_op): Call ubsan_instrument_division
/* When we defer constant folding within a statement, we may want to
defer this folding as well. */
tree t = fold_non_dependent_expr_sfinae (init, complain);
- t = maybe_constant_value (t);
+ t = maybe_constant_init (t);
if (TREE_CONSTANT (t))
init = t;
return init;
--- /dev/null
+// PR c++/60951
+// { dg-do compile { target c++11 } }
+
+struct Foo {
+ constexpr Foo(int x = 0) : memb(x) {}
+ int memb;
+};
+
+struct FooContainer {
+ Foo foo[2];
+};
+
+void fubar() {
+ int nonConst = 0;
+ FooContainer fooContainer;
+ fooContainer = { { 0, nonConst } };
+}