Commit dfae9048 by Paolo Carlini Committed by Paolo Carlini

re PR c++/71577 (ICE on invalid C++11 code (with extra struct initializer): in…

re PR c++/71577 (ICE on invalid C++11 code (with extra struct initializer): in digest_init_r, at cp/typeck2.c:1117)

/cp
2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71577
	* decl.c (reshape_init): Unconditionally return error_mark_node
	upon error about too many initializers.

/testsuite
2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71577
	* g++.dg/cpp0x/pr71577.C: New.

From-SVN: r247630
parent 56871768
2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71577
* decl.c (reshape_init): Unconditionally return error_mark_node
upon error about too many initializers.
2017-05-04 Nathan Sidwell <nathan@acm.org> 2017-05-04 Nathan Sidwell <nathan@acm.org>
* constraint.cc (diagnose_check_constraint): Fix %E thinko. * constraint.cc (diagnose_check_constraint): Fix %E thinko.
......
...@@ -6116,8 +6116,7 @@ reshape_init (tree type, tree init, tsubst_flags_t complain) ...@@ -6116,8 +6116,7 @@ reshape_init (tree type, tree init, tsubst_flags_t complain)
{ {
if (complain & tf_error) if (complain & tf_error)
error ("too many initializers for %qT", type); error ("too many initializers for %qT", type);
else return error_mark_node;
return error_mark_node;
} }
if (CONSTRUCTOR_IS_DIRECT_INIT (init) if (CONSTRUCTOR_IS_DIRECT_INIT (init)
......
2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71577
* g++.dg/cpp0x/pr71577.C: New.
2017-05-04 Martin Sebor <msebor@redhat.com> 2017-05-04 Martin Sebor <msebor@redhat.com>
PR middle-end/79234 PR middle-end/79234
......
// PR c++/71577
// { dg-do compile { target c++11 } }
struct { int a; } s1, s2 = { s1, 0 }; // { dg-error "too many initializers" }
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