[cxx-abi-dev] A mangling for std::nullptr_t

Dennis Handly dhandly at cup.hp.com
Wed Mar 3 01:49:45 UTC 2010


>From: David Vandevoorde <daveed at edg.com>
>> 	<builtin-type> ::= Dn

>In addition to the mangling for std::nullptr_t, we also need an RTTI
>representation.  Since nullptr_t has special conversion requirements
>(e.g., throwing a nullptr_t value can be caught as a pointer or
>pointer-to-member value), we propose to add a new simple
>__nullptr_type_info class (no additional members), rather than e.g.
>trying to reuse __fundamental_type_info.

I don't see why we would have a RTTI type that doesn't match the mangled name?
Or are you planning to have both a _ZTIDn but it's virtual table is
this new __nullptr_type_info?

This wastes storage.  Instead of just a type_info and string, we now have
to have a virtual table for __nullptr_type_info, and another type_info for
that.  I.e. instead of using virtual function dispatch, we should consider
looking at the typeid.

It seems the only special case now is for void, _ZTIv, for catch(...).
Why not follow the same path?
   if (catch_type == typeid(void))
   if (catch_type == typeid(std::nullptr_t))



More information about the cxx-abi-dev mailing list