MyOtherClass<MyProtocol>* is compatible with MyClass*
if MyClass is a superclass of MyOtherClass, there is no need for
an exact interface match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49320 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 355308a..c071e5e 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1441,7 +1441,8 @@
                                     const ObjCInterfaceType *RHS) {
   // II is compatible with II<P> if the base is the same.  Otherwise, no two
   // qualified interface types are the same.
-  if (LHS->getDecl() != RHS->getDecl()) return false;
+  if (!LHS->getDecl()->isSuperClassOf(RHS->getDecl()))
+    return false;
   
   // If the base decls match and one is a qualified interface and one isn't,
   // then they are compatible.