[cxx-abi-dev] Mangling sizeof
Jason Merrill
jason at redhat.com
Wed Mar 11 16:25:57 UTC 2009
Doug Gregor wrote:
> On Fri, Mar 6, 2009 at 2:34 PM, Jason Merrill <jason at redhat.com> wrote:
>> * Separate cast forms
>>
>> Currently EDG and g++ mangle static_cast, const_cast, C cast and functional
>> cast the same (cv type expr), and g++ doesn't support mangling
>> reinterpret_cast or dynamic_cast. EDG also mangles reinterpret_cast the
>> same, and gets a substitution failure for dynamic_cast.
>>
>> The distinction between different cast varieties definitely affects the
>> validity of an expression, but it's not clear whether or not it can cause a
>> substitution failure.
>
> 14.8.2p8 (in n2800) makes it pretty clear that any expression can
> cause a substitution failure; the list of bullets is just a note, now.
Good point. So they really should all be mangled differently, though
C-style and functional casts can stay the same. But that's a binary
incompatibility that should probably wait until we're ready to deploy a
bunch of binary-incompatible changes.
If we're dropping type stubs, that reintroduces the issue of what to do
with function parameters. I think it may still make sense to use type
stubs for them; the name of the parameter is not part of the signature,
and I don't think it's possible, given two parameters of the same type,
for it to make a difference which one you use in a decltype/sizeof
expression. Alternatively, we could just introduce a mangling for
"function parameter N". Which might be simpler.
Jason
More information about the cxx-abi-dev
mailing list