diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-12 17:04:55 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-12 17:04:55 +0000 |
commit | 02690ba643abc4b71e275fbf27f38c4e6330c4ce (patch) | |
tree | 3e21814b55f7f839642f7506294b99c02228bc99 /clang/lib/Lex/PTHLexer.cpp | |
parent | ca4930b4453da1444221772199983c43b1ea95ae (diff) | |
download | bcm5719-llvm-02690ba643abc4b71e275fbf27f38c4e6330c4ce.tar.gz bcm5719-llvm-02690ba643abc4b71e275fbf27f38c4e6330c4ce.zip |
Don't emit end-of-file diagnostics like "unterminated conditional" or
"unterminated string" when we're performing code completion.
llvm-svn: 110933
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r-- | clang/lib/Lex/PTHLexer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp index 60b6e045265..63b4823cf19 100644 --- a/clang/lib/Lex/PTHLexer.cpp +++ b/clang/lib/Lex/PTHLexer.cpp @@ -146,8 +146,9 @@ bool PTHLexer::LexEndOfFile(Token &Result) { // If we are in a #if directive, emit an error. while (!ConditionalStack.empty()) { - PP->Diag(ConditionalStack.back().IfLoc, - diag::err_pp_unterminated_conditional); + if (!PP->isCodeCompletionFile(FileStartLoc)) + PP->Diag(ConditionalStack.back().IfLoc, + diag::err_pp_unterminated_conditional); ConditionalStack.pop_back(); } |