[cxx-abi-dev] Mangling late-specified return types/decltype

Jason Merrill jason at redhat.com
Mon Sep 8 21:49:18 UTC 2008


Lawrence Crowl wrote:
> On 9/5/08, Jason Merrill <jason at redhat.com> wrote:
>> Consider
>>
>>  template<class T, class U>
>>  auto add(T t, U u) -> decltype (t+u);
>>
>> There is currently no way to mangle "t" in the ABI.  Currently I'm dealing
>> this by replacing "t" in the return type with *(T*)0, but that seems
>> inelegant (and unnecessarily long).
> 
> Are you suggesting the mangling of the template itself or of its instances?
> For the latter, shouldn't we be using the regular mangling?

The mangling of specializations is basically the mangling of the 
template plus the template arguments.  This is done to distinguish 
between instantiations of different templates that have the same 
function signature.

Jason



More information about the cxx-abi-dev mailing list