aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-10-29 00:50:52 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-10-29 00:50:52 +0000
commit51f4708c00110940ca3f337961915f2ca1668375 (patch)
tree8507a7dfb0f17042f2373b7fa309b00967283c2c /lib/Sema/SemaStmt.cpp
parent7800212ef29be314d55814e8dcc568ff8beed106 (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/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 6dcfbbab84..8c99e8a4de 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -666,7 +666,8 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch,
bool ShouldCheckConstantCond = false;
if (!HasDependentValue && !TheDefaultStmt) {
Expr::EvalResult Result;
- HasConstantCond = CondExprBeforePromotion->Evaluate(Result, Context);
+ HasConstantCond
+ = CondExprBeforePromotion->EvaluateAsRValue(Result, Context);
if (HasConstantCond) {
assert(Result.Val.isInt() && "switch condition evaluated to non-int");
ConstantCondValue = Result.Val.getInt();