From: Steve Naroff Date: Wed, 7 Nov 2007 18:07:59 +0000 (+0000) Subject: Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45ecd5daa36385b7e0b2f657357805e01f5d8cbf;p=clang Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead, return false if the declarations aren't in scope. This was a hold over from when 'id' and 'Class' were initialized lazily. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43827 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 854fc3fe43..773fe23c55 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -283,11 +283,13 @@ public: bool interfaceTypesAreCompatible(QualType, QualType); bool objcTypesAreCompatible(QualType, QualType); bool isObjcIdType(QualType T) const { - assert(IdStructType && "isObjcIdType used before 'id' type is built"); + if (!IdStructType) // ObjC isn't enabled + return false; return T->getAsStructureType() == IdStructType; } bool isObjcClassType(QualType T) const { - assert(ClassStructType && "isObjcClassType used before 'Class' type is built"); + if (!ClassStructType) // ObjC isn't enabled + return false; return T->getAsStructureType() == ClassStructType; } bool isObjcSelType(QualType T) const {