]> granicus.if.org Git - clang/commitdiff
objc QOI: Don't't warn about mismatch between attributes
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 21 Dec 2011 00:09:11 +0000 (00:09 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 21 Dec 2011 00:09:11 +0000 (00:09 +0000)
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

lib/Sema/SemaDeclObjC.cpp

index 4f87db426db624b80ce50c6a6dc542ea5d799793..c86f735d57d8823d81fbd80899bf57faa0f68ef0 100644 (file)
@@ -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<DeclContext>(ClassDecl)->addDecl(ObjCMethod);