diff options
author | John McCall <rjmccall@apple.com> | 2011-10-18 00:44:04 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-10-18 00:44:04 +0000 |
commit | 3eff3214647fe25e80dbf1dd096cc73a11d9a77a (patch) | |
tree | 2225e1d8f42a7b6211754f96306ba95c51542a4c /lib/Lex/PPLexerChange.cpp | |
parent | dceb11fdcf3ea657a06d2ec90a8f4b8359ab8727 (diff) |
Fix several bugs with #pragma clang arc_cf_code_audited and macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r-- | lib/Lex/PPLexerChange.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp index da6c8aa589..dc6536427a 100644 --- a/lib/Lex/PPLexerChange.cpp +++ b/lib/Lex/PPLexerChange.cpp @@ -237,8 +237,11 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) { } } - // Complain about reaching an EOF within arc_cf_code_audited. - if (PragmaARCCFCodeAuditedLoc.isValid()) { + // Complain about reaching a true EOF within arc_cf_code_audited. + // We don't want to complain about reaching the end of a macro + // instantiation or a _Pragma. + if (PragmaARCCFCodeAuditedLoc.isValid() && + !isEndOfMacro && CurLexer && !CurLexer->Is_PragmaLexer) { Diag(PragmaARCCFCodeAuditedLoc, diag::err_pp_eof_in_arc_cf_code_audited); // Recover by leaving immediately. |