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 | 146b8e9a587e17d06346f546998da4c57cb2df77 (patch) | |
tree | c09ccaceff559aa14e35c2db9b8be1b17ec40e71 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | a098436b327a40f5709fa0ec2cb0f875b7ac8a2f (diff) | |
download | bcm5719-llvm-146b8e9a587e17d06346f546998da4c57cb2df77.tar.gz bcm5719-llvm-146b8e9a587e17d06346f546998da4c57cb2df77.zip |
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.
llvm-svn: 139143
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 04868cee576..d7db42494f5 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/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); |