diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2015-06-03 19:56:43 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2015-06-03 19:56:43 +0000 |
commit | cbf166a2b928e3e037fba2b1f1bb64e5b6e4c26c (patch) | |
tree | 03b1b5c57bbbb823c5bd61dc74ca08dfb70f458c /libcxx/test/support/allocators.h | |
parent | 7ae27b88dd5f47ef50afd911da67fa0c14cbfdc7 (diff) | |
download | bcm5719-llvm-cbf166a2b928e3e037fba2b1f1bb64e5b6e4c26c.tar.gz bcm5719-llvm-cbf166a2b928e3e037fba2b1f1bb64e5b6e4c26c.zip |
More of N4258 implementation. Mark all of our test_allocators as noexcept constructible. Make the constructors for basic_string noexcept all the time (under C++14). Update tests to reflect the new world order. More to come.
llvm-svn: 238957
Diffstat (limited to 'libcxx/test/support/allocators.h')
-rw-r--r-- | libcxx/test/support/allocators.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/libcxx/test/support/allocators.h b/libcxx/test/support/allocators.h index 5372c073054..b7aba12e21f 100644 --- a/libcxx/test/support/allocators.h +++ b/libcxx/test/support/allocators.h @@ -13,6 +13,8 @@ #include <type_traits> #include <utility> +#include "test_macros.h" + #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class T> @@ -20,7 +22,7 @@ class A1 { int id_; public: - explicit A1(int id = 0) : id_(id) {} + explicit A1(int id = 0) TEST_NOEXCEPT : id_(id) {} typedef T value_type; @@ -31,13 +33,13 @@ public: static bool allocate_called; static std::pair<T*, std::size_t> deallocate_called; - A1(const A1& a) : id_(a.id()) {copy_called = true;} - A1(A1&& a) : id_(a.id()) {move_called = true;} + A1(const A1& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} + A1(A1&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;} template <class U> - A1(const A1<U>& a) : id_(a.id()) {copy_called = true;} + A1(const A1<U>& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} template <class U> - A1(A1<U>&& a) : id_(a.id()) {move_called = true;} + A1(A1<U>&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;} T* allocate(std::size_t n) { @@ -77,7 +79,7 @@ class A2 { int id_; public: - explicit A2(int id = 0) : id_(id) {} + explicit A2(int id = 0) TEST_NOEXCEPT : id_(id) {} typedef T value_type; @@ -92,8 +94,8 @@ public: static bool move_called; static bool allocate_called; - A2(const A2& a) : id_(a.id()) {copy_called = true;} - A2(A2&& a) : id_(a.id()) {move_called = true;} + A2(const A2& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} + A2(A2&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;} T* allocate(std::size_t n, const void* hint) { @@ -125,7 +127,7 @@ class A3 { int id_; public: - explicit A3(int id = 0) : id_(id) {} + explicit A3(int id = 0) TEST_NOEXCEPT : id_(id) {} typedef T value_type; @@ -139,8 +141,8 @@ public: static bool constructed; static bool destroy_called; - A3(const A3& a) : id_(a.id()) {copy_called = true;} - A3(A3&& a) : id_(a.id()) {move_called = true;} + A3(const A3& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;} + A3(A3&& a) TEST_NOEXCEPT: id_(a.id()) {move_called = true;} template <class U, class ...Args> void construct(U* p, Args&& ...args) |