diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2015-10-06 20:30:56 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2015-10-06 20:30:56 +0000 |
commit | 05e9cb563673bdf98d18c4c94fdee8f4bd99bc04 (patch) | |
tree | e3f515042e1f06d4fc6ce4277df7e77c9c75bd17 | |
parent | 7f8c1165cdf3dcd614d4c56fc78c2fa378047bab (diff) | |
download | bcm5719-llvm-05e9cb563673bdf98d18c4c94fdee8f4bd99bc04.tar.gz bcm5719-llvm-05e9cb563673bdf98d18c4c94fdee8f4bd99bc04.zip |
Our test allocators support move/copy construction; they should support move/copy assignment as well
llvm-svn: 249458
-rw-r--r-- | libcxx/test/support/allocators.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxx/test/support/allocators.h b/libcxx/test/support/allocators.h index b7aba12e21f..7c2103ff272 100644 --- a/libcxx/test/support/allocators.h +++ b/libcxx/test/support/allocators.h @@ -35,6 +35,8 @@ public: A1(const A1& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} A1(A1&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;} + A1& operator=(const A1& a) TEST_NOEXCEPT { id_ = a.id(); copy_called = true; return *this;} + A1& operator=(A1&& a) TEST_NOEXCEPT { id_ = a.id(); move_called = true; return *this;} template <class U> A1(const A1<U>& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} @@ -96,6 +98,8 @@ public: A2(const A2& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} A2(A2&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;} + A2& operator=(const A2& a) TEST_NOEXCEPT { id_ = a.id(); copy_called = true; return *this;} + A2& operator=(A2&& a) TEST_NOEXCEPT { id_ = a.id(); move_called = true; return *this;} T* allocate(std::size_t n, const void* hint) { @@ -142,7 +146,9 @@ public: static bool destroy_called; A3(const A3& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} - A3(A3&& a) TEST_NOEXCEPT: id_(a.id()) {move_called = true;} + A3(A3&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;} + A3& operator=(const A3& a) TEST_NOEXCEPT { id_ = a.id(); copy_called = true; return *this;} + A3& operator=(A3&& a) TEST_NOEXCEPT { id_ = a.id(); move_called = true; return *this;} template <class U, class ...Args> void construct(U* p, Args&& ...args) |