diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-01-18 21:42:01 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-01-18 21:42:01 +0000 |
commit | a17b72e7cf66abee182177950cd0fee05bc6f3d2 (patch) | |
tree | 254feeb736fbb3170089bb0c78145cf1c04611d3 | |
parent | 63ffde573e14bb419b66d8121217334b926cd014 (diff) | |
download | bcm5719-llvm-a17b72e7cf66abee182177950cd0fee05bc6f3d2.tar.gz bcm5719-llvm-a17b72e7cf66abee182177950cd0fee05bc6f3d2.zip |
[Core] Fix passing an rvalue reference of ErrorOr.
llvm-svn: 172850
-rw-r--r-- | lld/include/lld/Core/ErrorOr.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/include/lld/Core/ErrorOr.h b/lld/include/lld/Core/ErrorOr.h index 0fd7d9650b8..85f91858db5 100644 --- a/lld/include/lld/Core/ErrorOr.h +++ b/lld/include/lld/Core/ErrorOr.h @@ -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; } |