[Core] Fix passing an rvalue reference of ErrorOr.

llvm-svn: 172850
This commit is contained in:
Michael J. Spencer 2013-01-18 21:42:01 +00:00
parent 63ffde573e
commit a17b72e7cf
1 changed files with 2 additions and 1 deletions

View File

@ -208,6 +208,7 @@ public:
return;
if (!other.HasError) {
// Get the other value.
IsValid = true;
new (get()) storage_type(std::move(*other.get()));
HasError = false;
// Tell other not to do any destruction.
@ -228,7 +229,7 @@ public:
return *this;
this->~ErrorOr();
new (this) ErrorOr(other);
new (this) ErrorOr(std::move(other));
return *this;
}