]> granicus.if.org Git - clang/commitdiff
Teach ASTContext::tagTypesAreCompatible() about the built-in ObjC types (Class and...
authorSteve Naroff <snaroff@apple.com>
Wed, 7 Nov 2007 06:03:51 +0000 (06:03 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 7 Nov 2007 06:03:51 +0000 (06:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43809 91177308-0d34-0410-b5e6-96231b3b80d8

AST/ASTContext.cpp

index ef444b48f461f61da145c621ff0708e9ec685fd4..66993681baf5c4dc1c52903094c6a4e831f0b7da 100644 (file)
@@ -1182,6 +1182,10 @@ bool ASTContext::tagTypesAreCompatible(QualType lhs, QualType rhs) {
     if (ldecl->getIdentifier() == rdecl->getIdentifier())
       return true;
   }
+  // "Class" and "id" are compatible built-in structure types.
+  if (isObjcIdType(lhs) && isObjcClassType(rhs) ||
+      isObjcClassType(lhs) && isObjcIdType(rhs))
+    return true;
   return false;
 }