We crash when parsing
[[a::
because we see a CPP_SCOPE and then we're trying to consume a CPP_EOF
token. So peek before consuming it.
PR c++/93684 - ICE-on-invalid with broken attribute.
* parser.c (cp_parser_std_attribute): Peek a token first before
consuming it.
* g++.dg/parse/attr4.C: New test.
+2020-02-12 Marek Polacek <polacek@redhat.com>
+
+ PR c++/93684 - ICE-on-invalid with broken attribute.
+ * parser.c (cp_parser_std_attribute): Peek a token first before
+ consuming it.
+
2020-02-11 Jason Merrill <jason@redhat.com>
PR c++/93675
"with scoped attribute token");
attr_ns = attr_id;
- token = cp_lexer_consume_token (parser->lexer);
+ token = cp_lexer_peek_token (parser->lexer);
if (token->type == CPP_NAME)
attr_id = token->u.value;
else if (token->type == CPP_KEYWORD)
"expected an identifier for the attribute name");
return error_mark_node;
}
+ cp_lexer_consume_token (parser->lexer);
attr_ns = canonicalize_attr_name (attr_ns);
attr_id = canonicalize_attr_name (attr_id);
+2020-02-12 Marek Polacek <polacek@redhat.com>
+
+ PR c++/93684 - ICE-on-invalid with broken attribute.
+ * g++.dg/parse/attr4.C: New test.
+
2020-02-12 Jakub Jelinek <jakub@redhat.com>
PR target/93670
--- /dev/null
+// PR c++/93684 - ICE-on-invalid with broken attribute.
+
+[[a:: // { dg-error "expected|expected" }