// { dg-do compile { target c++11 } } #include static_assert( std::is_default_constructible>{}, "" ); template struct NoDefaultConsAlloc { using value_type = T; NoDefaultConsAlloc(int) noexcept { } template NoDefaultConsAlloc(const NoDefaultConsAlloc&) { } T *allocate(std::size_t n) { return std::allocator().allocate(n); } void deallocate(T *p, std::size_t n) { std::allocator().deallocate(p, n); } bool operator==(const NoDefaultConsAlloc&) const { return true; } bool operator!=(const NoDefaultConsAlloc&) const { return false; } }; using Map = std::unordered_map, std::equal_to, NoDefaultConsAlloc>>; static_assert( ! std::is_default_constructible{}, "PR libstdc++/100863" ); struct Hash : std::hash { Hash(int) { } }; using Map2 = std::unordered_map; static_assert( ! std::is_default_constructible{}, "PR libstdc++/100863" ); struct Equal : std::equal_to { Equal(int) { } }; using Map3 = std::unordered_map, Equal>; static_assert( ! std::is_default_constructible{}, "PR libstdc++/100863" ); // PR libstdc++/101583 // verify non-default ctors can still be used using Map4 = std::unordered_map>>; Hash h(1); Equal eq(1); Map4::allocator_type a(1); Map4 m{1, h, eq, a}; Map4 m2{m.begin(), m.end(), m.size(), h, eq, a}; Map4 m3{{{1,1}, {2,2}, {3,3}}, 3, h, eq, a}; Map4 m4{m}; Map4 m5{m, a}; Map4 m6{std::move(m)}; Map4 m7{std::move(m6), a};