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
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.
diff --git a/test/Sema/objc-comptypes-5.m b/test/Sema/objc-comptypes-5.m
index e594a6e35d..7101e96043 100644
--- a/test/Sema/objc-comptypes-5.m
+++ b/test/Sema/objc-comptypes-5.m
@@ -1,4 +1,4 @@
-// RUN: clang -fsyntax-only -verify %s
+// RUN: clang -fsyntax-only -pedantic -verify %s
#define nil (void *)0;
@@ -23,6 +23,7 @@ int main()
id