https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103401
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I think the patch might be just: --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -7508,6 +7508,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, looking at a functional cast. We could also be looking at an id-expression. So, we try the functional cast, and if that doesn't work we fall back to the primary-expression. */ + auto cleanup = make_temp_override + (parser->auto_is_implicit_function_template_parm_p, false); cp_parser_parse_tentatively (parser); /* Look for the simple-type-specifier. */ ++parser->prevent_constrained_type_specifiers; Until C++23 auto(x), we didn't have to think about auto in a parameter-decl-clause all that much I suspect.