[cxx-abi-dev] Mangling of anonymous unions?

Jason Merrill jason at redhat.com
Thu Dec 19 07:09:55 UTC 2002


On Wed, 18 Dec 2002 16:38:24 -0800, Mark Mitchell <mark at codesourcery.com> wrote:

> I can never remember if a union has to have any named members.  Is:
>
>  union { int : 7; };
>
> legal?  I think so -- but there's no way to talk about such a thing,
> so I suppose its mangled name doesn't matter, but it would be nice
> if we had one.

We currently warn about it and then throw it away; it doesn't get a symbol
at all.

> This case:
>
>   union { union { int i; }; };
>
> is legal, so the name-based approach needs a recursive formulation.
>
> I think that the first name found in a pre-order, depth-first,
> declaration-order walk is a reasonable choice.

Works for me.

Jason



More information about the cxx-abi-dev mailing list