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 | cc538345be8b30e4f47421a282ba254576e5b88b (patch) | |
| tree | 0c7609cbdc4a09e8d48eb416684b9b39df84f386 /clang/lib/Lex | |
| parent | b9baa448b95e71252fa67250b7dfc0ba73df4db2 (diff) | |
| download | bcm5719-llvm-cc538345be8b30e4f47421a282ba254576e5b88b.tar.gz bcm5719-llvm-cc538345be8b30e4f47421a282ba254576e5b88b.zip | |
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>
llvm-svn: 174081
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/Lexer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 4b5a3135c36..1b064c88ff8 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/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; |

