1 // Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do compile { target c++11 } }
20 #include <unordered_set>
22 using type1
= std::unordered_multiset
<int>;
24 static_assert(std::is_nothrow_default_constructible
<type1
>::value
,
25 "noexcept default constructible");
27 struct not_noexcept_dflt_cons_hash
29 not_noexcept_dflt_cons_hash() /* noexcept */;
32 operator()(int) const noexcept
;
35 using type2
= std::unordered_multiset
<int, not_noexcept_dflt_cons_hash
>;
37 static_assert( !std::is_nothrow_default_constructible
<type2
>::value
,
38 "not noexcept default constructible");
40 struct not_noexcept_dflt_cons_equal_to
42 not_noexcept_dflt_cons_equal_to() /* noexcept */;
45 operator()(int, int) const noexcept
;
48 using type3
= std::unordered_multiset
<int, std::hash
<int>,
49 not_noexcept_dflt_cons_equal_to
>;
51 static_assert( !std::is_nothrow_default_constructible
<type3
>::value
,
52 "not noexcept default constructible");
54 template<typename _Tp
>
55 struct not_noexcept_dflt_cons_alloc
: std::allocator
<_Tp
>
57 not_noexcept_dflt_cons_alloc() /* noexcept */;
59 template<typename _Tp1
>
61 { typedef not_noexcept_dflt_cons_alloc
<_Tp1
> other
; };
64 using type4
= std::unordered_multiset
<int, std::hash
<int>, std::equal_to
<int>,
65 not_noexcept_dflt_cons_alloc
<int>>;
67 static_assert(!std::is_nothrow_default_constructible
<type4
>::value
,
68 "not noexcept default constructible");