c++: Fix ICE-on-invalid with broken attribute [PR93684]
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.
Showing
gcc/testsuite/g++.dg/parse/attr4.C
0 → 100644
Please
register
or
sign in
to comment