https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121443
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <[email protected]>: https://gcc.gnu.org/g:0ee1ade8fafd92c95c1318f9207dbf1ce203ca61 commit r16-6207-g0ee1ade8fafd92c95c1318f9207dbf1ce203ca61 Author: benwu25 <[email protected]> Date: Wed Dec 17 18:59:05 2025 +0700 c++: clear in_declarator_p before parsing a lambda [PR121443] We should set parser->in_declarator_p to false when parsing a lambda. In this testcase, for example, a lambda in a function declarator could contain a constructor, which would be disallowed in cp_parser_decl_specifier_seq since in_declarator_p was true. PR c++/121443 gcc/cp/ChangeLog: * parser.cc (cp_parser_lambda_expression): Clear in_declarator_p. gcc/testsuite/ChangeLog: * g++.dg/parse/pr121443.C: New test. Reviewed-by: Jason Merrill <[email protected]>
