[cfe-commits] r43708 - /cfe/trunk/Sema/SemaExpr.cpp

Steve Naroff snaroff at apple.com
Mon Nov 5 07:27:52 PST 2007


Author: snaroff
Date: Mon Nov  5 09:27:52 2007
New Revision: 43708

URL: http://llvm.org/viewvc/llvm-project?rev=43708&view=rev
Log:

Sema::ActOnClassMessage()...if a class method isn't found, lookup an instance method. Since all classes are also instances, this is appropriate.

Modified:
    cfe/trunk/Sema/SemaExpr.cpp

Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=43708&r1=43707&r2=43708&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Mon Nov  5 09:27:52 2007
@@ -2063,6 +2063,10 @@
   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));





More information about the cfe-commits mailing list