]> granicus.if.org Git - clang/commitdiff
Silence the category-replacing-class-method warning for +load: category
authorDavid Chisnall <csdavec@swan.ac.uk>
Mon, 8 Aug 2011 17:32:19 +0000 (17:32 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Mon, 8 Aug 2011 17:32:19 +0000 (17:32 +0000)
implementations of +load do not replace the class definition in a meaningful
sense, they are run when the category loads, the +load method for class is run
when the class is loaded.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137053 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclObjC.cpp

index 3652a2cdd8a2f98ac3f9821a9cccc4ac37d41426..87948548a4d4239a15523e258b140d140fb5e1ac 100644 (file)
@@ -1311,6 +1311,9 @@ void Sema::WarnExactTypedMethods(ObjCMethodDecl *ImpMethodDecl,
     }
   if (match)
     match = (ImpMethodDecl->isVariadic() == MethodDecl->isVariadic());
+  if (match)
+    match = !(MethodDecl->isClassMethod() &&
+              MethodDecl->getSelector() == GetNullarySelector("load", Context));
   
   if (match) {
     Diag(ImpMethodDecl->getLocation(),