diff options
author | Marek Polacek <polacek@redhat.com> | 2013-10-03 16:33:23 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2013-10-03 16:33:23 +0000 |
commit | 2ef7251f6cd9e228cafa3473929ff55c9cb56928 (patch) | |
tree | 62b9d2ef06f37823d1153957bcb6779b88888243 /gcc | |
parent | fc7657bb382e789ce7468950ca1c5fa0b9061ec5 (diff) | |
download | gcc-2ef7251f6cd9e228cafa3473929ff55c9cb56928.zip gcc-2ef7251f6cd9e228cafa3473929ff55c9cb56928.tar.gz gcc-2ef7251f6cd9e228cafa3473929ff55c9cb56928.tar.bz2 |
re PR c++/58510 ([c++11] ICE with multiple non-static data initializations in union)
PR c++/58510
cp/
* init.c (sort_mem_initializers): Splice when giving an error.
testsuite/
* g++.dg/cpp0x/pr58510.C: New test.
From-SVN: r203165
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr58510.C | 11 |
4 files changed, 27 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c984f90..0769847 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-10-03 Marek Polacek <polacek@redhat.com> + + PR c++/58510 + * init.c (sort_mem_initializers): Splice when giving an error. + 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58535 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 8fabdcd..70e7294 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -980,9 +980,12 @@ sort_mem_initializers (tree t, tree mem_inits) else if (TREE_VALUE (*last_p) && !TREE_VALUE (init)) goto splice; else - error_at (DECL_SOURCE_LOCATION (current_function_decl), - "initializations for multiple members of %qT", - ctx); + { + error_at (DECL_SOURCE_LOCATION (current_function_decl), + "initializations for multiple members of %qT", + ctx); + goto splice; + } } last_p = p; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6ea99fb..6e4a4e4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-03 Marek Polacek <polacek@redhat.com> + + PR c++/58510 + * g++.dg/cpp0x/pr58510.C: New test. + 2013-10-03 Marc Glisse <marc.glisse@inria.fr> PR c++/19476 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr58510.C b/gcc/testsuite/g++.dg/cpp0x/pr58510.C new file mode 100644 index 0000000..71f2520 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr58510.C @@ -0,0 +1,11 @@ +// PR c++/58510 +// { dg-do compile { target c++11 } } + +void foo() +{ + union + { // { dg-error "multiple" } + int i = 0; + char c = 0; + }; +} |