aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprClassification.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-07-20 04:20:21 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-07-20 04:20:21 +0000
commit906082edf2aea1c6de2926f93a8d7121e49d2a54 (patch)
tree40ad6a9e39aa0c1554391f03c4dd14cab9e668c1 /lib/AST/ExprClassification.cpp
parent0b42659e76ec32cee3f59bc206e93b4c917e9df5 (diff)
Update ImplicitCastExpr to be able to represent an XValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprClassification.cpp')
-rw-r--r--lib/AST/ExprClassification.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp
index 60ac347c50..429366ee89 100644
--- a/lib/AST/ExprClassification.cpp
+++ b/lib/AST/ExprClassification.cpp
@@ -134,10 +134,16 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
// Implicit casts are lvalues if they're lvalue casts. Other than that, we
// only specifically record class temporaries.
case Expr::ImplicitCastExprClass:
- if (cast<ImplicitCastExpr>(E)->isLvalueCast())
+ switch (cast<ImplicitCastExpr>(E)->getCategory()) {
+ case ImplicitCastExpr::RValue:
+ return Lang.CPlusPlus && E->getType()->isRecordType() ?
+ Cl::CL_ClassTemporary : Cl::CL_PRValue;
+ case ImplicitCastExpr::LValue:
return Cl::CL_LValue;
- return Lang.CPlusPlus && E->getType()->isRecordType() ?
- Cl::CL_ClassTemporary : Cl::CL_PRValue;
+ case ImplicitCastExpr::XValue:
+ return Cl::CL_XValue;
+ }
+ llvm_unreachable("Invalid value category of implicit cast.");
// C++ [expr.prim.general]p4: The presence of parentheses does not affect
// whether the expression is an lvalue.