summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-04-24 01:32:09 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-04-24 01:32:09 +0200
commit6cfae07011d50127089bc1ae02837f924cefccb2 (patch)
tree512c00cfe469cc71e5b4077ab0e7dfb1018b4b2b /libcpp
parent8d6a2f696859496139e6e484dec046c405a69c36 (diff)
downloadgcc-6cfae07011d50127089bc1ae02837f924cefccb2.tar.gz
re PR preprocessor/48740 (Raw C++0x strings and trigraphs mix badly)
PR preprocessor/48740 * lex.c (lex_raw_string): When raw string ends with ??) followed by raw prefix and ", ensure it is preprocessed with ??) rather than ??]. * c-c++-common/raw-string-11.c: New test. From-SVN: r172903
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog7
-rw-r--r--libcpp/lex.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index eb93719e27b..26013027b69 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/48740
+ * lex.c (lex_raw_string): When raw string ends with
+ ??) followed by raw prefix and ", ensure it is preprocessed
+ with ??) rather than ??].
+
2011-04-20 Jim Meyering <meyering@redhat.com>
* files.c (destroy_cpp_file): Remove useless if-before-free.
diff --git a/libcpp/lex.c b/libcpp/lex.c
index c9b5c95df6a..3bf4886b6d2 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -1410,7 +1410,9 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base,
raw_prefix_len) == 0
&& cur[raw_prefix_len+1] == '"')
{
- cur += raw_prefix_len+2;
+ BUF_APPEND (")", 1);
+ base++;
+ cur += raw_prefix_len + 2;
goto break_outer_loop;
}
else