diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-10 16:49:24 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-10 16:49:24 +0000 |
commit | da31536d9b7fee50eb58d2bca8e1612295a75349 (patch) | |
tree | fb33b01daeb32c3b1c99c9c4f1501ea19669801f /gcc/c-family/c-ppoutput.c | |
parent | 839f2f703b717be5da58a00473aa87bd95cbbd77 (diff) | |
download | gcc-da31536d9b7fee50eb58d2bca8e1612295a75349.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200878 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-ppoutput.c')
-rw-r--r-- | gcc/c-family/c-ppoutput.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-family/c-ppoutput.c b/gcc/c-family/c-ppoutput.c index 4a1534667f6..03b88170520 100644 --- a/gcc/c-family/c-ppoutput.c +++ b/gcc/c-family/c-ppoutput.c @@ -251,7 +251,11 @@ scan_translation_unit (cpp_reader *pfile) cpp_output_token (token, print.outf); } - if (token->type == CPP_COMMENT) + /* CPP_COMMENT tokens and raw-string literal tokens can + have embedded new-line characters. Rather than enumerating + all the possible token types just check if token uses + val.str union member. */ + if (cpp_token_val_index (token) == CPP_TOKEN_FLD_STR) account_for_newlines (token->val.str.text, token->val.str.len); } } |