https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109859
--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:a2fd45adfdb3ff219fd97d158fb66cc99ef0afd4 commit r13-9300-ga2fd45adfdb3ff219fd97d158fb66cc99ef0afd4 Author: Marek Polacek <pola...@redhat.com> Date: Wed Sep 18 15:44:31 2024 -0400 c++: concept in default argument [PR109859] 1) We're hitting the assert in cp_parser_placeholder_type_specifier. It says that if it turns out to be false, we should do error() instead. Do so, then. 2) lambda-targ8.C should compile fine, though. The problem was that local_variables_forbidden_p wasn't cleared when we're about to parse the optional template-parameter-list for a lambda in a default argument. PR c++/109859 gcc/cp/ChangeLog: * parser.cc (cp_parser_lambda_declarator_opt): Temporarily clear local_variables_forbidden_p. (cp_parser_placeholder_type_specifier): Turn an assert into an error. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-defarg3.C: New test. * g++.dg/cpp2a/lambda-targ8.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com> (cherry picked from commit 4bcfaaed25b1b8ecc81f6a28d9ca76f00870dedf)