From: Fariborz Jahanian Date: Wed, 21 Dec 2011 00:09:11 +0000 (+0000) Subject: objc QOI: Don't't warn about mismatch between attributes X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28441e6cee11fe6c2b3e13980f81203d14e73202;p=clang objc QOI: Don't't warn about mismatch between attributes on method declaration and definition if former is in a system header. // rdar://10580333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147020 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 4f87db426d..c86f735d57 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -2737,8 +2737,11 @@ Decl *Sema::ActOnMethodDeclaration( ObjCMethod->isInstanceMethod()); if (ObjCMethod->hasAttrs() && containsInvalidMethodImplAttribute(IMD, ObjCMethod->getAttrs())) { - Diag(EndLoc, diag::warn_attribute_method_def); - Diag(IMD->getLocation(), diag::note_method_declared_at); + SourceLocation MethodLoc = IMD->getLocation(); + if (!getSourceManager().isInSystemHeader(MethodLoc)) { + Diag(EndLoc, diag::warn_attribute_method_def); + Diag(MethodLoc, diag::note_method_declared_at); + } } } else { cast(ClassDecl)->addDecl(ObjCMethod);