From 78ed0f80c38b9084794ae4a02e5a5648cbd255ae Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 19 Oct 2018 22:49:40 +0100 Subject: [PATCH] Fix tests that use allocators with incorrect value types As a GNU extension we allow containers to be instantiated with allocators that use a different value type from the container, and automatically rebind the allocator to the correct type. This extension is disabled in strict modes (when __STRICT_ANSI__ is defined, i.e. -std=c++NN dialects). These testcases unintentionally rely on the extension and so fail for strict modes. Tests which intentionally make use of the extension will still fail in strict dialects, but will be addressed in a later change. * testsuite/20_util/scoped_allocator/1.cc: Use allocator with correct value type for the container. * testsuite/23_containers/forward_list/cons/14.cc: Likewise. * testsuite/23_containers/map/56613.cc: Likewise. * testsuite/23_containers/unordered_map/55043.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/minimal.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/cons/81891.cc: Likewise. * testsuite/23_containers/unordered_map/requirements/exception/ basic.cc: Likewise. * testsuite/23_containers/unordered_map/requirements/exception/ generation_prohibited.cc: Likewise. * testsuite/23_containers/unordered_map/requirements/exception/ propagation_consistent.cc: Likewise. * testsuite/23_containers/unordered_multimap/55043.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/requirements/exception/ basic.cc: Likewise. * testsuite/23_containers/unordered_multimap/requirements/exception/ generation_prohibited.cc: Likewise. * testsuite/23_containers/unordered_multimap/requirements/exception/ propagation_consistent.cc: Likewise. * testsuite/23_containers/unordered_multimap/requirements/ explicit_instantiation/5.cc: Likewise. * testsuite/ext/malloc_allocator/sanity.cc: Likewise. From-SVN: r265331 --- libstdc++-v3/ChangeLog | 45 +++++++++++++++++++ .../testsuite/20_util/scoped_allocator/1.cc | 10 ++--- .../23_containers/forward_list/cons/14.cc | 4 +- .../testsuite/23_containers/map/56613.cc | 2 +- .../23_containers/unordered_map/55043.cc | 8 +--- .../unordered_map/allocator/copy.cc | 6 +-- .../unordered_map/allocator/copy_assign.cc | 4 +- .../unordered_map/allocator/minimal.cc | 5 +-- .../unordered_map/allocator/move.cc | 4 +- .../unordered_map/allocator/move_assign.cc | 6 ++- .../unordered_map/allocator/noexcept.cc | 10 ++--- .../23_containers/unordered_map/cons/81891.cc | 2 +- .../requirements/exception/basic.cc | 3 +- .../exception/generation_prohibited.cc | 3 +- .../exception/propagation_consistent.cc | 3 +- .../23_containers/unordered_multimap/55043.cc | 8 +--- .../unordered_multimap/allocator/copy.cc | 6 +-- .../allocator/copy_assign.cc | 4 +- .../unordered_multimap/allocator/minimal.cc | 4 +- .../unordered_multimap/allocator/move.cc | 4 +- .../allocator/move_assign.cc | 6 ++- .../unordered_multimap/allocator/noexcept.cc | 10 ++--- .../requirements/exception/basic.cc | 3 +- .../exception/generation_prohibited.cc | 3 +- .../exception/propagation_consistent.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 11 ++--- .../testsuite/ext/malloc_allocator/sanity.cc | 2 +- 27 files changed, 111 insertions(+), 68 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a3a961161bc..c7cdc005502 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,50 @@ 2018-10-19 Jonathan Wakely + * testsuite/20_util/scoped_allocator/1.cc: Use allocator with correct + value type for the container. + * testsuite/23_containers/forward_list/cons/14.cc: Likewise. + * testsuite/23_containers/map/56613.cc: Likewise. + * testsuite/23_containers/unordered_map/55043.cc: Likewise. + * testsuite/23_containers/unordered_map/allocator/copy.cc: Likewise. + * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: + Likewise. + * testsuite/23_containers/unordered_map/allocator/minimal.cc: + Likewise. + * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. + * testsuite/23_containers/unordered_map/allocator/move_assign.cc: + Likewise. + * testsuite/23_containers/unordered_map/allocator/noexcept.cc: + Likewise. + * testsuite/23_containers/unordered_map/cons/81891.cc: Likewise. + * testsuite/23_containers/unordered_map/requirements/exception/ + basic.cc: Likewise. + * testsuite/23_containers/unordered_map/requirements/exception/ + generation_prohibited.cc: Likewise. + * testsuite/23_containers/unordered_map/requirements/exception/ + propagation_consistent.cc: Likewise. + * testsuite/23_containers/unordered_multimap/55043.cc: Likewise. + * testsuite/23_containers/unordered_multimap/allocator/copy.cc: + Likewise. + * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: + Likewise. + * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: + Likewise. + * testsuite/23_containers/unordered_multimap/allocator/move.cc: + Likewise. + * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: + Likewise. + * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: + Likewise. + * testsuite/23_containers/unordered_multimap/requirements/exception/ + basic.cc: Likewise. + * testsuite/23_containers/unordered_multimap/requirements/exception/ + generation_prohibited.cc: Likewise. + * testsuite/23_containers/unordered_multimap/requirements/exception/ + propagation_consistent.cc: Likewise. + * testsuite/23_containers/unordered_multimap/requirements/ + explicit_instantiation/5.cc: Likewise. + * testsuite/ext/malloc_allocator/sanity.cc: Likewise. + * ext/special_functions/airy_ai/check_nan.cc: Skip test for non-standard extension when a strict -std=c++NN dialect is used. * ext/special_functions/airy_ai/check_value.cc: Likewise. diff --git a/libstdc++-v3/testsuite/20_util/scoped_allocator/1.cc b/libstdc++-v3/testsuite/20_util/scoped_allocator/1.cc index 3a1eb2cfad7..b546b495d95 100644 --- a/libstdc++-v3/testsuite/20_util/scoped_allocator/1.cc +++ b/libstdc++-v3/testsuite/20_util/scoped_allocator/1.cc @@ -57,12 +57,14 @@ void test01() void test02() { - typedef std::scoped_allocator_adaptor inner_alloc_type; + typedef std::scoped_allocator_adaptor alloc1_type; - typedef std::vector EltVec; + typedef std::vector EltVec; typedef std::scoped_allocator_adaptor alloc_type; + Element::allocator_type> alloc2_type; + + typedef std::allocator_traits::rebind_alloc alloc_type; typedef std::vector EltVecVec; @@ -88,10 +90,8 @@ void test02() VERIFY( evv3.get_allocator().get_personality() == 3 ); VERIFY( evv3[0].get_allocator().get_personality() == 4 ); VERIFY( evv3[0][0].get_allocator().get_personality() == 4 ); - } - int main() { test01(); diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/14.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/14.cc index a27201e2f49..9ee497b2e1f 100644 --- a/libstdc++-v3/testsuite/23_containers/forward_list/cons/14.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/14.cc @@ -26,9 +26,9 @@ void test01() { using namespace std; using list = forward_list; - forward_list> l; + using alloc_type = allocator; + forward_list> l; // Check for forward_list(size_type, const allocator_type&) l.emplace_front(1u); } - diff --git a/libstdc++-v3/testsuite/23_containers/map/56613.cc b/libstdc++-v3/testsuite/23_containers/map/56613.cc index 65aebe56d51..e639b81a730 100644 --- a/libstdc++-v3/testsuite/23_containers/map/56613.cc +++ b/libstdc++-v3/testsuite/23_containers/map/56613.cc @@ -67,6 +67,6 @@ bool operator!=(alloc, alloc) { return false; } int main() { - std::map, alloc > m; + std::map, alloc>> m; m[1]; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/55043.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/55043.cc index 1f6c55608ad..a4c7c3bb3c5 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/55043.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/55043.cc @@ -28,15 +28,9 @@ struct MoveOnly MoveOnly(MoveOnly&&) = default; }; -using hash = std::hash; -using equal = std::equal_to; - -template - using test_type = std::unordered_map; - void test01() { - typedef test_type> uim; + typedef std::unordered_map uim; std::vector v; v.emplace_back(uim()); } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy.cc index 4efc67a193a..6e2bcef6674 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy.cc @@ -39,7 +39,7 @@ using __gnu_test::propagating_allocator; void test01() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, false> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -51,7 +51,7 @@ void test01() void test02() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -63,7 +63,7 @@ void test02() void test03() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy_assign.cc index f6eec6731c1..6393bf56d2b 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy_assign.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/copy_assign.cc @@ -39,7 +39,7 @@ using __gnu_test::propagating_allocator; void test01() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, false> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -54,7 +54,7 @@ void test01() void test02() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/minimal.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/minimal.cc index 23efffa8bf0..4fc096765e2 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/minimal.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/minimal.cc @@ -40,13 +40,12 @@ struct equal_to bool operator==(const T& l, const T& r) { return l.i == r.i; } bool operator<(const T& l, const T& r) { return l.i < r.i; } -using __gnu_test::SimpleAllocator; +typedef __gnu_test::SimpleAllocator> alloc_type; -template class std::unordered_map>; +template class std::unordered_map; void test01() { - typedef SimpleAllocator alloc_type; typedef std::allocator_traits traits_type; typedef std::unordered_map test_type; test_type v(alloc_type{}); diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move.cc index dc33587666b..c79dbeb80c9 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move.cc @@ -39,7 +39,7 @@ using __gnu_test::uneq_allocator; void test01() { - typedef uneq_allocator alloc_type; + typedef uneq_allocator> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -53,7 +53,7 @@ void test01() void test02() { - typedef uneq_allocator alloc_type; + typedef uneq_allocator> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move_assign.cc index 173287e4df0..b27269e607a 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move_assign.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/move_assign.cc @@ -27,7 +27,8 @@ using __gnu_test::counter_type; void test01() { - typedef propagating_allocator alloc_type; + typedef std::pair value_type; + typedef propagating_allocator alloc_type; typedef __gnu_test::counter_type_hasher hash; typedef std::unordered_map, @@ -54,7 +55,8 @@ void test01() void test02() { - typedef propagating_allocator alloc_type; + typedef std::pair value_type; + typedef propagating_allocator alloc_type; typedef __gnu_test::counter_type_hasher hash; typedef std::unordered_map, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/noexcept.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/noexcept.cc index f9fd434dfd7..29fbc7bcd8d 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/noexcept.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/allocator/noexcept.cc @@ -44,7 +44,7 @@ using __gnu_test::propagating_allocator; void test01() { - typedef std::allocator alloc_type; + typedef std::allocator> alloc_type; typedef std::unordered_map test_type; test_type v1; test_type v2; @@ -55,7 +55,7 @@ void test01() void test02() { - typedef std::allocator alloc_type; + typedef std::allocator> alloc_type; typedef std::unordered_map test_type; test_type v1; test_type v2; @@ -65,7 +65,7 @@ void test02() void test03() { - typedef std::allocator alloc_type; + typedef std::allocator> alloc_type; typedef std::unordered_map test_type; test_type v1; test_type v2; @@ -75,7 +75,7 @@ void test03() void test04() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, false> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); test_type v2(alloc_type(2)); @@ -85,7 +85,7 @@ void test04() void test05() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_map test_type; test_type v1(alloc_type(1)); test_type v2(alloc_type(2)); diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/81891.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/81891.cc index e1debbb429d..f0f8b75e7e5 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/81891.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/81891.cc @@ -26,7 +26,7 @@ struct fails_on_copy { fails_on_copy(const fails_on_copy&) { throw 0; }; }; -using value_type = std::pair; +using value_type = std::pair; void test01() diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc index a8f973fd175..bbc4cded242 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc @@ -27,7 +27,8 @@ void value() { typedef __gnu_cxx::throw_value_limit value_type; - typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::pair pair_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; typedef std::hash hash_type; typedef std::equal_to pred_type; typedef std::unordered_map test_type; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc index 11e0a3d6888..e04f326e1c2 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc @@ -27,7 +27,8 @@ int main() { typedef __gnu_cxx::throw_value_random value_type; - typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::pair pair_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; typedef std::hash hash_type; typedef std::equal_to pred_type; typedef std::unordered_map test_type; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc index 1980cc8e840..eb5c0f1b88a 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc @@ -27,7 +27,8 @@ int main() { typedef __gnu_cxx::throw_value_limit value_type; - typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::pair pair_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; typedef std::hash hash_type; typedef std::equal_to pred_type; typedef std::unordered_map test_type; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/55043.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/55043.cc index 6b95a0a667b..919cea33341 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/55043.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/55043.cc @@ -28,15 +28,9 @@ struct MoveOnly MoveOnly(MoveOnly&&) = default; }; -using hash = std::hash; -using equal = std::equal_to; - -template - using test_type = std::unordered_multimap; - void test01() { - typedef test_type> uim; + typedef std::unordered_multimap uim; std::vector v; v.emplace_back(uim()); } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy.cc index 13b99ed8260..38322316406 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy.cc @@ -39,7 +39,7 @@ using __gnu_test::propagating_allocator; void test01() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, false> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -51,7 +51,7 @@ void test01() void test02() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -63,7 +63,7 @@ void test02() void test03() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc index 281f7eafc1c..15059be6527 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc @@ -39,7 +39,7 @@ using __gnu_test::propagating_allocator; void test01() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, false> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -54,7 +54,7 @@ void test01() void test02() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/minimal.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/minimal.cc index b563b97f812..8488eba37f1 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/minimal.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/minimal.cc @@ -43,11 +43,11 @@ bool operator<(const T& l, const T& r) { return l.i < r.i; } using __gnu_test::SimpleAllocator; template class std::unordered_multimap>; + SimpleAllocator>>; void test01() { - typedef SimpleAllocator alloc_type; + typedef SimpleAllocator> alloc_type; typedef std::allocator_traits traits_type; typedef std::unordered_multimap test_type; test_type v(alloc_type{}); diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move.cc index 2ac6d374b42..33e987ac45b 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move.cc @@ -39,7 +39,7 @@ using __gnu_test::uneq_allocator; void test01() { - typedef uneq_allocator alloc_type; + typedef uneq_allocator> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, @@ -53,7 +53,7 @@ void test01() void test02() { - typedef uneq_allocator alloc_type; + typedef uneq_allocator> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); v1.emplace(std::piecewise_construct, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move_assign.cc index f64848b015d..35c4c289f10 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move_assign.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/move_assign.cc @@ -25,9 +25,11 @@ using __gnu_test::propagating_allocator; using __gnu_test::counter_type; +typedef std::pair value_type; + void test01() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator alloc_type; typedef __gnu_test::counter_type_hasher hash; typedef std::unordered_multimap, @@ -54,7 +56,7 @@ void test01() void test02() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator alloc_type; typedef __gnu_test::counter_type_hasher hash; typedef std::unordered_multimap, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/noexcept.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/noexcept.cc index b47a76d3535..78fc37038c3 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/noexcept.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/allocator/noexcept.cc @@ -44,7 +44,7 @@ using __gnu_test::propagating_allocator; void test01() { - typedef std::allocator alloc_type; + typedef std::allocator> alloc_type; typedef std::unordered_multimap test_type; test_type v1; test_type v2; @@ -55,7 +55,7 @@ void test01() void test02() { - typedef std::allocator alloc_type; + typedef std::allocator> alloc_type; typedef std::unordered_multimap test_type; test_type v1; test_type v2; @@ -65,7 +65,7 @@ void test02() void test03() { - typedef std::allocator alloc_type; + typedef std::allocator> alloc_type; typedef std::unordered_multimap test_type; test_type v1; @@ -76,7 +76,7 @@ void test03() void test04() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, false> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); test_type v2(alloc_type(2)); @@ -86,7 +86,7 @@ void test04() void test05() { - typedef propagating_allocator alloc_type; + typedef propagating_allocator, true> alloc_type; typedef std::unordered_multimap test_type; test_type v1(alloc_type(1)); test_type v2(alloc_type(2)); diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/basic.cc index 895152e04ac..81dc0bbe8df 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/basic.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/basic.cc @@ -27,7 +27,8 @@ void value() { typedef __gnu_cxx::throw_value_limit value_type; - typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::pair pair_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; typedef std::hash hash_type; typedef std::equal_to pred_type; typedef std::unordered_multimap test_type; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/generation_prohibited.cc index 92b0ab870dc..a05d8867dff 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/generation_prohibited.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/generation_prohibited.cc @@ -27,7 +27,8 @@ int main() { typedef __gnu_cxx::throw_value_random value_type; - typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::pair pair_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; typedef std::hash hash_type; typedef std::equal_to pred_type; typedef std::unordered_multimap test_type; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/propagation_consistent.cc index db564288332..58312c99146 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/propagation_consistent.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/propagation_consistent.cc @@ -27,7 +27,8 @@ int main() { typedef __gnu_cxx::throw_value_limit value_type; - typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::pair pair_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; typedef std::hash hash_type; typedef std::equal_to pred_type; typedef std::unordered_multimap test_type; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc index 4c29a6f049c..6cdf0f3f3ca 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc @@ -1,4 +1,3 @@ - // Copyright (C) 2011-2018 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -23,10 +22,12 @@ // { dg-do compile { target c++11 } } +using __gnu_test::ExplicitConsAlloc; + // libstdc++/50118 +template class + std::unordered_multimap, std::equal_to, + ExplicitConsAlloc>>; template class std::unordered_multimap, std::equal_to, - __gnu_test::ExplicitConsAlloc>; -template class std::unordered_multimap, - std::equal_to, - __gnu_test::ExplicitConsAlloc>; + ExplicitConsAlloc>; diff --git a/libstdc++-v3/testsuite/ext/malloc_allocator/sanity.cc b/libstdc++-v3/testsuite/ext/malloc_allocator/sanity.cc index 30e978a896d..ef9df0379f9 100644 --- a/libstdc++-v3/testsuite/ext/malloc_allocator/sanity.cc +++ b/libstdc++-v3/testsuite/ext/malloc_allocator/sanity.cc @@ -24,7 +24,7 @@ int main() { std::map, - __gnu_cxx::malloc_allocator > > allocs; + __gnu_cxx::malloc_allocator > > allocs; allocs[9] = 3; std::vector> vec(10); vec[5] = 42;