[llvm-commits] [lld] r172850 - /lld/trunk/include/lld/Core/ErrorOr.h

Michael J. Spencer bigcheesegs at gmail.com
Fri Jan 18 13:42:02 PST 2013


Author: mspencer
Date: Fri Jan 18 15:42:01 2013
New Revision: 172850

URL: http://llvm.org/viewvc/llvm-project?rev=172850&view=rev
Log:
[Core] Fix passing an rvalue reference of ErrorOr.

Modified:
    lld/trunk/include/lld/Core/ErrorOr.h

Modified: lld/trunk/include/lld/Core/ErrorOr.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/ErrorOr.h?rev=172850&r1=172849&r2=172850&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/ErrorOr.h (original)
+++ lld/trunk/include/lld/Core/ErrorOr.h Fri Jan 18 15:42:01 2013
@@ -208,6 +208,7 @@
       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 @@
       return *this;
 
     this->~ErrorOr();
-    new (this) ErrorOr(other);
+    new (this) ErrorOr(std::move(other));
 
     return *this;
   }





More information about the llvm-commits mailing list