diff options
author | Steve Naroff <snaroff@apple.com> | 2008-12-08 20:57:28 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-12-08 20:57:28 +0000 |
commit | 5fd31b17df35c03b963861c934d3c3690732b42e (patch) | |
tree | 6c71ca99c58ca1231f6a72f8be01200cb2a53b21 /clang/lib/AST/DeclObjC.cpp | |
parent | f1ab600362a06e6e3655259992cd6c89a168b75d (diff) | |
download | bcm5719-llvm-5fd31b17df35c03b963861c934d3c3690732b42e.tar.gz bcm5719-llvm-5fd31b17df35c03b963861c934d3c3690732b42e.zip |
ObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories protocols.
Fixes <rdar://problem/6418640> clang on prokit: error: incompatible type returning 'id', expected 'NSSize'
llvm-svn: 60716
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 0458282fb38..85b8ec14e04 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -685,6 +685,14 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupInstanceMethod(Selector Sel) { while (CatDecl) { if ((MethodDecl = CatDecl->getInstanceMethod(Sel))) return MethodDecl; + + // Didn't find one yet - look through protocols. + const ObjCList<ObjCProtocolDecl> &Protocols = + CatDecl->getReferencedProtocols(); + for (ObjCList<ObjCProtocolDecl>::iterator I = Protocols.begin(), + E = Protocols.end(); I != E; ++I) + if ((MethodDecl = (*I)->getInstanceMethod(Sel))) + return MethodDecl; CatDecl = CatDecl->getNextClassCategory(); } ClassDecl = ClassDecl->getSuperClass(); |