Skip to content

Commit

Permalink
Make move_assign_noexcept.pass.cpp tests more portable. Patch from ST…
Browse files Browse the repository at this point in the history
…L@microsoft.com

llvm-svn: 276591
  • Loading branch information
EricWF committed Jul 25, 2016
1 parent 2cd516e commit 249b03e
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <map>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <map>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <set>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <set>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <deque>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand All @@ -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, "");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <forward_list>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand All @@ -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, "");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <list>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand All @@ -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, "");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <vector>
#include <cassert>

#include "test_macros.h"
#include "test_allocator.h"

template <class T>
Expand Down Expand Up @@ -60,28 +61,28 @@ 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;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
{
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
}
#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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>

#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 249b03e

Please sign in to comment.