This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR c++/39188: G++ doesn't handle static anonymous union right


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]