https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123609
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Guess that is due to tentative parsing.
But even
--- gcc/cp/parser.cc.jj 2026-01-15 16:33:46.986098317 +0100
+++ gcc/cp/parser.cc 2026-01-16 16:11:23.387105508 +0100
@@ -33726,7 +33726,7 @@ cp_parser_annotation_list (cp_parser *pa
{
tree annotation = cp_parser_annotation (parser);
if (annotation == error_mark_node)
- break;
+ return error_mark_node;
annotation = build_tree_list (NULL_TREE, annotation);
if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))
{
doesn't fix it, while we propagate error_mark_node longer and
cp_parser_class_head can see it, it doesn't care and doesn't fail the class
head parsing.
[[=]] int a; is normally diagnosed.