PR c++/49669
* init.c (perform_member_init): Handle invalid array initializer.
From-SVN: r177497
2011-08-05 Jason Merrill <jason@redhat.com>
+ PR c++/49669
+ * init.c (perform_member_init): Handle invalid array initializer.
+
PR c++/49988
* semantics.c (cxx_eval_array_reference): Handle failure to
reduce the array operand to something we can work with.
{
if (init)
{
- gcc_assert (TREE_CHAIN (init) == NULL_TREE);
- init = TREE_VALUE (init);
+ if (TREE_CHAIN (init))
+ init = error_mark_node;
+ else
+ init = TREE_VALUE (init);
if (BRACE_ENCLOSED_INITIALIZER_P (init))
init = digest_init (type, init, tf_warning_or_error);
}
2011-08-05 Jason Merrill <jason@redhat.com>
+ PR c++/49669
+ * g++.dg/init/array28.C: New.
+
PR c++/49988
* g++.dg/cpp0x/constexpr-non-const-arg3.C: New.
--- /dev/null
+// PR c++/49669
+
+struct Foo { explicit Foo(int) { } };
+struct Goo {
+ Goo() : x(Foo(4), Foo(5)) { } // { dg-error "array" }
+ Foo x[2];
+};