From c9062d01d7978d57a310283153f35ca3c8eaffbb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 7 Apr 2008 06:06:56 +0000 Subject: MyOtherClass* is compatible with MyClass* if MyClass is a superclass of MyOtherClass, there is no need for an exact interface match. llvm-svn: 49320 --- clang/lib/AST/ASTContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/AST/ASTContext.cpp') 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

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. -- cgit v1.2.3