[Bug c/88766] [9 Regression] Rejects valid? C code since r259641

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 9 18:11:00 GMT 2019


--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As for the GCC diagnostic pragma, we need it to be a deferred pragma, have no
idea how else could we handle that when it is not visible in the token stream. 
And, if it is visible in the token stream, accepting it everywhere in the
exceptions would be quite hard too, e.g. the C FE normally has only 2 tokens
lookahead, or how would it play in C++ FE with the tentative parsing?
What we could do is accept #pragma GCC diagnostic (and only that?) inside of
the braced initializers (so c_parser_braced_init for C and
cp_parser_braced_list? for C++), before each init elt and after those, perhaps
rejecting it if it appears before a comma.  Of course, for gnupg2 they would
need to adjust their macros slightly, because the would need to go inside of
the compound literal braced init rather than around it.

Thoughts on that?

More information about the Gcc-bugs mailing list