diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2017-05-05 09:02:22 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2017-05-05 09:02:22 +0000 |
commit | dfae9048a0ce06a8f240dd17c282cb1e1eaf2097 (patch) | |
tree | cfad746ae0831c36a6a5d19661cae366088ed52d | |
parent | 56871768b4cf5c2fd82456e03ae2f83a9789d2fb (diff) | |
download | gcc-dfae9048a0ce06a8f240dd17c282cb1e1eaf2097.zip gcc-dfae9048a0ce06a8f240dd17c282cb1e1eaf2097.tar.gz gcc-dfae9048a0ce06a8f240dd17c282cb1e1eaf2097.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr71577.C | 4 |
4 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ac7c033..768f5a3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +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> * constraint.cc (diagnose_check_constraint): Fix %E thinko. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 6a7aeb3..38ba0b0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6116,8 +6116,7 @@ reshape_init (tree type, tree init, tsubst_flags_t complain) { if (complain & tf_error) error ("too many initializers for %qT", type); - else - return error_mark_node; + return error_mark_node; } if (CONSTRUCTOR_IS_DIRECT_INIT (init) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0d54e4c..f9ac334 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR middle-end/79234 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71577.C b/gcc/testsuite/g++.dg/cpp0x/pr71577.C new file mode 100644 index 0000000..15794ad --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr71577.C @@ -0,0 +1,4 @@ +// PR c++/71577 +// { dg-do compile { target c++11 } } + +struct { int a; } s1, s2 = { s1, 0 }; // { dg-error "too many initializers" } |