aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-19 16:36:57 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-01-19 16:36:57 +0100
commitcfea9968d13cba69f32bf1e13126ed91fabfc02a (patch)
tree2e34cc53696dbe3ea19e2d94003b711402bc3676 /gcc/cp/decl2.c
parentb899fd784b2e89080c853afd5bb1776328c9d4e7 (diff)
downloadgcc-cfea9968d13cba69f32bf1e13126ed91fabfc02a.zip
gcc-cfea9968d13cba69f32bf1e13126ed91fabfc02a.tar.gz
gcc-cfea9968d13cba69f32bf1e13126ed91fabfc02a.tar.bz2
re PR c++/47303 (ICE: in varpool_node, at varpool.c:134 with -fabi-version=1)
PR c++/47303 * decl2.c (finish_anon_union): Only call mangle_decl if TREE_STATIC or DECL_EXTERNAL. * g++.dg/template/anonunion1.C: New test. From-SVN: r169000
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 72570c3..2885528 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1409,7 +1409,8 @@ finish_anon_union (tree anon_union_decl)
/* Use main_decl to set the mangled name. */
DECL_NAME (anon_union_decl) = DECL_NAME (main_decl);
maybe_commonize_var (anon_union_decl);
- mangle_decl (anon_union_decl);
+ if (TREE_STATIC (anon_union_decl) || DECL_EXTERNAL (anon_union_decl))
+ mangle_decl (anon_union_decl);
DECL_NAME (anon_union_decl) = NULL_TREE;
}