summaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-23 16:58:28 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-23 16:58:28 +0000
commit4f05c8a94100f2d389be83f5ba12dbf2bf9925d3 (patch)
tree690df81dd299d80b4a402768cd92d32f65638a8f /gcc/cp/decl2.c
parentdd0dcb3e9b6569bdef41740a5c10347b300a1929 (diff)
downloadgcc-4f05c8a94100f2d389be83f5ba12dbf2bf9925d3.tar.gz
/cp
2011-06-23 Paolo Carlini <paolo.carlini@oracle.com> PR c++/44625 * decl2.c (build_anon_union_vars): Early return error_mark_node for a nested anonymous struct. /testsuite 2011-06-23 Paolo Carlini <paolo.carlini@oracle.com> PR c++/44625 * g++.dg/template/crash107.C: New. * g++.dg/template/error17.C: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 9e5a2297190..8cd51c28a2c 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1327,7 +1327,10 @@ build_anon_union_vars (tree type, tree object)
/* Rather than write the code to handle the non-union case,
just give an error. */
if (TREE_CODE (type) != UNION_TYPE)
- error ("anonymous struct not inside named type");
+ {
+ error ("anonymous struct not inside named type");
+ return error_mark_node;
+ }
for (field = TYPE_FIELDS (type);
field != NULL_TREE;