[cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules

Jason Merrill jason at redhat.com
Wed Jul 14 13:30:56 UTC 2010


On 07/13/2010 10:08 PM, John McCall wrote:
> On Jun 30, 2010, at 8:33 AM, David Vandevoorde wrote:
>> - We propose additional encodings for literals that can now appear in signatures.  nullptr is "LDn0E"; i.e., "a zero of type std::nullptr_t".  More interestingly, string literals are encoded as L<character type>E, where<character type>  is the encoding of the (unqualified) underlying character type.  This has a few consequences for the demangler: It cannot actually reproduce the string, and it can only distinguish character literals from string literals after having seen the first character following the character type code.
>
> Is this sufficient?  Overloading can be dependent on the length of the string, i.e. these are different templates:
>    template<class T>  auto foo(T x) ->  decltype(bar(x, "abc"));
>    template<class T>  auto foo(T x) ->  decltype(bar(x, "abcd"));

Ah, yes.

template <class T>
T bar(T, const char (&)[3]);
template <class T>
T* bar(T, const char (&)[4]);

So we need to encode the length as well.

Jason



More information about the cxx-abi-dev mailing list