Make move_assign_noexcept.pass.cpp tests more portable. Patch from STL@microsoft.com

llvm-svn: 276591
This commit is contained in:
Eric Fiselier 2016-07-25 00:18:12 +00:00
parent 2cd516e049
commit 249b03effb
12 changed files with 30 additions and 18 deletions

View File

@ -22,6 +22,7 @@
#include <map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -46,7 +47,7 @@ int main()
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;

View File

@ -22,6 +22,7 @@
#include <map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -46,7 +47,7 @@ int main()
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;

View File

@ -22,6 +22,7 @@
#include <set>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -45,7 +46,7 @@ int main()
}
{
typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;

View File

@ -22,6 +22,7 @@
#include <set>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -45,7 +46,7 @@ int main()
}
{
typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::set<MoveOnly, some_comp<MoveOnly>> C;

View File

@ -21,6 +21,7 @@
#include <deque>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -43,10 +44,10 @@ int main()
}
{
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
}
}

View File

@ -21,6 +21,7 @@
#include <forward_list>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -43,10 +44,10 @@ int main()
}
{
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
}
}

View File

@ -21,6 +21,7 @@
#include <list>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -43,10 +44,10 @@ int main()
}
{
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
}
}

View File

@ -21,6 +21,7 @@
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@ -60,7 +61,7 @@ int main()
{
{
typedef std::vector<bool> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
@ -68,12 +69,12 @@ int main()
}
{
typedef std::vector<bool, other_allocator<bool>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::vector<bool, some_alloc<bool>> C;
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT( std::is_nothrow_move_assignable<C>::value, "");
#else
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
#endif
@ -81,7 +82,7 @@ int main()
#if TEST_STD_VER > 14
{ // POCMA false, is_always_equal true
typedef std::vector<bool, some_alloc2<bool>> C;
static_assert( std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT( std::is_nothrow_move_assignable<C>::value, "");
}
{ // POCMA false, is_always_equal false
typedef std::vector<bool, some_alloc3<bool>> C;

View File

@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;

View File

@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;

View File

@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;

View File

@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;