[cxx-abi-dev] Mangling of generic lambda

Richard Smith richardsmith at googlers.com
Fri Dec 9 16:46:06 UTC 2016


On 9 Dec 2016 8:14 am, "Nathan Sidwell" <nathan at acm.org> wrote:

On 12/09/2016 09:29 AM, Jason Merrill wrote:

> On Thu, Dec 8, 2016 at 5:31 PM, Richard Smith <richardsmith at googlers.com>
> wrote:
>

Of note is the repeated suggestion to allow explicit template parameter
>> lists in lambdas (at this point, I'd give this a very solid chance of
>> being
>> part of C++20):
>>
>>   auto lambda = []<typename T>(T a, T b) {};
>>
>> We would presumably need to mangle that as UlT_T_E even with the Da
>> suggestion, so it seems that demanglers are just going to need to cope
>> with
>> Ul introducing a new template parameter scope.
>>
>
> Makes sense.
>

I think the ABI doc should at least mention that uses of 'auto' in a
generic lambda's parameter list are mangled as the artificial template
they're represented as (as that seems to be the intent)

Anyway, how do we expect the above example to be mangled as?  Something
like 'UlI...ET_T_E_'?  I.e. are the explicit template args in that
suggestion distinguished from synthesized 'auto' ones?  It'd be unfortunate
if the mangling we have right now blocked something needed later.


I would expect just UlT_T_E (modulo substitutions), as we don't generally
mangle template parameter lists, just template argument lists, and we don't
have a template argument list here. (But it doesn't really matter what we
put between the Ul and the E, since we number closure types in the event of
collisions anyway.)


nathan
-- 
Nathan Sidwell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20161209/fca2f1cd/attachment.html>


More information about the cxx-abi-dev mailing list