[llvm] r354239 - [NFC] Better encapsulation of llvm::Optional Storage, part II
Serge Guelton via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 17 14:54:23 PST 2019
Author: serge_sans_paille
Date: Sun Feb 17 14:54:23 2019
New Revision: 354239
URL: http://llvm.org/viewvc/llvm-project?rev=354239&view=rev
Log:
[NFC] Better encapsulation of llvm::Optional Storage, part II
Fix for better Windows support.
Modified:
llvm/trunk/include/llvm/ADT/Optional.h
Modified: llvm/trunk/include/llvm/ADT/Optional.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=354239&r1=354238&r2=354239&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Optional.h (original)
+++ llvm/trunk/include/llvm/ADT/Optional.h Sun Feb 17 14:54:23 2019
@@ -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) && {
More information about the llvm-commits
mailing list