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

llvm-svn: 273823
This commit is contained in:
Eric Fiselier 2016-06-26 20:21:22 +00:00
parent 7cca38bfd1
commit a9fb19d3a5
15 changed files with 42 additions and 27 deletions

View File

@ -22,6 +22,7 @@
#include <map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -38,11 +39,11 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;

View File

@ -22,6 +22,7 @@
#include <map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -38,11 +39,11 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;

View File

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

View File

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

View File

@ -20,12 +20,13 @@
#include <queue>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
{
typedef std::priority_queue<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
}

View File

@ -19,12 +19,13 @@
#include <queue>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
{
typedef std::queue<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
}

View File

@ -19,12 +19,13 @@
#include <stack>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
{
typedef std::stack<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
}

View File

@ -19,6 +19,7 @@
#include <deque>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -33,11 +34,11 @@ int main()
{
{
typedef std::deque<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::deque<MoveOnly, test_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;

View File

@ -19,6 +19,7 @@
#include <forward_list>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -33,11 +34,11 @@ int main()
{
{
typedef std::forward_list<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, test_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;

View File

@ -19,6 +19,7 @@
#include <list>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@ -33,11 +34,11 @@ int main()
{
{
typedef std::list<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::list<MoveOnly, test_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;

View File

@ -19,6 +19,7 @@
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@ -32,11 +33,11 @@ int main()
{
{
typedef std::vector<bool> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::vector<bool, other_allocator<bool>> C;

View File

@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
#include "../../../test_hash.h"
@ -47,12 +48,12 @@ int main()
{
{
typedef std::unordered_map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,

View File

@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
#include "../../../test_hash.h"
@ -47,12 +48,12 @@ int main()
{
{
typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,

View File

@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
#include "../../../test_hash.h"
@ -47,12 +48,12 @@ int main()
{
{
typedef std::unordered_multiset<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,

View File

@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
#include "../../../test_hash.h"
@ -47,12 +48,12 @@ int main()
{
{
typedef std::unordered_set<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,