diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2015-07-02 18:54:41 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-07-02 18:54:41 +0000 |
commit | fbb22910cfa4e4567b46fc8b74ccfad92fa745d8 (patch) | |
tree | 2aac293a422c002719640bf2767fde8c557ab77b /libcpp/lex.c | |
parent | a05d02b293b299352b9523875e96bf697f96baf4 (diff) | |
download | gcc-fbb22910cfa4e4567b46fc8b74ccfad92fa745d8.zip gcc-fbb22910cfa4e4567b46fc8b74ccfad92fa745d8.tar.gz gcc-fbb22910cfa4e4567b46fc8b74ccfad92fa745d8.tar.bz2 |
re PR preprocessor/53690 ([C++11] \u0000 and \U00000000 are wrongly encoded as U+0001.)
/libcpp
2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53690
* charset.c (_cpp_valid_ucn): Add cppchar_t * parameter and change
return type to bool. Fix encoding of \u0000 and \U00000000 in C++.
(convert_ucn): Adjust call.
* lex.c (forms_identifier_p): Likewise.
* internal.h (_cpp_valid_ucn): Adjust declaration.
/gcc/testsuite
2015-07-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53690
* g++.dg/cpp/pr53690.C: New.
From-SVN: r225353
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r-- | libcpp/lex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c index 8f2bdc8..0aa1090 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1244,9 +1244,10 @@ forms_identifier_p (cpp_reader *pfile, int first, && *buffer->cur == '\\' && (buffer->cur[1] == 'u' || buffer->cur[1] == 'U')) { + cppchar_t s; buffer->cur += 2; if (_cpp_valid_ucn (pfile, &buffer->cur, buffer->rlimit, 1 + !first, - state)) + state, &s)) return true; buffer->cur -= 2; } |