summaryrefslogtreecommitdiffstats
path: root/clang/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
commitc9062d01d7978d57a310283153f35ca3c8eaffbb (patch)
tree1287929611d7d7ef819cfebc4b74e3add4adecde /clang/lib/AST/ASTContext.cpp
parent7bbd3d75efd9193762e14ea7bde87c91668e2eae (diff)
downloadbcm5719-llvm-c9062d01d7978d57a310283153f35ca3c8eaffbb.tar.gz
bcm5719-llvm-c9062d01d7978d57a310283153f35ca3c8eaffbb.zip
MyOtherClass<MyProtocol>* is compatible with MyClass*
if MyClass is a superclass of MyOtherClass, there is no need for an exact interface match. llvm-svn: 49320
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 355308a40ca..c071e5ebd62 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud