Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 77cfe6c..a24e708 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -2526,7 +2526,7 @@
Expr::EvalResult InitializerValue;
// FIXME: Check whether Initializer is a constant expression according
// to C++0x [expr.const], rather than just whether it can be folded.
- if (Initializer->Evaluate(InitializerValue, Ctx) &&
+ if (Initializer->EvaluateAsRValue(InitializerValue, Ctx) &&
!InitializerValue.HasSideEffects && InitializerValue.Val.isFloat()) {
// Constant! (Except for FIXME above.)
llvm::APFloat FloatVal = InitializerValue.Val.getFloat();