ASTContext::typesAreCompatible(): id is compatible with all qualified id types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51939 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 5a3ca44..a87efa7 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1639,7 +1639,16 @@
return isObjCIdType(RHS);
if (isa<ObjCInterfaceType>(RHS))
return isObjCIdType(LHS);
-
+
+ // ID is compatible with all qualified id types.
+ if (isa<ObjCQualifiedIdType>(LHS)) {
+ if (const PointerType *PT = RHS->getAsPointerType())
+ return isObjCIdType(PT->getPointeeType());
+ }
+ if (isa<ObjCQualifiedIdType>(RHS)) {
+ if (const PointerType *PT = LHS->getAsPointerType())
+ return isObjCIdType(PT->getPointeeType());
+ }
// C99 6.7.2.2p4: Each enumerated type shall be compatible with char,
// a signed integer type, or an unsigned integer type.
if (LHS->isEnumeralType() && RHS->isIntegralType()) {