OSDN Git Service

[NFC] Better encapsulation of llvm::Optional Storage, part II
authorSerge Guelton <sguelton@redhat.com>
Sun, 17 Feb 2019 22:54:23 +0000 (22:54 +0000)
committerSerge Guelton <sguelton@redhat.com>
Sun, 17 Feb 2019 22:54:23 +0000 (22:54 +0000)
Fix for better Windows support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354239 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Optional.h

index 53f028f..b409321 100644 (file)
@@ -108,7 +108,7 @@ public:
 
   OptionalStorage &operator=(OptionalStorage &&other) {
     if (other.hasValue())
-      emplace(std::move(other).getValue());
+      emplace(std::move(other.getValue()));
     else
       reset();
     return *this;
@@ -173,8 +173,8 @@ public:
   }
 
 #if LLVM_HAS_RVALUE_REFERENCE_THIS
-  T &&getValue() && { return std::move(Storage).getValue(); }
-  T &&operator*() && { return std::move(Storage).getValue(); }
+  T &&getValue() && { return std::move(Storage.getValue()); }
+  T &&operator*() && { return std::move(Storage.getValue()); }
 
   template <typename U>
   T getValueOr(U &&value) && {