Commit dd56ca9f by Jason Merrill Committed by Jason Merrill

re PR c++/49669 ([C++0x] Compiler crashes with "internal compiler error: in…

re PR c++/49669 ([C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530")

	PR c++/49669
	* init.c (perform_member_init): Handle invalid array initializer.

From-SVN: r177497
parent 5c67ef9a
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.
......
......@@ -554,8 +554,10 @@ perform_member_init (tree member, tree init)
{
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.
......
// PR c++/49669
struct Foo { explicit Foo(int) { } };
struct Goo {
Goo() : x(Foo(4), Foo(5)) { } // { dg-error "array" }
Foo x[2];
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment