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 | 561aabd9435ca970b5b13aee8319a687ff5e0a77 (patch) | |
| tree | 1eab114441226d76e452de3454c218aacd10df21 /clang/lib/Lex/Lexer.cpp | |
| parent | c6da261fb4fddc43bbea9439834582ae3d7af48b (diff) | |
| download | llvm-561aabd9435ca970b5b13aee8319a687ff5e0a77.zip llvm-561aabd9435ca970b5b13aee8319a687ff5e0a77.tar.gz llvm-561aabd9435ca970b5b13aee8319a687ff5e0a77.tar.bz2 | |
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
llvm-svn: 103913
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
| -rw-r--r-- | clang/lib/Lex/Lexer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 74e8d74..83de8c8 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/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 |
