diff options
-rw-r--r-- | include/clang/AST/ASTContext.h | 6 |
1 files changed, 4 insertions, 2 deletions
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 { |