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

Kerch Holt kerch at cup.hp.com
Thu Dec 19 00:24:45 UTC 2002


Jason Merrill wrote:
> On Wed, 18 Dec 2002 15:32:04 -0800, Kerch Holt <kerch at cup.hp.com> wrote:
> 
> 
>>Wouldn't you need some type of factoring of all the members of the union
>>(instead of first/last) to avoid collisions (of similar unions in the
>>same inline)?
> 
> 
> I'm not sure what you mean.  You would mangle it like any other local
> variable; if there are more than one with the same name, you need to use a
> discriminator to distinguish between them.  The only question is which name
> to use.
> 
Never mind. I was concerned that two different anonymous union types would have
the same mangling, but, as you point out if the variable is always
factored in the mangling will differ.
Perhaps depending on the ordering (first, last) is problematical... are these
the same type:
union { int a; char b; }
union ( char b; int a; }
?
-- 
Kerch Holt
HP Cupertino Language & Tools Lab




More information about the cxx-abi-dev mailing list