aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-07 06:06:56 +0000
committerChris Lattner <sabre@nondot.org>2008-04-07 06:06:56 +0000
commit42a997c93b2166facfd3c93ffd5027e4930545dd (patch)
treecf00d447af6497d3be0e4ba96ca8c2430b862426 /lib/AST/ASTContext.cpp
parent3cc4c0c3058a788689b8fc73c0ac139544435c97 (diff)
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
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 355308a40c..c071e5ebd6 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1441,7 +1441,8 @@ static bool areCompatObjCInterfaces(const ObjCInterfaceType *LHS,
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.