[libcxx] r254030 - Remove undefined behavior from tests; specifically, ensure that the value type of the allocators match the value type of the containers
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 24 14:10:52 PST 2015
Author: marshall
Date: Tue Nov 24 16:10:51 2015
New Revision: 254030
URL: http://llvm.org/viewvc/llvm-project?rev=254030&view=rev
Log:
Remove undefined behavior from tests; specifically, ensure that the value type of the allocators match the value type of the containers
Modified:
libcxx/trunk/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp
libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
Modified: libcxx/trunk/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp Tue Nov 24 16:10:51 2015
@@ -38,7 +38,7 @@ int main()
assert(m.size() == 2);
}
{
- typedef std::pair<MoveOnly, double> V;
+ typedef std::pair<const MoveOnly, double> V;
std::map<MoveOnly, double, std::less<MoveOnly>, min_allocator<V>> m;
assert(m.size() == 0);
assert(m[1] == 0.0);
Modified: libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -94,18 +94,19 @@ struct some_alloc3
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
@@ -117,28 +118,28 @@ int main()
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, throwable swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // POCS allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // NOT always equal allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -94,18 +94,19 @@ struct some_alloc3
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
@@ -117,28 +118,28 @@ int main()
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, throwable swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // POCS allocator, nothrow swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, nothrow swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // NOT always equal allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
Modified: libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp Tue Nov 24 16:10:51 2015
@@ -24,7 +24,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
- typedef test_allocator<int> A;
+ typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -39,7 +39,7 @@ int main()
}
{
typedef MoveOnly T;
- typedef other_allocator<int> A;
+ typedef other_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -55,7 +55,7 @@ int main()
#if __cplusplus >= 201103L
{
typedef MoveOnly T;
- typedef min_allocator<int> A;
+ typedef min_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
Modified: libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp Tue Nov 24 16:10:51 2015
@@ -24,7 +24,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
- typedef test_allocator<int> A;
+ typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -39,7 +39,7 @@ int main()
}
{
typedef MoveOnly T;
- typedef test_allocator<int> A;
+ typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -55,7 +55,7 @@ int main()
#if __cplusplus >= 201103L
{
typedef MoveOnly T;
- typedef min_allocator<int> A;
+ typedef min_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
Modified: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp?rev=254030&r1=254029&r2=254030&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp Tue Nov 24 16:10:51 2015
@@ -116,7 +116,7 @@ struct some_alloc3
int main()
{
#if __has_feature(cxx_noexcept)
- typedef std::pair<const MoveOnly, MoveOnly> MapType;
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
C c1, c2;
@@ -124,13 +124,13 @@ int main()
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
- std::equal_to<MoveOnly>, test_allocator<MapType>> C;
+ std::equal_to<MoveOnly>, test_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
- std::equal_to<MoveOnly>, other_allocator<MapType>> C;
+ std::equal_to<MoveOnly>, other_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
@@ -148,47 +148,47 @@ int main()
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for hash, throwable swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc <MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, throwable swap for hash, throwable swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // POCS allocator, throwable swap for hash, nothrow swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, throwable swap for hash, nothrow swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // POCS allocator, nothrow swap for hash, throwable swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc <MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, nothrow swap for hash, throwable swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // POCS allocator, nothrow swap for hash, nothrow swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, nothrow swap for hash, nothrow swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<MapType>> C;
+ typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
More information about the cfe-commits
mailing list