This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Raw string support
On Thu, Apr 16, 2009 at 02:47:50PM +0000, Joseph S. Myers wrote:
> Reading the specifications again, I see another issue. Both C and C++ are
> keeping the greedy algorithm for lexing, "the next preprocessing token is
> the longest sequence of characters that could constitute a preprocessing
> token". So given
> R" "
So do you suggest that we don't report any errors about
1) characters not valid in d-char-sequence
2) too long d-char-sequence
3) unterminated raw string
and instead in all these cases break appart the prefix before initial "
as a separate token? It is doable, but the user experience will be
terrible, finding out why it hasn't been lexed together as a preprocessing
token will be harder.
> Do any of the testcases cover the use of '"' itself in the d-char-sequence
> at the start and end of a raw string? It seems like a special case worth
> including in testing, and appears to be valid.
I'll add a
char *p = R""""[""]"""";
to the tests.