summaryrefslogtreecommitdiffstats
path: root/lib/Lex/PPLexerChange.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-06-21 14:00:56 +0000
committerdim <dim@FreeBSD.org>2015-06-21 14:00:56 +0000
commit9dd834653b811ad20382e98a87dff824980c9916 (patch)
treea764184c2fc9486979b074250b013a0937ee64e5 /lib/Lex/PPLexerChange.cpp
parentbb9760db9b86e93a638ed430d0a14785f7ff9064 (diff)
downloadFreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.zip
FreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.tar.gz
Vendor import of clang trunk r240225:
https://llvm.org/svn/llvm-project/cfe/trunk@240225
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r--lib/Lex/PPLexerChange.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp
index e68fb7d..1a35d32 100644
--- a/lib/Lex/PPLexerChange.cpp
+++ b/lib/Lex/PPLexerChange.cpp
@@ -355,6 +355,17 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
PragmaARCCFCodeAuditedLoc = SourceLocation();
}
+ // Complain about reaching a true EOF within assume_nonnull.
+ // We don't want to complain about reaching the end of a macro
+ // instantiation or a _Pragma.
+ if (PragmaAssumeNonNullLoc.isValid() &&
+ !isEndOfMacro && !(CurLexer && CurLexer->Is_PragmaLexer)) {
+ Diag(PragmaAssumeNonNullLoc, diag::err_pp_eof_in_assume_nonnull);
+
+ // Recover by leaving immediately.
+ PragmaAssumeNonNullLoc = SourceLocation();
+ }
+
// If this is a #include'd file, pop it off the include stack and continue
// lexing the #includer file.
if (!IncludeMacroStack.empty()) {
OpenPOWER on IntegriCloud