diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-29 00:50:52 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-29 00:50:52 +0000 |
commit | 51f4708c00110940ca3f337961915f2ca1668375 (patch) | |
tree | 8507a7dfb0f17042f2373b7fa309b00967283c2c /lib/Sema/SemaInit.cpp | |
parent | 7800212ef29be314d55814e8dcc568ff8beed106 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 77cfe6c2de..a24e708b1e 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -2526,7 +2526,7 @@ bool InitializationSequence::endsWithNarrowing(ASTContext &Ctx, 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(); |