]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Fix scan forward over pragma [PR96257]
authorNathan Sidwell <nathan@acm.org>
Tue, 21 Jul 2020 19:37:58 +0000 (12:37 -0700)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:18:51 +0000 (13:18 -0300)
commitb23189bbf43bf87ffb586173256f9b112e0ca5e0
tree765e06c02833e3827b71aefa3103f3a5f6854748
parent04121bc24154ad0c5058fd9c73abb3a97982180b
c++: Fix scan forward over pragma [PR96257]

It turns out that the paren scanning code is used for speculatively searching
to see if we're looking at a compound_literal.  So we shouldn't always purge
pragma tokens.

gcc/cp/
* parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
(cp_parser_skip_to_closing_parenthesis_1): Only pass start token
to pragma skipper if recovering.
(cp_parser_skip_to_pragma_eol): Only purge and change pragma
state when recovering.
gcc/testsuite/
* g++.dg/parse/pr96257.C: New.
gcc/cp/parser.c
gcc/testsuite/g++.dg/parse/pr96257.C [new file with mode: 0644]