diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-07-20 04:20:21 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-07-20 04:20:21 +0000 |
commit | c57d34bc3566d0ed2dca22b3b74267a10dcef083 (patch) | |
tree | a09932c20e137d0b6c0158e587db3c278464dcf7 /clang/lib/AST/ExprClassification.cpp | |
parent | 08d047666a81bca31c39fb071c2c81cc93854a46 (diff) | |
download | bcm5719-llvm-c57d34bc3566d0ed2dca22b3b74267a10dcef083.tar.gz bcm5719-llvm-c57d34bc3566d0ed2dca22b3b74267a10dcef083.zip |
Update ImplicitCastExpr to be able to represent an XValue.
llvm-svn: 108807
Diffstat (limited to 'clang/lib/AST/ExprClassification.cpp')
-rw-r--r-- | clang/lib/AST/ExprClassification.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp index 60ac347c50f..429366ee890 100644 --- a/clang/lib/AST/ExprClassification.cpp +++ b/clang/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. |