This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH] Fix C++ parser endless diagnostics on CPP_PRAGMA_EOL (PR c++/88258)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Nathan Sidwell <nathan at acm dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 1 Dec 2018 19:07:59 -0500
- Subject: Re: [C++ PATCH] Fix C++ parser endless diagnostics on CPP_PRAGMA_EOL (PR c++/88258)
- References: <20181130205418.GH12380@tucnak>
On 11/30/18 3:54 PM, Jakub Jelinek wrote:
The following testcase endlessly diagnoses a syntax error.
The problem is that the various C++ parser routines to skip tokens until
something happily skip over CPP_PRAGMA that starts a pragma line, but
always stop at CPP_PRAGMA_EOL, but the caller expect them to stop at
The fix is similar to what the C FE already does, treat CPP_PRAGMA_EOL
as CPP_EOF only if in_pragma flag is set. Otherwise we didn't really parse
CPP_PRAGMA normally and should skip everything until we find whatever we are
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?