[cxx-abi-dev] Adding consistency check for C++11 forward-declared enums?
Dennis Handly
dhandly at cup.hp.com
Thu May 16 05:19:24 UTC 2013
>From: Kevin Fleming <kevin at kpfleming.us>
>A discussion cropped up at C++Now today about the new forward declarations
>of enumerations in C++11.
Perhaps they should also discuss how to mangle them?
Are these forwards, in that they have to be defined in the file later?
Or incompletes?
The reminds me of cfront and how to mangle a typedef for a tagless class.
This was only solved by the Standards saying the mangling used the typedef
name.
>Much like forward declarations of functions, a
>forward declared enumeration consists of more than just a name; it also has
>an underlying storage type.
(I'm thinking only if the enum is used as a function parm, namespace or
global.)
Obviously one side will know it is forward but if the other isn't, what
mangling style to use? This would be incompatible.
And in one file it could be complete and the other not.
>and the enum-consuming TU
>attempted to import such a suitably-mangled name (even though none of the
>object code in the consuming TU would ever reference the resolved symbol
>address), the linker would be able to notify the developer of the
>underlying type mismatch.
Why wouldn't the consuming TU use it? Or are you saying it possibly
may not?
>I see a long-tabled 'consistency checks' issue on the CXX-ABI pages that
>seems to address similar issues
Do you have a pointer?
More information about the cxx-abi-dev
mailing list