aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-10-11 16:59:23 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-10-11 16:59:23 +0000
commit06c00c701b476927b2e3af24c283a8551e71129e (patch)
tree1631690ebdc453570ed58a91c22ebf55fd190f08 /gcc
parent6936e493b56b4a67e9b1bfbafedfc79987eb4943 (diff)
downloadgcc-06c00c701b476927b2e3af24c283a8551e71129e.zip
gcc-06c00c701b476927b2e3af24c283a8551e71129e.tar.gz
gcc-06c00c701b476927b2e3af24c283a8551e71129e.tar.bz2
re PR c++/17929 (ICE with qualified name in template specialization)
PR c++/17929 * decl2.c (finish_anon_union): Robustify. From-SVN: r88886
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f12c277..5196df9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-11 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/17929
+ * decl2.c (finish_anon_union): Robustify.
+
2004-10-11 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (get_dynamic_cast_base_type): Rename to ...
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 896fdfc..7a55907 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1182,9 +1182,15 @@ build_anon_union_vars (tree object)
void
finish_anon_union (tree anon_union_decl)
{
- tree type = TREE_TYPE (anon_union_decl);
+ tree type;
tree main_decl;
- bool public_p = TREE_PUBLIC (anon_union_decl);
+ bool public_p;
+
+ if (anon_union_decl == error_mark_node)
+ return;
+
+ type = TREE_TYPE (anon_union_decl);
+ public_p = TREE_PUBLIC (anon_union_decl);
/* The VAR_DECL's context is the same as the TYPE's context. */
DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));