Comments

Hi!
I've noticed that if we preprocess source with multi-line raw-string
literals (or -save-temps compile), the lines can be off if the multi-line
raw-string literal contains just a few lines (under the threshold to emit
#line directive); we already have a function for that for CPP_COMMENT
tokens and it seems it can be used for all raw string literals too.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2013-07-05 Jakub Jelinek <jakub@redhat.com>
* c-ppoutput.c (scan_translation_unit): Call account_for_newlines
for all CPP_TOKEN_FLD_STR tokens, not just CPP_COMMENT.
* include/cpplib.h (cpp_token_val_index): Change parameter type to
const cpp_token *.
* lex.c (cpp_token_val_index): Likewise.
* c-c++-common/raw-string-18.c: New test.
* c-c++-common/raw-string-19.c: New test.
Jakub

On 07/05/2013 11:22 AM, Jakub Jelinek wrote:
> - if (token->type == CPP_COMMENT)> + if (cpp_token_val_index (token) == CPP_TOKEN_FLD_STR)
This could use a comment explaining why checking for CPP_TOKEN_FLD_STR
does what you want. OK with that change.
Jason