1 // { dg-do compile { target c++11 } }
3 // Copyright (C) 2016-2024 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
22 #include <type_traits>
29 Poison(Poison
&&) = delete;
34 ThrowingCopy(const ThrowingCopy
&);
35 ThrowingCopy
& operator=(const ThrowingCopy
&);
40 static_assert(!is_copy_constructible
<Poison
>::value
, "");
41 static_assert(!is_move_constructible
<Poison
>::value
, "");
42 static_assert(!is_copy_assignable
<Poison
>::value
, "");
43 static_assert(!is_move_assignable
<Poison
>::value
, "");
44 static_assert(!is_copy_constructible
<std::pair
<int, Poison
>>::value
,
46 static_assert(!is_move_constructible
<std::pair
<int, Poison
>>::value
,
48 static_assert(!is_copy_assignable
<std::pair
<int, Poison
>>::value
, "");
49 static_assert(!is_move_assignable
<std::pair
<int, Poison
>>::value
, "");
50 static_assert(!is_constructible
<std::pair
<int, Poison
>&,
51 std::pair
<char, Poison
>&>::value
, "");
52 static_assert(!is_assignable
<std::pair
<int, Poison
>&,
53 std::pair
<char, Poison
>&>::value
, "");
54 static_assert(!is_constructible
<std::pair
<int, Poison
>&,
55 std::pair
<char, Poison
>>::value
, "");
56 static_assert(!is_assignable
<std::pair
<int, Poison
>&,
57 std::pair
<char, Poison
>>::value
, "");
58 static_assert(!is_copy_constructible
<std::pair
<ThrowingCopy
,
59 std::unique_ptr
<int>>>::value
,
61 static_assert(is_move_constructible
<std::pair
<ThrowingCopy
,
62 std::unique_ptr
<int>>>::value
,
64 static_assert(!is_nothrow_move_constructible
<std::pair
<ThrowingCopy
,
65 std::unique_ptr
<int>>>::value
,
67 static_assert(!is_copy_assignable
<std::pair
<ThrowingCopy
,
68 std::unique_ptr
<int>>>::value
,
70 static_assert(is_move_assignable
<std::pair
<ThrowingCopy
,
71 std::unique_ptr
<int>>>::value
,
73 static_assert(!is_nothrow_move_assignable
<std::pair
<ThrowingCopy
,
74 std::unique_ptr
<int>>>::value
,