diff options
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 4b5a3135c3..1b064c88ff 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -2832,7 +2832,8 @@ void Lexer::LexUnicode(Token &Result, uint32_t C, const char *CurPtr) { return LexIdentifier(Result, CurPtr); } - if (!isLexingRawMode() && !PP->isPreprocessedOutput() && + if (!isLexingRawMode() && !ParsingPreprocessorDirective && + !PP->isPreprocessedOutput() && !isASCII(*BufferPtr) && !isAllowedIDChar(C)) { // Non-ASCII characters tend to creep into source code unintentionally. // Instead of letting the parser complain about the unknown token, @@ -3537,7 +3538,8 @@ LexNextToken: if (Status == conversionOK) return LexUnicode(Result, CodePoint, CurPtr); - if (isLexingRawMode() || PP->isPreprocessedOutput()) { + if (isLexingRawMode() || ParsingPreprocessorDirective || + PP->isPreprocessedOutput()) { ++CurPtr; Kind = tok::unknown; break; |