diff options
author | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-05-04 21:08:08 +0000 |
---|---|---|
committer | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-05-04 21:08:08 +0000 |
commit | dc1702001964c3314f7090e6a4af889b5771d884 (patch) | |
tree | b9a7a9e1f35f3023e54cb549737efee8738feb6a /lib/Sema/SemaChecking.cpp | |
parent | 46484770fe264fba24f7a9f608a3b7c3342690aa (diff) |
Inhibit ObjC format warning only in system headers (NSLocalizedString).
Add a test case for the related NSAssert workaround.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 44f4ac671f..d538fcf36d 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -1749,7 +1749,8 @@ void Sema::CheckFormatArguments(Expr **Args, unsigned NumArgs, // format is either NSString or CFString. This is a hack to prevent // diag when using the NSLocalizedString and CFCopyLocalizedString macros // which are usually used in place of NS and CF string literals. - if (Type == FST_NSString && Args[format_idx]->getLocStart().isMacroID()) + if (Type == FST_NSString && + SourceMgr.isInSystemMacro(Args[format_idx]->getLocStart())) return; // If there are no arguments specified, warn with -Wformat-security, otherwise |