diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-06 16:26:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-06 16:26:56 +0000 |
commit | b2b5658a8e4ad566303ec98caceaa3485e7635f7 (patch) | |
tree | ef75945f5c17383cb6e4a83e899d1884d171374a /lib/Sema/SemaDeclCXX.cpp | |
parent | 2315318436b3e94d54c220c3b8986e8002394a43 (diff) |
When performing a derived-to-base cast on the right-hand side of the
synthesized move assignment within an implicitly-defined move
assignment operator, be sure to treat the derived-to-base cast as an
xvalue (rather than an lvalue). Otherwise, we'll end up getting the
wrong constructor.
Optimize a direct call to a trivial move assignment operator to an
aggregate copy, as we do for trivial copy assignment operators, and
update the the assertion in CodeGenFunction::EmitAggregateCopy() to
cope with this optimization.
Fixes PR10860.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 04868cee57..d7db42494f 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -7847,7 +7847,7 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation, // appropriately-qualified base type. Expr *From = OtherRef; From = ImpCastExprToType(From, BaseType, CK_UncheckedDerivedToBase, - VK_RValue, &BasePath).take(); + VK_XValue, &BasePath).take(); // Dereference "this". ExprResult To = CreateBuiltinUnaryOp(Loc, UO_Deref, This); |