diff options
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 7803b10..022a201 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -12102,7 +12102,12 @@ public: } bool VisitTypeTraitExpr(const TypeTraitExpr *E) { - return Success(E->getValue(), E); + if (E->isStoredAsBoolean()) + return Success(E->getBoolValue(), E); + if (E->getAPValue().isAbsent()) + return false; + assert(E->getAPValue().isInt() && "APValue type not supported"); + return Success(E->getAPValue().getInt(), E); } bool VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *E) { |