aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-05-15 05:04:02 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-05-15 05:04:02 +0000
commitdbbecccb8431bb4545fc01c6401abc4253667360 (patch)
treeda1f80b9db16da641e424c25463bf69170e09ad4 /lib/Sema/SemaStmt.cpp
parent3003e1d6626d07e8fc4af95fad95b3a5d4c4af98 (diff)
PR12826: Converting an lvalue to an xvalue is a no-op conversion, not an lvalue-to-rvalue conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 2e1cc7c600..2ea07efde8 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -2033,8 +2033,7 @@ Sema::PerformMoveOrCopyInitialization(const InitializedEntity &Entity,
if (AllowNRVO &&
(NRVOCandidate || getCopyElisionCandidate(ResultType, Value, true))) {
ImplicitCastExpr AsRvalue(ImplicitCastExpr::OnStack,
- Value->getType(), CK_LValueToRValue,
- Value, VK_XValue);
+ Value->getType(), CK_NoOp, Value, VK_XValue);
Expr *InitExpr = &AsRvalue;
InitializationKind Kind
@@ -2069,8 +2068,7 @@ Sema::PerformMoveOrCopyInitialization(const InitializedEntity &Entity,
// Promote "AsRvalue" to the heap, since we now need this
// expression node to persist.
Value = ImplicitCastExpr::Create(Context, Value->getType(),
- CK_LValueToRValue, Value, 0,
- VK_XValue);
+ CK_NoOp, Value, 0, VK_XValue);
// Complete type-checking the initialization of the return type
// using the constructor we found.