Warn if class object does not implement qualified
id's protocols. Fixes radar 8154220.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110583 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 2c16c07..7d15926 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -4323,10 +4323,10 @@
if (ObjCInterfaceDecl *lhsID = lhsOPT->getInterfaceDecl()) {
for (ObjCObjectPointerType::qual_iterator I = rhsQID->qual_begin(),
E = rhsQID->qual_end(); I != E; ++I) {
- // when comparing an id<P> on lhs with a static type on rhs,
- // see if static class implements all of id's protocols, directly or
- // through its super class and categories.
- if (lhsID->ClassImplementsProtocol(*I, true)) {
+ // when comparing an id<P> on rhs with a static type on lhs,
+ // static class must implement all of id's protocols directly or
+ // indirectly through its super class.
+ if (lhsID->ClassImplementsProtocol(*I, false)) {
match = true;
break;
}