diff options
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index ca87bb8197f..a4857b60731 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -460,7 +460,8 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup, bool followSuper, - const ObjCCategoryDecl *C) const + const ObjCCategoryDecl *C, + const ObjCProtocolDecl *P) const { // FIXME: Should make sure no callers ever do this. if (!hasDefinition()) @@ -473,6 +474,22 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel, LoadExternalDefinition(); while (ClassDecl) { + // If we are looking for a method that is part of protocol conformance, + // check if the superclass has been marked to suppress conformance + // of that protocol. + if (P && ClassDecl->hasAttrs()) { + const AttrVec &V = ClassDecl->getAttrs(); + const IdentifierInfo *PI = P->getIdentifier(); + for (AttrVec::const_iterator I = V.begin(), E = V.end(); I != E; ++I) { + if (const ObjCSuppressProtocolAttr *A = + dyn_cast<ObjCSuppressProtocolAttr>(*I)){ + if (A->getProtocol() == PI) { + return 0; + } + } + } + } + if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance))) return MethodDecl; |