[libcxx-commits] [PATCH] D80482: [libcxx] Fix C++14 and up constexpr members in MoveOnly.
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 25 11:47:29 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG37ef15143a5d: [libcxx] Fix C++14 and up constexpr members in MoveOnly. (authored by zoecarver).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80482/new/
https://reviews.llvm.org/D80482
Files:
libcxx/test/support/MoveOnly.h
Index: libcxx/test/support/MoveOnly.h
===================================================================
--- libcxx/test/support/MoveOnly.h
+++ libcxx/test/support/MoveOnly.h
@@ -24,17 +24,19 @@
int data_;
public:
constexpr MoveOnly(int data = 1) : data_(data) {}
- constexpr MoveOnly(MoveOnly&& x)
+ TEST_CONSTEXPR_CXX14 MoveOnly(MoveOnly&& x)
: data_(x.data_) {x.data_ = 0;}
- constexpr MoveOnly& operator=(MoveOnly&& x)
+ TEST_CONSTEXPR_CXX14 MoveOnly& operator=(MoveOnly&& x)
{data_ = x.data_; x.data_ = 0; return *this;}
constexpr int get() const {return data_;}
constexpr bool operator==(const MoveOnly& x) const {return data_ == x.data_;}
constexpr bool operator< (const MoveOnly& x) const {return data_ < x.data_;}
- constexpr MoveOnly operator+(const MoveOnly& x) const { return MoveOnly{data_ + x.data_}; }
- constexpr MoveOnly operator*(const MoveOnly& x) const { return MoveOnly{data_ * x.data_}; }
+ TEST_CONSTEXPR_CXX14 MoveOnly operator+(const MoveOnly& x) const
+ { return MoveOnly{data_ + x.data_}; }
+ TEST_CONSTEXPR_CXX14 MoveOnly operator*(const MoveOnly& x) const
+ { return MoveOnly{data_ * x.data_}; }
};
namespace std {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80482.266062.patch
Type: text/x-patch
Size: 1236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200525/1e9b6e5c/attachment-0001.bin>
More information about the libcxx-commits
mailing list