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 @@ -9670,6 +9670,17 @@ Parser<ManagedTokenSource>::parse_bare_function_type (
96709670 if (!skip_token (FN_KW))
96719671 return nullptr ;
96729672
9673+ auto t = lexer.peek_token ();
9674+ if (t->get_id () == IDENTIFIER)
9675+ {
9676+ Error error (t->get_locus (),
9677+ " unexpected token %qs - expected bare function" ,
9678+ t->get_token_description ());
9679+ add_error (std::move (error));
9680+
9681+ return nullptr ;
9682+ }
9683+
96739684 if (!skip_token (LEFT_PAREN))
96749685 return nullptr ;
96759686
@@ -9678,7 +9689,7 @@ Parser<ManagedTokenSource>::parse_bare_function_type (
96789689 bool is_variadic = false ;
96799690 AST::AttrVec variadic_attrs;
96809691
9681- const_TokenPtr t = lexer.peek_token ();
9692+ t = lexer.peek_token ();
96829693 while (t->get_id () != RIGHT_PAREN)
96839694 {
96849695 AST::AttrVec temp_attrs = parse_outer_attributes ();
You can’t perform that action at this time.
0 commit comments