summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/AST/ASTContext.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 854fc3fe43f..773fe23c55a 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/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 {
OpenPOWER on IntegriCloud