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
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 @@
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 @@
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