aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2009-02-19 15:22:28 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2009-02-19 07:22:28 -0800
commit68017cb410dc476560ef648be47189825fef365a (patch)
tree8c6c796708593865d482060ea12cf6acb211e49f /gcc/cp/decl2.c
parentab4194daa89047e2eacb66ef8d5d702418905bb0 (diff)
downloadgcc-68017cb410dc476560ef648be47189825fef365a.zip
gcc-68017cb410dc476560ef648be47189825fef365a.tar.gz
gcc-68017cb410dc476560ef648be47189825fef365a.tar.bz2
re PR c++/39188 (G++ doesn't handle static anonymous union right)
gcc/ 2009-02-19 H.J. Lu <hongjiu.lu@intel.com> PR c++/39188 * varasm.c (assemble_variable): Don't check DECL_NAME when globalizing a variable. gcc/cp/ 2009-02-19 H.J. Lu <hongjiu.lu@intel.com> PR c++/39188 * cp-tree.h (maybe_commonize_var): New. * decl.c (maybe_commonize_var): Make it extern. * decl2.c (finish_anon_union): Call maybe_commonize_var. gcc/testsuite/ 2009-02-19 H.J. Lu <hongjiu.lu@intel.com> PR c++/39188 * g++.dg/abi/pr39188-1a.C: New. * g++.dg/abi/pr39188-1b.C: Likewise. * g++.dg/abi/pr39188-1.h: Likewise. * g++.dg/abi/pr39188-2a.C: Likewise. * g++.dg/abi/pr39188-2b.C: Likewise. * g++.dg/abi/pr39188-2.h: Likewise. * g++.dg/abi/pr39188-3a.C: Likewise. * g++.dg/abi/pr39188-3b.C: Likewise. * g++.dg/abi/pr39188-3.h: Likewise. From-SVN: r144297
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 2cafc83..9d33bbf 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1364,6 +1364,7 @@ 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);
DECL_NAME (anon_union_decl) = NULL_TREE;
}