File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -9678,6 +9678,17 @@ Parser<ManagedTokenSource>::parse_bare_function_type (
96789678 if (!skip_token (FN_KW))
96799679 return nullptr ;
96809680
9681+ auto t = lexer.peek_token ();
9682+ if (t->get_id () == IDENTIFIER)
9683+ {
9684+ Error error (t->get_locus (),
9685+ " unexpected token %qs - expected bare function" ,
9686+ t->get_token_description ());
9687+ add_error (std::move (error));
9688+
9689+ return nullptr ;
9690+ }
9691+
96819692 if (!skip_token (LEFT_PAREN))
96829693 return nullptr ;
96839694
@@ -9686,7 +9697,7 @@ Parser<ManagedTokenSource>::parse_bare_function_type (
96869697 bool is_variadic = false ;
96879698 AST::AttrVec variadic_attrs;
96889699
9689- const_TokenPtr t = lexer.peek_token ();
9700+ t = lexer.peek_token ();
96909701 while (t->get_id () != RIGHT_PAREN)
96919702 {
96929703 AST::AttrVec temp_attrs = parse_outer_attributes ();
You can’t perform that action at this time.
0 commit comments