]> granicus.if.org Git - clang/commitdiff
Sema::ActOnClassMessage()...if a class method isn't found, lookup an instance method...
authorSteve Naroff <snaroff@apple.com>
Mon, 5 Nov 2007 15:27:52 +0000 (15:27 +0000)
committerSteve Naroff <snaroff@apple.com>
Mon, 5 Nov 2007 15:27:52 +0000 (15:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43708 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaExpr.cpp

index bc371c77d0033171ad4c4e2b109b8d5ce4fe5f03..111ddbaaad545152d0a78d9232aa3034a8cb565d 100644 (file)
@@ -2063,6 +2063,10 @@ Sema::ExprResult Sema::ActOnClassMessage(
   ObjcInterfaceDecl* ClassDecl = getObjCInterfaceDecl(receiverName);
   ObjcMethodDecl *Method = ClassDecl->lookupClassMethod(Sel);
   QualType returnType;
+  
+  // Before we give up, check if the selector is an instance method.
+  if (!Method)
+    Method = ClassDecl->lookupInstanceMethod(Sel);
   if (!Method) {
     Diag(lbrac, diag::warn_method_not_found, std::string("+"), Sel.getName(),
          SourceRange(lbrac, rbrac));