summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/20_util/is_nothrow_destructible/value.cc
blob: 73c1f87508d7e5081554d19a1ea7678d53db8121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// { dg-options "-std=gnu++11" }
// { dg-do compile }

// Copyright (C) 2012-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.

#include <type_traits>
#include <initializer_list>
#include <testsuite_tr1.h>

using namespace __gnu_test::destruct;

// is_nothrow_destructible:
static_assert(std::is_nothrow_destructible<int>::value, "Error");
static_assert(std::is_nothrow_destructible<const int>::value, "Error");
static_assert(std::is_nothrow_destructible<const volatile int>::value, "Error");
static_assert(std::is_nothrow_destructible<int[12]>::value, "Error");
static_assert(std::is_nothrow_destructible<const int[12]>::value, "Error");
static_assert(std::is_nothrow_destructible<const volatile int[12]>::value, "Error");
static_assert(std::is_nothrow_destructible<decltype(nullptr)>::value, "Error");
static_assert(std::is_nothrow_destructible<std::initializer_list<int>>::value, "Error");
static_assert(std::is_nothrow_destructible<std::initializer_list<decltype(nullptr)>>::value, "Error");
static_assert(std::is_nothrow_destructible<std::initializer_list<TD1>>::value, "Error");
static_assert(std::is_nothrow_destructible<std::initializer_list<TD2>>::value, "Error");
static_assert(std::is_nothrow_destructible<E>::value, "Error");
static_assert(std::is_nothrow_destructible<const E>::value, "Error");
static_assert(std::is_nothrow_destructible<const volatile E>::value, "Error");
static_assert(std::is_nothrow_destructible<NTD1>::value, "Error");
static_assert(std::is_nothrow_destructible<NTD2>::value, "Error");
static_assert(std::is_nothrow_destructible<NTD3>::value, "Error");
static_assert(std::is_nothrow_destructible<Aggr>::value, "Error");
static_assert(std::is_nothrow_destructible<U1>::value, "Error");
static_assert(std::is_nothrow_destructible<void(*)()>::value, "Error");
static_assert(std::is_nothrow_destructible<void*>::value, "Error");
static_assert(std::is_nothrow_destructible<int&>::value, "Error");
static_assert(std::is_nothrow_destructible<TD1&>::value, "Error");
static_assert(std::is_nothrow_destructible<TD2&>::value, "Error");
static_assert(std::is_nothrow_destructible<TD1*>::value, "Error");
static_assert(std::is_nothrow_destructible<TD2*>::value, "Error");
static_assert(std::is_nothrow_destructible<void(&)()>::value, "Error");
static_assert(std::is_nothrow_destructible<void(&&)()>::value, "Error");
static_assert(std::is_nothrow_destructible<En>::value, "Error");
static_assert(std::is_nothrow_destructible<En*>::value, "Error");
static_assert(std::is_nothrow_destructible<En&>::value, "Error");
static_assert(std::is_nothrow_destructible<En2>::value, "Error");
static_assert(std::is_nothrow_destructible<En2*>::value, "Error");
static_assert(std::is_nothrow_destructible<En2&>::value, "Error");
static_assert(std::is_nothrow_destructible<TD1(&)(Aggr2, TD2)>::value, "Error");
static_assert(std::is_nothrow_destructible<TD1(*)(Aggr2, TD2)>::value, "Error");
static_assert(std::is_nothrow_destructible<Abstract1>::value, "Error");
static_assert(std::is_nothrow_destructible<Der>::value, "Error");
static_assert(std::is_nothrow_destructible<Del&>::value, "Error");
static_assert(std::is_nothrow_destructible<Del2&>::value, "Error");
static_assert(std::is_nothrow_destructible<Del3&>::value, "Error");
static_assert(std::is_nothrow_destructible<Del(&)[1]>::value, "Error");
static_assert(std::is_nothrow_destructible<Del2(&)[2]>::value, "Error");
static_assert(std::is_nothrow_destructible<Del3(&)[3]>::value, "Error");
static_assert(std::is_nothrow_destructible<Del&&>::value, "Error");
static_assert(std::is_nothrow_destructible<Del2&&>::value, "Error");
static_assert(std::is_nothrow_destructible<Del3&>::value, "Error");
static_assert(std::is_nothrow_destructible<Del(&&)[1]>::value, "Error");
static_assert(std::is_nothrow_destructible<Del2(&&)[2]>::value, "Error");
static_assert(std::is_nothrow_destructible<Del3(&&)[3]>::value, "Error");
static_assert(std::is_nothrow_destructible<Ut&>::value, "Error");
static_assert(std::is_nothrow_destructible<Ut&&>::value, "Error");
static_assert(std::is_nothrow_destructible<Ut*>::value, "Error");
static_assert(std::is_nothrow_destructible<Abstract2&>::value, "Error");
static_assert(std::is_nothrow_destructible<Abstract3&>::value, "Error");
static_assert(std::is_nothrow_destructible<Abstract2*>::value, "Error");
static_assert(std::is_nothrow_destructible<Abstract3*>::value, "Error");

static_assert(!std::is_nothrow_destructible<void>::value, "Error");
static_assert(!std::is_nothrow_destructible<const void>::value, "Error");
static_assert(!std::is_nothrow_destructible<void()>::value, "Error");
static_assert(!std::is_nothrow_destructible<void() const>::value, "Error");
static_assert(!std::is_nothrow_destructible<TD1(Aggr2, TD2)>::value, "Error");
static_assert(!std::is_nothrow_destructible<int[]>::value, "Error");
static_assert(!std::is_nothrow_destructible<const int[]>::value, "Error");
static_assert(!std::is_nothrow_destructible<const volatile int[]>::value, "Error");
static_assert(!std::is_nothrow_destructible<int[][123]>::value, "Error");
static_assert(!std::is_nothrow_destructible<TD1>::value, "Error");
static_assert(!std::is_nothrow_destructible<TD2>::value, "Error");
static_assert(!std::is_nothrow_destructible<Aggr2>::value, "Error");
static_assert(!std::is_nothrow_destructible<Aggr2[1]>::value, "Error");
static_assert(!std::is_nothrow_destructible<TD1[1][2]>::value, "Error");
static_assert(!std::is_nothrow_destructible<Ut>::value, "Error");
static_assert(!std::is_nothrow_destructible<Ut[3]>::value, "Error");
static_assert(!std::is_nothrow_destructible<AbstractDelDtor>::value, "Error");
static_assert(!std::is_nothrow_destructible<Abstract2>::value, "Error");
static_assert(!std::is_nothrow_destructible<Abstract3>::value, "Error");
static_assert(!std::is_nothrow_destructible<Der2>::value, "Error");
static_assert(!std::is_nothrow_destructible<Del>::value, "Error");
static_assert(!std::is_nothrow_destructible<Del2>::value, "Error");
static_assert(!std::is_nothrow_destructible<Del3>::value, "Error");
static_assert(!std::is_nothrow_destructible<Del[1]>::value, "Error");
static_assert(!std::is_nothrow_destructible<Del2[2]>::value, "Error");
static_assert(!std::is_nothrow_destructible<Del3[3]>::value, "Error");