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

llvm-svn: 43708
This commit is contained in:
Steve Naroff 2007-11-05 15:27:52 +00:00
parent f8bc406d5d
commit 96d20616c4
1 changed files with 4 additions and 0 deletions

View 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));