aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-04-07 15:07:57 +0000
committerSteve Naroff <snaroff@apple.com>2009-04-07 15:07:57 +0000
commitebaa768521cfd5318d77f1efaf7ae47020863a9d (patch)
treef63dd8eb12933dbc8c01e42adf9cca3a2989ee4a /lib/Sema/SemaExprObjC.cpp
parentc1279db9c37d65fc8f046830b6e703ce7e30f52a (diff)
Tweak Sema::ActOnInstanceMessage() to look for a class method when dealing with qualified id's. This change is motivated by our desire to not support the "Class<foo>" idiom. Note that the change makes perfect sense (since all ObjC classes are also id/instances).
This allow us to document a simple migration path...change "Class <foo>" to "id <foo>". This effects: - <rdar://problem/6761939> TASK: File source change radars for "qualified Class" errors - <rdar://problem/6761864> Protocol qualified Class is unsupported git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index cfa279aa31..54ed709d0f 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -548,6 +548,9 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
ObjCProtocolDecl *PDecl = QIT->getProtocols(i);
if (PDecl && (Method = PDecl->lookupInstanceMethod(Sel)))
break;
+ // Since we aren't supporting "Class<foo>", look for a class method.
+ if (PDecl && (Method = PDecl->lookupClassMethod(Sel)))
+ break;
}
} else if (const ObjCInterfaceType *OCIType =
ReceiverCType->getAsPointerToObjCInterfaceType()) {