]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/is_nothrow_destructible/value.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / is_nothrow_destructible / value.cc
CommitLineData
52066eae 1// { dg-do compile { target c++11 } }
62fa805f 2
7adcbafe 3// Copyright (C) 2012-2022 Free Software Foundation, Inc.
62fa805f
DK
4//
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)
9// any later version.
10//
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.
15//
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/>.
19
20#include <type_traits>
21#include <initializer_list>
22#include <testsuite_tr1.h>
23
24using namespace __gnu_test::destruct;
25
26// is_nothrow_destructible:
27static_assert(std::is_nothrow_destructible<int>::value, "Error");
28static_assert(std::is_nothrow_destructible<const int>::value, "Error");
29static_assert(std::is_nothrow_destructible<const volatile int>::value, "Error");
30static_assert(std::is_nothrow_destructible<int[12]>::value, "Error");
31static_assert(std::is_nothrow_destructible<const int[12]>::value, "Error");
32static_assert(std::is_nothrow_destructible<const volatile int[12]>::value, "Error");
33static_assert(std::is_nothrow_destructible<decltype(nullptr)>::value, "Error");
34static_assert(std::is_nothrow_destructible<std::initializer_list<int>>::value, "Error");
35static_assert(std::is_nothrow_destructible<std::initializer_list<decltype(nullptr)>>::value, "Error");
36static_assert(std::is_nothrow_destructible<std::initializer_list<TD1>>::value, "Error");
37static_assert(std::is_nothrow_destructible<std::initializer_list<TD2>>::value, "Error");
38static_assert(std::is_nothrow_destructible<E>::value, "Error");
39static_assert(std::is_nothrow_destructible<const E>::value, "Error");
40static_assert(std::is_nothrow_destructible<const volatile E>::value, "Error");
41static_assert(std::is_nothrow_destructible<NTD1>::value, "Error");
42static_assert(std::is_nothrow_destructible<NTD2>::value, "Error");
43static_assert(std::is_nothrow_destructible<NTD3>::value, "Error");
44static_assert(std::is_nothrow_destructible<Aggr>::value, "Error");
45static_assert(std::is_nothrow_destructible<U1>::value, "Error");
46static_assert(std::is_nothrow_destructible<void(*)()>::value, "Error");
47static_assert(std::is_nothrow_destructible<void*>::value, "Error");
48static_assert(std::is_nothrow_destructible<int&>::value, "Error");
49static_assert(std::is_nothrow_destructible<TD1&>::value, "Error");
50static_assert(std::is_nothrow_destructible<TD2&>::value, "Error");
51static_assert(std::is_nothrow_destructible<TD1*>::value, "Error");
52static_assert(std::is_nothrow_destructible<TD2*>::value, "Error");
53static_assert(std::is_nothrow_destructible<void(&)()>::value, "Error");
54static_assert(std::is_nothrow_destructible<void(&&)()>::value, "Error");
55static_assert(std::is_nothrow_destructible<En>::value, "Error");
56static_assert(std::is_nothrow_destructible<En*>::value, "Error");
57static_assert(std::is_nothrow_destructible<En&>::value, "Error");
58static_assert(std::is_nothrow_destructible<En2>::value, "Error");
59static_assert(std::is_nothrow_destructible<En2*>::value, "Error");
60static_assert(std::is_nothrow_destructible<En2&>::value, "Error");
61static_assert(std::is_nothrow_destructible<TD1(&)(Aggr2, TD2)>::value, "Error");
62static_assert(std::is_nothrow_destructible<TD1(*)(Aggr2, TD2)>::value, "Error");
63static_assert(std::is_nothrow_destructible<Abstract1>::value, "Error");
64static_assert(std::is_nothrow_destructible<Der>::value, "Error");
65static_assert(std::is_nothrow_destructible<Del&>::value, "Error");
66static_assert(std::is_nothrow_destructible<Del2&>::value, "Error");
67static_assert(std::is_nothrow_destructible<Del3&>::value, "Error");
68static_assert(std::is_nothrow_destructible<Del(&)[1]>::value, "Error");
69static_assert(std::is_nothrow_destructible<Del2(&)[2]>::value, "Error");
70static_assert(std::is_nothrow_destructible<Del3(&)[3]>::value, "Error");
71static_assert(std::is_nothrow_destructible<Del&&>::value, "Error");
72static_assert(std::is_nothrow_destructible<Del2&&>::value, "Error");
73static_assert(std::is_nothrow_destructible<Del3&>::value, "Error");
74static_assert(std::is_nothrow_destructible<Del(&&)[1]>::value, "Error");
75static_assert(std::is_nothrow_destructible<Del2(&&)[2]>::value, "Error");
76static_assert(std::is_nothrow_destructible<Del3(&&)[3]>::value, "Error");
77static_assert(std::is_nothrow_destructible<Ut&>::value, "Error");
78static_assert(std::is_nothrow_destructible<Ut&&>::value, "Error");
79static_assert(std::is_nothrow_destructible<Ut*>::value, "Error");
80static_assert(std::is_nothrow_destructible<Abstract2&>::value, "Error");
81static_assert(std::is_nothrow_destructible<Abstract3&>::value, "Error");
82static_assert(std::is_nothrow_destructible<Abstract2*>::value, "Error");
83static_assert(std::is_nothrow_destructible<Abstract3*>::value, "Error");
84
85static_assert(!std::is_nothrow_destructible<void>::value, "Error");
86static_assert(!std::is_nothrow_destructible<const void>::value, "Error");
87static_assert(!std::is_nothrow_destructible<void()>::value, "Error");
88static_assert(!std::is_nothrow_destructible<void() const>::value, "Error");
89static_assert(!std::is_nothrow_destructible<TD1(Aggr2, TD2)>::value, "Error");
90static_assert(!std::is_nothrow_destructible<int[]>::value, "Error");
91static_assert(!std::is_nothrow_destructible<const int[]>::value, "Error");
92static_assert(!std::is_nothrow_destructible<const volatile int[]>::value, "Error");
93static_assert(!std::is_nothrow_destructible<int[][123]>::value, "Error");
94static_assert(!std::is_nothrow_destructible<TD1>::value, "Error");
95static_assert(!std::is_nothrow_destructible<TD2>::value, "Error");
96static_assert(!std::is_nothrow_destructible<Aggr2>::value, "Error");
97static_assert(!std::is_nothrow_destructible<Aggr2[1]>::value, "Error");
98static_assert(!std::is_nothrow_destructible<TD1[1][2]>::value, "Error");
99static_assert(!std::is_nothrow_destructible<Ut>::value, "Error");
100static_assert(!std::is_nothrow_destructible<Ut[3]>::value, "Error");
101static_assert(!std::is_nothrow_destructible<AbstractDelDtor>::value, "Error");
102static_assert(!std::is_nothrow_destructible<Abstract2>::value, "Error");
103static_assert(!std::is_nothrow_destructible<Abstract3>::value, "Error");
104static_assert(!std::is_nothrow_destructible<Der2>::value, "Error");
105static_assert(!std::is_nothrow_destructible<Del>::value, "Error");
106static_assert(!std::is_nothrow_destructible<Del2>::value, "Error");
107static_assert(!std::is_nothrow_destructible<Del3>::value, "Error");
108static_assert(!std::is_nothrow_destructible<Del[1]>::value, "Error");
109static_assert(!std::is_nothrow_destructible<Del2[2]>::value, "Error");
110static_assert(!std::is_nothrow_destructible<Del3[3]>::value, "Error");
111