1 // { dg-options "-std=gnu++2a" }
2 // { dg-do compile { target c++2a } }
4 // Copyright (C) 2020-2021 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
21 #include <type_traits>
23 static_assert( std::is_nothrow_constructible_v
<int[1]> );
24 static_assert( std::is_nothrow_constructible_v
<int[1], int> );
25 static_assert( std::is_nothrow_constructible_v
<int[2], int> );
26 static_assert( std::is_nothrow_constructible_v
<int[2], int, int> );
27 static_assert( ! std::is_nothrow_constructible_v
<int[1], int, int> );
28 static_assert( ! std::is_nothrow_constructible_v
<int[]> );
29 static_assert( ! std::is_nothrow_constructible_v
<int[], int> );
30 static_assert( ! std::is_nothrow_constructible_v
<int[], int, int> );
39 static_assert( std::is_nothrow_constructible_v
<X
[2]> );
40 static_assert( std::is_nothrow_constructible_v
<X
[1], X
> );
41 static_assert( std::is_nothrow_constructible_v
<X
[1], int> );
42 static_assert( ! std::is_nothrow_constructible_v
<X
[1], double> );
43 static_assert( ! std::is_nothrow_constructible_v
<X
[2], int, double> );
51 static_assert( std::is_nothrow_constructible_v
<Y
> );
52 static_assert( std::is_nothrow_constructible_v
<Y
, Y
> );
53 static_assert( std::is_nothrow_constructible_v
<Y
, int> );
54 static_assert( ! std::is_nothrow_constructible_v
<Y
, X
> );
55 static_assert( std::is_nothrow_constructible_v
<Y
, int, X
> );
56 static_assert( std::is_nothrow_constructible_v
<Y
, int, int> );
57 static_assert( ! std::is_nothrow_constructible_v
<Y
, int, double> );
61 static_assert( std::is_nothrow_constructible_v
<Z
> );
62 static_assert( std::is_nothrow_constructible_v
<Z
, Z
> );
63 static_assert( std::is_nothrow_constructible_v
<Z
, Y
> );
64 static_assert( ! std::is_nothrow_constructible_v
<Z
, int> );
65 static_assert( ! std::is_nothrow_constructible_v
<Z
, int, X
> );
66 static_assert( ! std::is_nothrow_constructible_v
<Z
, int, int> );
67 static_assert( ! std::is_nothrow_constructible_v
<Z
, Y
, double> );
68 static_assert( ! std::is_nothrow_constructible_v
<Z
, int, double> );
69 static_assert( ! std::is_nothrow_constructible_v
<Z
, X
> );