diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-01-31 19:48:48 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-01-31 19:48:48 +0000 |
commit | 0ed439487491e09faffdbabfacb1d050292c7723 (patch) | |
tree | 22ef0ede82481c9a777dbd563adfd2869f0d3750 /lib/Lex/Lexer.cpp | |
parent | 98b21b9fcef25fc6953ce36b4c71ca2c02999f1d (diff) |
Lexer: Don't warn about Unicode in preprocessor directives.
This allows people to use Unicode in their #pragma mark and in macros
that exist only to be string-ized.
<rdar://problem/13107323&13121362>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174081 91177308-0d34-0410-b5e6-96231b3b80d8
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; |