Fix assert on constant expression evaluation of floating point increment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143320 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index f33827f..bf428aa 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -2529,17 +2529,13 @@
}
bool FloatExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) {
- if (E->getOpcode() == UO_Deref)
- return false;
-
- if (!EvaluateFloat(E->getSubExpr(), Result, Info))
- return false;
-
switch (E->getOpcode()) {
default: return false;
case UO_Plus:
- return true;
+ return EvaluateFloat(E->getSubExpr(), Result, Info);
case UO_Minus:
+ if (!EvaluateFloat(E->getSubExpr(), Result, Info))
+ return false;
Result.changeSign();
return true;
}