2018-10-19 Jonathan Wakely <jwakely@redhat.com>
+ * 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.
void test02()
{
- typedef std::scoped_allocator_adaptor<Element::allocator_type> inner_alloc_type;
+ typedef std::scoped_allocator_adaptor<Element::allocator_type> alloc1_type;
- typedef std::vector<Element, inner_alloc_type> EltVec;
+ typedef std::vector<Element, alloc1_type> EltVec;
typedef std::scoped_allocator_adaptor<Element::allocator_type,
- Element::allocator_type> alloc_type;
+ Element::allocator_type> alloc2_type;
+
+ typedef std::allocator_traits<alloc2_type>::rebind_alloc<EltVec> alloc_type;
typedef std::vector<EltVec, alloc_type> EltVecVec;
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();
{
using namespace std;
using list = forward_list<int>;
- forward_list<list, scoped_allocator_adaptor<list::allocator_type>> l;
+ using alloc_type = allocator<list>;
+ forward_list<list, scoped_allocator_adaptor<alloc_type>> l;
// Check for forward_list(size_type, const allocator_type&)
l.emplace_front(1u);
}
-
int main()
{
- std::map<int, int, std::less<int>, alloc<int> > m;
+ std::map<int, int, std::less<int>, alloc<std::pair<const int, int>>> m;
m[1];
}
MoveOnly(MoveOnly&&) = default;
};
-using hash = std::hash<int>;
-using equal = std::equal_to<int>;
-
-template<typename Alloc>
- using test_type = std::unordered_map<int, MoveOnly, hash, equal, Alloc>;
-
void test01()
{
- typedef test_type<std::allocator<MoveOnly>> uim;
+ typedef std::unordered_map<int, MoveOnly> uim;
std::vector<uim> v;
v.emplace_back(uim());
}
void test01()
{
- typedef propagating_allocator<T, false> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, false> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test02()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test03()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test01()
{
- typedef propagating_allocator<T, false> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, false> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test02()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
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<std::pair<const T, T>> alloc_type;
-template class std::unordered_map<T, T, hash, equal_to, SimpleAllocator<T>>;
+template class std::unordered_map<T, T, hash, equal_to, alloc_type>;
void test01()
{
- typedef SimpleAllocator<T> alloc_type;
typedef std::allocator_traits<alloc_type> traits_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v(alloc_type{});
void test01()
{
- typedef uneq_allocator<T> alloc_type;
+ typedef uneq_allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test02()
{
- typedef uneq_allocator<T> alloc_type;
+ typedef uneq_allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test01()
{
- typedef propagating_allocator<counter_type, false> alloc_type;
+ typedef std::pair<const counter_type, counter_type> value_type;
+ typedef propagating_allocator<value_type, false> alloc_type;
typedef __gnu_test::counter_type_hasher hash;
typedef std::unordered_map<counter_type, counter_type, hash,
std::equal_to<counter_type>,
void test02()
{
- typedef propagating_allocator<counter_type, true> alloc_type;
+ typedef std::pair<const counter_type, counter_type> value_type;
+ typedef propagating_allocator<value_type, true> alloc_type;
typedef __gnu_test::counter_type_hasher hash;
typedef std::unordered_map<counter_type, counter_type, hash,
std::equal_to<counter_type>,
void test01()
{
- typedef std::allocator<T> alloc_type;
+ typedef std::allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1;
test_type v2;
void test02()
{
- typedef std::allocator<T> alloc_type;
+ typedef std::allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_map<T, T, hash_t, equal_to, alloc_type> test_type;
test_type v1;
test_type v2;
void test03()
{
- typedef std::allocator<T> alloc_type;
+ typedef std::allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to_t, alloc_type> test_type;
test_type v1;
test_type v2;
void test04()
{
- typedef propagating_allocator<T, false> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, false> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
void test05()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
fails_on_copy(const fails_on_copy&) { throw 0; };
};
-using value_type = std::pair<int, fails_on_copy>;
+using value_type = std::pair<const int, fails_on_copy>;
void
test01()
value()
{
typedef __gnu_cxx::throw_value_limit value_type;
- typedef __gnu_cxx::throw_allocator_limit<value_type> allocator_type;
+ typedef std::pair<const value_type, value_type> pair_type;
+ typedef __gnu_cxx::throw_allocator_limit<pair_type> allocator_type;
typedef std::hash<value_type> hash_type;
typedef std::equal_to<value_type> pred_type;
typedef std::unordered_map<value_type, value_type, hash_type, pred_type, allocator_type> test_type;
int main()
{
typedef __gnu_cxx::throw_value_random value_type;
- typedef __gnu_cxx::throw_allocator_random<value_type> allocator_type;
+ typedef std::pair<const value_type, value_type> pair_type;
+ typedef __gnu_cxx::throw_allocator_random<pair_type> allocator_type;
typedef std::hash<value_type> hash_type;
typedef std::equal_to<value_type> pred_type;
typedef std::unordered_map<value_type, value_type, hash_type, pred_type, allocator_type> test_type;
int main()
{
typedef __gnu_cxx::throw_value_limit value_type;
- typedef __gnu_cxx::throw_allocator_limit<value_type> allocator_type;
+ typedef std::pair<const value_type, value_type> pair_type;
+ typedef __gnu_cxx::throw_allocator_limit<pair_type> allocator_type;
typedef std::hash<value_type> hash_type;
typedef std::equal_to<value_type> pred_type;
typedef std::unordered_map<value_type, value_type, hash_type, pred_type, allocator_type> test_type;
MoveOnly(MoveOnly&&) = default;
};
-using hash = std::hash<int>;
-using equal = std::equal_to<int>;
-
-template<typename Alloc>
- using test_type = std::unordered_multimap<int, MoveOnly, hash, equal, Alloc>;
-
void test01()
{
- typedef test_type<std::allocator<MoveOnly>> uim;
+ typedef std::unordered_multimap<int, MoveOnly> uim;
std::vector<uim> v;
v.emplace_back(uim());
}
void test01()
{
- typedef propagating_allocator<T, false> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, false> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test02()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test03()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test01()
{
- typedef propagating_allocator<T, false> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, false> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test02()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
using __gnu_test::SimpleAllocator;
template class std::unordered_multimap<T, T, hash, equal_to,
- SimpleAllocator<T>>;
+ SimpleAllocator<std::pair<const T, T>>>;
void test01()
{
- typedef SimpleAllocator<T> alloc_type;
+ typedef SimpleAllocator<std::pair<const T, T>> alloc_type;
typedef std::allocator_traits<alloc_type> traits_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v(alloc_type{});
void test01()
{
- typedef uneq_allocator<T> alloc_type;
+ typedef uneq_allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
void test02()
{
- typedef uneq_allocator<T> alloc_type;
+ typedef uneq_allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
v1.emplace(std::piecewise_construct,
using __gnu_test::propagating_allocator;
using __gnu_test::counter_type;
+typedef std::pair<const counter_type, counter_type> value_type;
+
void test01()
{
- typedef propagating_allocator<counter_type, false> alloc_type;
+ typedef propagating_allocator<value_type, false> alloc_type;
typedef __gnu_test::counter_type_hasher hash;
typedef std::unordered_multimap<counter_type, counter_type, hash,
std::equal_to<counter_type>,
void test02()
{
- typedef propagating_allocator<counter_type, true> alloc_type;
+ typedef propagating_allocator<value_type, true> alloc_type;
typedef __gnu_test::counter_type_hasher hash;
typedef std::unordered_multimap<counter_type, counter_type, hash,
std::equal_to<counter_type>,
void test01()
{
- typedef std::allocator<T> alloc_type;
+ typedef std::allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1;
test_type v2;
void test02()
{
- typedef std::allocator<T> alloc_type;
+ typedef std::allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_multimap<T, T, hash_t, equal_to, alloc_type> test_type;
test_type v1;
test_type v2;
void test03()
{
- typedef std::allocator<T> alloc_type;
+ typedef std::allocator<std::pair<const T, T>> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to_t, alloc_type>
test_type;
test_type v1;
void test04()
{
- typedef propagating_allocator<T, false> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, false> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
void test05()
{
- typedef propagating_allocator<T, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, T>, true> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
value()
{
typedef __gnu_cxx::throw_value_limit value_type;
- typedef __gnu_cxx::throw_allocator_limit<value_type> allocator_type;
+ typedef std::pair<const value_type, value_type> pair_type;
+ typedef __gnu_cxx::throw_allocator_limit<pair_type> allocator_type;
typedef std::hash<value_type> hash_type;
typedef std::equal_to<value_type> pred_type;
typedef std::unordered_multimap<value_type, value_type, hash_type, pred_type, allocator_type> test_type;
int main()
{
typedef __gnu_cxx::throw_value_random value_type;
- typedef __gnu_cxx::throw_allocator_random<value_type> allocator_type;
+ typedef std::pair<const value_type, value_type> pair_type;
+ typedef __gnu_cxx::throw_allocator_random<pair_type> allocator_type;
typedef std::hash<value_type> hash_type;
typedef std::equal_to<value_type> pred_type;
typedef std::unordered_multimap<value_type, value_type, hash_type, pred_type, allocator_type> test_type;
int main()
{
typedef __gnu_cxx::throw_value_limit value_type;
- typedef __gnu_cxx::throw_allocator_random<value_type> allocator_type;
+ typedef std::pair<const value_type, value_type> pair_type;
+ typedef __gnu_cxx::throw_allocator_random<pair_type> allocator_type;
typedef std::hash<value_type> hash_type;
typedef std::equal_to<value_type> pred_type;
typedef std::unordered_multimap<value_type, value_type, hash_type, pred_type, allocator_type> test_type;
-
// Copyright (C) 2011-2018 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// { dg-do compile { target c++11 } }
+using __gnu_test::ExplicitConsAlloc;
+
// libstdc++/50118
+template class
+ std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>,
+ ExplicitConsAlloc<std::pair<const int, int>>>;
template class std::unordered_multimap<int, int, std::hash<int>,
std::equal_to<int>,
- __gnu_test::ExplicitConsAlloc<int>>;
-template class std::unordered_multimap<int, int, std::hash<int>,
- std::equal_to<int>,
- __gnu_test::ExplicitConsAlloc<char>>;
+ ExplicitConsAlloc<char>>;
int main()
{
std::map<int, int, std::less<int>,
- __gnu_cxx::malloc_allocator<std::pair<int, int> > > allocs;
+ __gnu_cxx::malloc_allocator<std::pair<const int, int> > > allocs;
allocs[9] = 3;
std::vector<int, __gnu_cxx::malloc_allocator<int>> vec(10);
vec[5] = 42;