https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120557
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |waffl3x at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I wonder if it wouldn't be better in case we have erroneous this argument to just change it to pointer or reference to current class. Or perhaps --- gcc/cp/parser.cc.jj 2025-06-19 08:55:04.000000000 +0200 +++ gcc/cp/parser.cc 2025-06-20 10:22:47.571385574 +0200 @@ -20985,7 +20985,8 @@ cp_parser_simple_type_specifier (cp_pars break; } - if (cxx_dialect >= cxx14) + if (cxx_dialect >= cxx14 + || (current_class_type && LAMBDA_TYPE_P (current_class_type))) { type = synthesize_implicit_template_parm (parser, NULL_TREE); type = TREE_TYPE (type); (or maybe do it for all the cases, so call synthesize_implicit_template_parm unconditionally instead of setting it to error_mark_node for C++11?