This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR c++/39188: G++ doesn't handle static anonymous union right
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 18 Feb 2009 18:01:36 -0800
- Subject: Re: PATCH: PR c++/39188: G++ doesn't handle static anonymous union right
- References: <20090215194610.GA26692@lucon.org> <499CB7B3.8040501@redhat.com>
On Wed, Feb 18, 2009 at 5:36 PM, Jason Merrill <jason@redhat.com> wrote:
> H.J. Lu wrote:
>
> The C++ changes are OK, but why is
>
>> * varasm.c (assemble_variable): Also check DECL_ASSEMBLER_NAME
>> when globalizing a variable.
>
> necessary? It looks like the variable will have DECL_NAME set.
>
finish_anon_union has
if (!processing_template_decl)
{
/* Use main_decl to set the mangled name. */
DECL_NAME (anon_union_decl) = DECL_NAME (main_decl);
mangle_decl (anon_union_decl);
DECL_NAME (anon_union_decl) = NULL_TREE;
}
DECL_NAME on anonymous union is NULL. But mangle_decl will
set DECL_ASSEMBLER_NAME.
--
H.J.