Patch ping

Jakub Jelinek
Mon Oct 12 20:21:00 GMT 2009

On Mon, Oct 12, 2009 at 01:20:36PM -0600, Tom Tromey wrote:
> I read the patch.  Sorry about the delay -- these days my attention
> wanders a lot so pings for libcpp patches are very helpful.


> I didn't see anything limiting this to C++0x, but I suppose that will be
> done outside libcpp.
> The patch refers to `CPP_OPTION (pfile, uliterals)' but I didn't see an
> addition to struct cpp_options.

Both of the above questions are related.  It is uliterals that limits this
to C++0x and GNUC99, and that wasn't added because it is already
pre-existing.  Before this patch it was used to limit u"", U"", u'x', U'x',
now it guards also u8"", R"[]", LR"[]", uR"[]", UR"[]" and u8R"[]" style
strings.  See init.c (lang_defaults).

> Would it be too much trouble to use calls to cpp_error_with_line for all
> new errors?  I think this is generally preferable, and in this code I
> think it would also let us emit errors against locations inside strings.
> (And, for errors about unterminated strings, it would let us point to
> the start of the string, which seems better to me.)
> lex_raw_string uses _cpp_get_fresh_line, failing if that returns false.
> _cpp_get_fresh_line will always return false inside of a directive -- do
> we care about raw strings containing newlines in directives?

I'll look at these 2 tomorrow.

> +/* Lexes raw a string.  The stored string contains the spelling, including
> I think the first sentence should be "Lexes a raw string".

Fixed in my copy.

> >From _cpp_lex_direct:
> +    case 'R':
>        /* 'L', 'u' or 'U' may introduce wide characters or strings.  */
> This comment needs an update.


> This isn't part of libcpp, but it seems to me that C_LEX_RAW_STRINGS is
> now confusingly named.

C_LEX_STRING_NO_JOIN will need to be used instead.


More information about the Gcc-patches mailing list