diff options
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r-- | libcpp/lex.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c index 5758e58..8f2bdc8 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1858,7 +1858,8 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base) else if (terminator == '\'') type = (*base == 'L' ? CPP_WCHAR : *base == 'U' ? CPP_CHAR32 : - *base == 'u' ? CPP_CHAR16 : CPP_CHAR); + *base == 'u' ? (base[1] == '8' ? CPP_UTF8CHAR : CPP_CHAR16) + : CPP_CHAR); else terminator = '>', type = CPP_HEADER_NAME; @@ -2403,7 +2404,8 @@ _cpp_lex_direct (cpp_reader *pfile) && CPP_OPTION (pfile, rliterals)) || (*buffer->cur == '8' && c == 'u' - && (buffer->cur[1] == '"' + && ((buffer->cur[1] == '"' || (buffer->cur[1] == '\'' + && CPP_OPTION (pfile, utf8_char_literals))) || (buffer->cur[1] == 'R' && buffer->cur[2] == '"' && CPP_OPTION (pfile, rliterals))))) { |