diff options
author | Joseph Myers <joseph@codesourcery.com> | 2011-08-18 16:13:49 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2011-08-18 16:13:49 +0100 |
commit | a48e3dd10e2e898742f2a730b8307b73b1a23022 (patch) | |
tree | 08a78c5cfab58cc36bb826b78a1902d8f7e41149 /libcpp/lex.c | |
parent | 3b6fa7a5c6e84489d6be9012163c9923cbb9a95c (diff) | |
download | gcc-a48e3dd10e2e898742f2a730b8307b73b1a23022.zip gcc-a48e3dd10e2e898742f2a730b8307b73b1a23022.tar.gz gcc-a48e3dd10e2e898742f2a730b8307b73b1a23022.tar.bz2 |
c1x-uni-string-1.c, [...]: New tests.
gcc/testsuite:
* gcc.dg/c1x-uni-string-1.c, gcc.dg/c1x-uni-string-2.c: New tests.
libcpp:
* include/cpplib.h (struct cpp_options): Add rliterals.
* init.c (struct lang_flags, lang_defaults): Add rliterals.
(cpp_set_lang): Set rliterals option.
(cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
* lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
From-SVN: r177868
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r-- | libcpp/lex.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c index d460b98..463b5c8 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1,6 +1,6 @@ /* CPP Library - lexical analysis. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, + 2011 Free Software Foundation, Inc. Contributed by Per Bothner, 1994-95. Based on CCCP program by Paul Rubin, June 1986 Adapted to ANSI C, Richard Stallman, Jan 1987 @@ -2007,18 +2007,20 @@ _cpp_lex_direct (cpp_reader *pfile) case 'R': /* 'L', 'u', 'U', 'u8' or 'R' may introduce wide characters, wide strings or raw strings. */ - if (c == 'L' || CPP_OPTION (pfile, uliterals)) + if (c == 'L' || CPP_OPTION (pfile, rliterals) + || (c != 'R' && CPP_OPTION (pfile, uliterals))) { if ((*buffer->cur == '\'' && c != 'R') || *buffer->cur == '"' || (*buffer->cur == 'R' && c != 'R' && buffer->cur[1] == '"' - && CPP_OPTION (pfile, uliterals)) + && CPP_OPTION (pfile, rliterals)) || (*buffer->cur == '8' && c == 'u' && (buffer->cur[1] == '"' - || (buffer->cur[1] == 'R' && buffer->cur[2] == '"')))) + || (buffer->cur[1] == 'R' && buffer->cur[2] == '"' + && CPP_OPTION (pfile, rliterals))))) { lex_string (pfile, result, buffer->cur - 1); break; |