diff options
| -rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/other/anon4.C | 8 |
4 files changed, 21 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3dc8225..b1ed4f0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c++/27951 + * decl2.c (finish_anon_union): Return early if build_anon_union_vars + fails. + 2006-06-12 Roger Sayle <roger@eyesopen.com> PR c++/21210 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a30fed3..49e320c 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1109,6 +1109,8 @@ finish_anon_union (tree anon_union_decl) } main_decl = build_anon_union_vars (type, anon_union_decl); + if (main_decl == error_mark_node) + return; if (main_decl == NULL_TREE) { warning (0, "anonymous union with no members"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e5d2c0..b43e519 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c++/27951 + * g++.dg/other/anon4.C: New test. + 2006-06-12 Roger Sayle <roger@eyesopen.com> PR c++/21210 diff --git a/gcc/testsuite/g++.dg/other/anon4.C b/gcc/testsuite/g++.dg/other/anon4.C new file mode 100644 index 0000000..571f4ae --- /dev/null +++ b/gcc/testsuite/g++.dg/other/anon4.C @@ -0,0 +1,8 @@ +// PR c++/27951 +// { dg-do compile } + +void foo() +{ + int i; // { dg-error "previously" } + union { int i; }; // { dg-error "redeclaration" } +} |
