diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-12 08:41:26 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-12 08:41:26 +0000 |
commit | 7173826daf929b5d925bbb183f1d1e0c4f2e7be8 (patch) | |
tree | d5fa37d59785f9f27547b58ef19a4983866c4ff8 /libcpp | |
parent | 5ea851c7f59adf0fde5892c34d5059da38ea7dee (diff) | |
download | gcc-7173826daf929b5d925bbb183f1d1e0c4f2e7be8.tar.gz |
2013-07-12 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 200918 using svnmerge.py
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@200920 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 16 | ||||
-rw-r--r-- | libcpp/include/cpplib.h | 2 | ||||
-rw-r--r-- | libcpp/lex.c | 15 |
3 files changed, 29 insertions, 4 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 0cf9100cf62..9213232aa98 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,19 @@ +2013-07-10 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/57824 + * lex.c (lex_raw_string): Allow reading new-lines if + in_deferred_pragma or if parsing_args and there is still + data in the current buffer. + + * include/cpplib.h (cpp_token_val_index): Change parameter type to + const cpp_token *. + * lex.c (cpp_token_val_index): Likewise. + + PR preprocessor/57757 + * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING + or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that + starts if a-zA-Z_. + 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net> * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 76c297acdcb..6c4225c8be7 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -248,7 +248,7 @@ struct GTY(()) cpp_token { }; /* Say which field is in use. */ -extern enum cpp_token_fld_kind cpp_token_val_index (cpp_token *tok); +extern enum cpp_token_fld_kind cpp_token_val_index (const cpp_token *tok); /* A type wide enough to hold any multibyte source character. cpplib's character constant interpreter requires an unsigned type. diff --git a/libcpp/lex.c b/libcpp/lex.c index 022d31016e2..fc89bafd81b 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1543,8 +1543,8 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, else if (c == '\n') { if (pfile->state.in_directive - || pfile->state.parsing_args - || pfile->state.in_deferred_pragma) + || (pfile->state.parsing_args + && pfile->buffer->next_line >= pfile->buffer->rlimit)) { cur--; type = CPP_OTHER; @@ -2767,6 +2767,15 @@ cpp_avoid_paste (cpp_reader *pfile, const cpp_token *token1, || (CPP_OPTION (pfile, objc) && token1->val.str.text[0] == '@' && (b == CPP_NAME || b == CPP_STRING))); + case CPP_STRING: + case CPP_WSTRING: + case CPP_UTF8STRING: + case CPP_STRING16: + case CPP_STRING32: return (CPP_OPTION (pfile, user_literals) + && (b == CPP_NAME + || (TOKEN_SPELL (token2) == SPELL_LITERAL + && ISIDST (token2->val.str.text[0])))); + default: break; } @@ -3020,7 +3029,7 @@ _cpp_aligned_alloc (cpp_reader *pfile, size_t len) /* Say which field of TOK is in use. */ enum cpp_token_fld_kind -cpp_token_val_index (cpp_token *tok) +cpp_token_val_index (const cpp_token *tok) { switch (TOKEN_SPELL (tok)) { |