diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 727678662db4..07f6c5476d05 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -730,11 +730,11 @@ bool IntExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) { } bool IntExprEvaluator::VisitConditionalOperator(const ConditionalOperator *E) { - llvm::APSInt Cond(32); - if (!EvaluateInteger(E->getCond(), Cond, Info)) + bool Cond; + if (!HandleConversionToBool(E->getCond(), Cond, Info)) return false; - return Visit(Cond != 0 ? E->getTrueExpr() : E->getFalseExpr()); + return Visit(Cond ? E->getTrueExpr() : E->getFalseExpr()); } /// VisitSizeAlignOfExpr - Evaluate a sizeof or alignof with a result as the