https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82195
--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> --- Created attachment 42171 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42171&action=edit Further simplified Further simplification removes the inner lambda. The key problem is needing to name objects within the scope of the instantiated generic lambda's template function operator. We end up using a template parameter reference, trying to refer to that operator instantiation, but the scopes are confusing. The Local::fn function is mangled as: _ZZZ3FoovENKUlT_E_clIiEEfS_EN5Local2fnEv the backreference 'S_' is to the 'T_' component, but manually undoing that substitution does not resolve the demangler's problem. If we desugar the testcase, and define an explict lambda-like class, at file scope, it's Local::fn function is mangled as: _ZZN6lambdaclIiEEfT_EN5Local2fnEv The demangler can demangle that. Manually wrapping that inside another local-scope mangle breaks the demangler.