Mangling of anonymous unions?

Jason Merrill jason at redhat.com
Wed Dec 18 20:54:30 UTC 2002


I just noticed that the ABI doesn't define a mangling for anonymous
unions.  This is only really relevant for static local anonymous unions in
inline functions; all others are private to a translation unit.

The choices would seem to be:

1) Use the name of the first member.
2) Use the name of the largest member.
3) Treat them like string literals, perhaps using 'u' instead of 's'.

g++ currently does #2.  But it also fails to allocate space for such a
union (q.v. g++.brendan/union1.C), so there's no binary compatibility issue
in choosing a different answer.

My order of preference is 3, 1, 2.  And yes, I'm volunteering to fix g++.

Jason



More information about the cxx-abi-dev mailing list