This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix c++/78621 generic lambda mangling


On 12/07/2016 01:30 PM, Nathan Sidwell wrote:
This patch fixes the generic lambda mangling bug that caused the
demangler to infinitely recurse (78252).  The generic's auto parms fail
the is_auto check because that's testing for the 'auto' identifier,
whereas the parms are distinct template type parms named 'auto:$N'.

Right. Which is because they act as normal template parameters rather than like the auto type-specifier does in, say, a variable declaration. But indeed this produces bad mangling, and using Da in the mangling of a generic lambda seems reasonable. You've probably seen my mail to the ABI list about it. Are you still on that list?

Amending is_auto to do a textual compare of the identifier breaks
things, and is insufficient anyway.  The mangler's squangling must (a)
squangle subsequent auto uses as expected and (b) NOT squangle
subsequent template type parm references to refer the the lambda's autos.

Wow, I haven't seen the term "squangling" in more than a decade. Did we ever use that in reference to the new ABI?

This use of tsubst can meet {TYPE,EXPR}_PARAMETER_PACKs, so I had to
extend tsubst to process those objects.

Hmm, we have deliberately avoided this in the past, since pack expansions mean different things in different contexts. Can you use tsubst_arg_types instead?

Also, the name "make_auto_for_mangle" doesn't really indicate that it's doing a substitution of the function parameter types.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]