diff options
-rw-r--r-- | gcc/testsuite/c-c++-common/cpp/pr96323.c | 8 | ||||
-rw-r--r-- | libcpp/lex.c | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/testsuite/c-c++-common/cpp/pr96323.c b/gcc/testsuite/c-c++-common/cpp/pr96323.c new file mode 100644 index 0000000..7a8edff --- /dev/null +++ b/gcc/testsuite/c-c++-common/cpp/pr96323.c @@ -0,0 +1,8 @@ +/* PR preprocessor/96323 */ +/* { dg-do preprocess } */ +/* { dg-options "-std=gnu99 -Wno-c++-compat -trigraphs" { target c } } */ +/* { dg-options "-std=c++0x" { target c++ } } */ +/* { dg-error "invalid new-line in raw string delimiter" "" { target *-*-* } .+2 } */ +/* { dg-warning "missing terminating . character" "" { target *-*-* } .+2 } */ +const char tu[] = R"a"; +const char tua[] = "(R)a"; diff --git a/libcpp/lex.c b/libcpp/lex.c index 5d94882..9aec9e0 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1885,7 +1885,8 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base) the best failure mode. */ prefix_len = 0; } - continue; + if (c != '\n') + continue; } if (phase != PHASE_NONE) |