]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/is_default_constructible/value.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / is_default_constructible / value.cc
CommitLineData
52066eae 1// { dg-do compile { target c++11 } }
123c516a 2
8d9254fc 3// Copyright (C) 2011-2020 Free Software Foundation, Inc.
123c516a
PC
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
62fa805f 24using namespace __gnu_test::construct;
123c516a
PC
25
26static_assert(std::is_default_constructible<int>::value, "Error");
27static_assert(std::is_default_constructible<int const>::value, "Error");
28static_assert(std::is_default_constructible<int const volatile>::value,
29 "Error");
30static_assert(std::is_default_constructible<int*>::value, "Error");
31static_assert(std::is_default_constructible<void*>::value, "Error");
32static_assert(std::is_default_constructible<void* const>::value, "Error");
33static_assert(std::is_default_constructible<int B::*>::value, "Error");
34static_assert(std::is_default_constructible<void(*)()>::value, "Error");
35static_assert(std::is_default_constructible<std::nullptr_t>::value, "Error");
36static_assert(std::is_default_constructible<std::nullptr_t const>::value,
37 "Error");
38static_assert(std::is_default_constructible<Empty>::value, "Error");
39static_assert(std::is_default_constructible<Empty const>::value, "Error");
40static_assert(std::is_default_constructible<FromArgs<>>::value, "Error");
41static_assert(std::is_default_constructible<FromArgs<> const>::value, "Error");
42static_assert(std::is_default_constructible<nAny>::value, "Error");
43static_assert(std::is_default_constructible<nAny const>::value, "Error");
44static_assert(std::is_default_constructible<Ellipsis>::value, "Error");
45static_assert(std::is_default_constructible<Ellipsis const>::value, "Error");
46static_assert(std::is_default_constructible<U>::value, "Error");
47static_assert(std::is_default_constructible<U const>::value, "Error");
48static_assert(std::is_default_constructible<E>::value, "Error");
49static_assert(std::is_default_constructible<E const>::value, "Error");
50static_assert(std::is_default_constructible<SE>::value, "Error");
51static_assert(std::is_default_constructible<SE const>::value, "Error");
52static_assert(std::is_default_constructible<OpE>::value, "Error");
53static_assert(std::is_default_constructible<OpE const>::value, "Error");
54static_assert(std::is_default_constructible<OpSE>::value, "Error");
55static_assert(std::is_default_constructible<OpSE const>::value, "Error");
56static_assert(std::is_default_constructible<int[1]>::value, "Error");
57static_assert(std::is_default_constructible<const int[1]>::value, "Error");
58static_assert(std::is_default_constructible<int[1][2]>::value, "Error");
59static_assert(std::is_default_constructible<const int[1][2]>::value, "Error");
60static_assert(std::is_default_constructible<FromArgs<>[1]>::value, "Error");
61static_assert(std::is_default_constructible<const FromArgs<>[1]>::value,
62 "Error");
63static_assert(std::is_default_constructible<U[1]>::value, "Error");
64static_assert(std::is_default_constructible<const U[1]>::value, "Error");
65static_assert(std::is_default_constructible<Empty[1]>::value, "Error");
66static_assert(std::is_default_constructible<const Empty[1]>::value, "Error");
67static_assert(std::is_default_constructible<Ellipsis[1]>::value, "Error");
68static_assert(std::is_default_constructible<const Ellipsis[1]>::value, "Error");
69static_assert(std::is_default_constructible<std::nullptr_t[1]>::value, "Error");
70static_assert(std::is_default_constructible<const std::nullptr_t[1]>::value,
71 "Error");
72static_assert(std::is_default_constructible<nAny[1]>::value, "Error");
73static_assert(std::is_default_constructible<const nAny[1]>::value, "Error");
74static_assert(std::is_default_constructible<E[1]>::value, "Error");
75static_assert(std::is_default_constructible<const E[1]>::value, "Error");
76static_assert(std::is_default_constructible<SE[1]>::value, "Error");
77static_assert(std::is_default_constructible<const SE[1]>::value, "Error");
78static_assert(std::is_default_constructible<OpE[1]>::value, "Error");
79static_assert(std::is_default_constructible<const OpE[1]>::value, "Error");
80static_assert(std::is_default_constructible<OpSE[1]>::value, "Error");
81static_assert(std::is_default_constructible<const OpSE[1]>::value, "Error");
82static_assert(std::is_default_constructible<int*[1]>::value, "Error");
83static_assert(std::is_default_constructible<int* const[1]>::value, "Error");
84static_assert(std::is_default_constructible<int B::*[1]>::value, "Error");
85static_assert(std::is_default_constructible<int B::* const[1]>::value, "Error");
86static_assert(std::is_default_constructible<std::initializer_list<int>>::value,
87 "Error");
88static_assert(std::is_default_constructible<const
89 std::initializer_list<int>>::value, "Error");
90static_assert(std::is_default_constructible<
91 std::initializer_list<int>[1]>::value, "Error");
92static_assert(std::is_default_constructible<const
93 std::initializer_list<int>[1]>::value, "Error");
94
65cee9bd
PC
95static_assert(std::is_default_constructible
96 <__gnu_test::NoexceptDefaultClass>::value, "Error");
97static_assert(std::is_default_constructible
98 <__gnu_test::ThrowDefaultClass>::value, "Error");
99static_assert(std::is_default_constructible
100 <__gnu_test::ExceptDefaultClass>::value, "Error");
101
123c516a
PC
102static_assert(!std::is_default_constructible<void>::value, "Error");
103static_assert(!std::is_default_constructible<const void>::value, "Error");
104static_assert(!std::is_default_constructible<Abstract>::value, "Error");
105static_assert(!std::is_default_constructible<const Abstract>::value, "Error");
106static_assert(!std::is_default_constructible<Any>::value, "Error");
107static_assert(!std::is_default_constructible<const Any>::value, "Error");
108static_assert(!std::is_default_constructible<FromArgs<int>>::value, "Error");
109static_assert(!std::is_default_constructible<const FromArgs<int>>::value,
110 "Error");
111static_assert(!std::is_default_constructible<int&>::value, "Error");
112static_assert(!std::is_default_constructible<int&&>::value, "Error");
113static_assert(!std::is_default_constructible<void()>::value, "Error");
114static_assert(!std::is_default_constructible<void() const volatile>::value,
115 "Error");
116static_assert(!std::is_default_constructible<void(&)()>::value, "Error");
117static_assert(!std::is_default_constructible<int(&)[1]>::value, "Error");
118static_assert(!std::is_default_constructible<int(&)[]>::value, "Error");
119static_assert(!std::is_default_constructible<int[]>::value, "Error");
120static_assert(!std::is_default_constructible<const int[]>::value, "Error");
121static_assert(!std::is_default_constructible<int[][1][2]>::value, "Error");
122static_assert(!std::is_default_constructible<const int[][1][2]>::value,
123 "Error");
124static_assert(!std::is_default_constructible<Any[1]>::value, "Error");
125static_assert(!std::is_default_constructible<const Any[1]>::value, "Error");
126static_assert(!std::is_default_constructible<FromArgs<int>[1]>::value, "Error");
127static_assert(!std::is_default_constructible<const FromArgs<int>[1]>::value,
128 "Error");
129static_assert(!std::is_default_constructible<
130 FromArgs<std::initializer_list<int>>>::value, "Error");
131static_assert(!std::is_default_constructible<const
132 FromArgs<std::initializer_list<int>>>::value, "Error");
133static_assert(!std::is_default_constructible<const
134 FromArgs<const std::initializer_list<int>>>::value, "Error");
135static_assert(!std::is_default_constructible<DelDef>::value, "Error");
136static_assert(!std::is_default_constructible<const DelDef>::value, "Error");
137static_assert(!std::is_default_constructible<DelCopy>::value, "Error");
138static_assert(!std::is_default_constructible<const DelCopy>::value, "Error");
139static_assert(!std::is_default_constructible<DelDtor>::value, "Error");
140static_assert(!std::is_default_constructible<const DelDtor>::value, "Error");
58487c21
JW
141
142static_assert(!std::is_default_constructible<int[]>::value, "PR c++/90532");
143static_assert(!std::is_default_constructible<Empty[]>::value, "PR c++/90532");
144static_assert(!std::is_default_constructible<B[]>::value, "PR c++/90532");
145static_assert(!std::is_default_constructible<D[]>::value, "PR c++/90532");
146static_assert(!std::is_default_constructible<U[]>::value, "PR c++/90532");
147static_assert(!std::is_default_constructible<Ukn[]>::value, "PR c++/90532");
148static_assert(!std::is_default_constructible<Ellipsis[]>::value, "PR c++/90532");
149static_assert(!std::is_default_constructible<Any[]>::value, "PR c++/90532");
150static_assert(!std::is_default_constructible<nAny[]>::value, "PR c++/90532");