From: Steve Naroff Date: Wed, 7 Nov 2007 06:03:51 +0000 (+0000) Subject: Teach ASTContext::tagTypesAreCompatible() about the built-in ObjC types (Class and... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab373097926c4f24dd653e8b9aebcbf2eff17881;p=clang Teach ASTContext::tagTypesAreCompatible() about the built-in ObjC types (Class and id), removing a bogus warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43809 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp index ef444b48f4..66993681ba 100644 --- a/AST/ASTContext.cpp +++ b/AST/ASTContext.cpp @@ -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; }