From 68017cb410dc476560ef648be47189825fef365a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 19 Feb 2009 15:22:28 +0000 Subject: re PR c++/39188 (G++ doesn't handle static anonymous union right) gcc/ 2009-02-19 H.J. Lu PR c++/39188 * varasm.c (assemble_variable): Don't check DECL_NAME when globalizing a variable. gcc/cp/ 2009-02-19 H.J. Lu 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 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 --- gcc/cp/decl2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/cp/decl2.c') 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; } -- cgit v1.1