@@ -1410,7 +1410,9 @@ lex_raw_string (cpp_reader *pfile, cpp_t
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
@@ -0,0 +1,13 @@
+// PR preprocessor/48740
+// { dg-options "-std=gnu99 -trigraphs -save-temps" { target c } }
+// { dg-options "-std=c++0x -save-temps" { target c++ } }
+// { dg-do run }
+
+int main ()
+{
+ return __builtin_memcmp (R"raw(foo%sbar%sfred%sbob?????)raw",
+ "foo%sbar%sfred%sbob?""?""?""?""?",
+ sizeof ("foo%sbar%sfred%sbob?""?""?""?""?"));
+}
+
+// { dg-final { cleanup-saved-temps } }