|
@@ -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)
|