diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-16 19:54:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-16 19:54:05 +0000 |
commit | 150fcd5dcb79ad0a9cc6824c5589000e3669c7a4 (patch) | |
tree | 08c07778ed669fbc79f5921f5d2c3fe9581ffc8d /lib/Lex/Lexer.cpp | |
parent | 79bc57c074cb91f574fba19215f95b63dcf6b04b (diff) |
when code completing inside a C-style block comment, don't emit errors about
a missing */ since we truncated the file.
This fixes rdar://7948776
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 74e8d7489e..83de8c83a9 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -1141,7 +1141,8 @@ bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr) { unsigned char C = getCharAndSize(CurPtr, CharSize); CurPtr += CharSize; if (C == 0 && CurPtr == BufferEnd+1) { - if (!isLexingRawMode()) + if (!isLexingRawMode() && + !PP->isCodeCompletionFile(FileLoc)) Diag(BufferPtr, diag::err_unterminated_block_comment); --CurPtr; @@ -1224,7 +1225,7 @@ bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr) { Diag(CurPtr-1, diag::warn_nested_block_comment); } } else if (C == 0 && CurPtr == BufferEnd+1) { - if (!isLexingRawMode()) + if (!isLexingRawMode() && !PP->isCodeCompletionFile(FileLoc)) Diag(BufferPtr, diag::err_unterminated_block_comment); // Note: the user probably forgot a */. We could continue immediately // after the /*, but this would involve lexing a lot of what really is the |