]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / is_constructible / value-2.cc
CommitLineData
52066eae 1// { dg-do compile { target c++11 } }
123c516a 2
99dee823 3// Copyright (C) 2011-2021 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_constructible<int, int>::value, "Error");
27static_assert(std::is_constructible<std::nullptr_t, std::nullptr_t>::value,
28 "Error");
29static_assert(std::is_constructible<E, E>::value, "Error");
30static_assert(std::is_constructible<SE, SE>::value, "Error");
31static_assert(std::is_constructible<OpE, OpE>::value, "Error");
32static_assert(std::is_constructible<OpSE, OpSE>::value, "Error");
33static_assert(std::is_constructible<Empty, Empty>::value, "Error");
34static_assert(std::is_constructible<B, B>::value, "Error");
35static_assert(std::is_constructible<U, U>::value, "Error");
36static_assert(std::is_constructible<int B::*, int B::*>::value, "Error");
37static_assert(std::is_constructible<Ellipsis, Ellipsis>::value, "Error");
38static_assert(std::is_constructible<int*, int*>::value, "Error");
39static_assert(std::is_constructible<void*, void*>::value, "Error");
40static_assert(std::is_constructible<Any, Any>::value, "Error");
41static_assert(std::is_constructible<nAny, nAny>::value, "Error");
42static_assert(std::is_constructible<std::initializer_list<int>,
43 std::initializer_list<int>>::value, "Error");
44static_assert(std::is_constructible<DelDef, DelDef>::value, "Error");
45
46static_assert(!std::is_constructible<void, void>::value, "Error");
47static_assert(!std::is_constructible<Abstract, Abstract>::value, "Error");
48static_assert(!std::is_constructible<int[], int[]>::value, "Error");
49static_assert(!std::is_constructible<int[1], int[1]>::value, "Error");
50static_assert(!std::is_constructible<DelCopy, const DelCopy&>::value, "Error");
51static_assert(!std::is_constructible<DelCopy, DelCopy&&>::value, "Error");
52static_assert(!std::is_constructible<DelCopy, DelCopy>::value, "Error");
53static_assert(!std::is_constructible<DelDtor, void>::value, "Error");
54static_assert(!std::is_constructible<DelDtor, int>::value, "Error");
55static_assert(!std::is_constructible<DelDtor, DelDtor>::value, "Error");
56static_assert(!std::is_constructible<DelDtor, DelDtor&&>::value, "Error");
57static_assert(!std::is_constructible<DelDtor, const DelDtor&>::value, "Error");
58
59static_assert(std::is_constructible<DelEllipsis, const DelEllipsis&>::value,
60 "Error");
61static_assert(std::is_constructible<DelEllipsis, DelEllipsis&&>::value,
62 "Error");
63static_assert(std::is_constructible<DelEllipsis, DelEllipsis>::value, "Error");
64static_assert(!std::is_constructible<DelEllipsis, void>::value, "Error");
65static_assert(!std::is_constructible<DelEllipsis, std::nullptr_t>::value,
66 "Error");
67static_assert(!std::is_constructible<DelEllipsis, B>::value, "Error");
68static_assert(!std::is_constructible<DelEllipsis, Empty>::value, "Error");
69static_assert(!std::is_constructible<DelEllipsis, E>::value, "Error");
70static_assert(!std::is_constructible<DelEllipsis, SE>::value, "Error");
71static_assert(!std::is_constructible<DelEllipsis, OpE>::value, "Error");
72static_assert(!std::is_constructible<DelEllipsis, OpSE>::value, "Error");
73static_assert(!std::is_constructible<DelEllipsis, void()>::value, "Error");
89898034
DK
74static_assert(!std::is_constructible<DelEllipsis, void() const>::value,
75 "Error");
123c516a
PC
76static_assert(!std::is_constructible<DelEllipsis, int[1]>::value, "Error");
77static_assert(!std::is_constructible<DelEllipsis, int[]>::value, "Error");
78static_assert(!std::is_constructible<DelEllipsis, int*>::value, "Error");
79static_assert(!std::is_constructible<DelEllipsis, void*>::value, "Error");
80static_assert(!std::is_constructible<DelEllipsis, int B::*>::value, "Error");
81static_assert(!std::is_constructible<DelEllipsis, int D::*>::value, "Error");
82static_assert(!std::is_constructible<DelEllipsis, Abstract>::value, "Error");
83static_assert(!std::is_constructible<int, DelImplicitTo<int>>::value, "Error");
84static_assert(!std::is_constructible<std::nullptr_t,
85 DelImplicitTo<std::nullptr_t>>::value, "Error");
86static_assert(!std::is_constructible<int&,
87 DelImplicitTo<const int&>>::value, "Error");
88
89static_assert(!std::is_constructible<int, void>::value, "Error");
90static_assert(!std::is_constructible<void, int>::value, "Error");
91static_assert(std::is_constructible<void*, int*>::value, "Error");
92static_assert(!std::is_constructible<int*, void*>::value, "Error");
93static_assert(std::is_constructible<int*, std::nullptr_t>::value, "Error");
94static_assert(!std::is_constructible<std::nullptr_t, int*>::value, "Error");
95static_assert(!std::is_constructible<Empty, E>::value, "Error");
96static_assert(!std::is_constructible<Empty, SE>::value, "Error");
97static_assert(!std::is_constructible<Empty, OpE>::value, "Error");
98static_assert(!std::is_constructible<Empty, OpSE>::value, "Error");
99static_assert(!std::is_constructible<Empty, void>::value, "Error");
100static_assert(!std::is_constructible<Empty, void*>::value, "Error");
101static_assert(!std::is_constructible<Empty, std::nullptr_t>::value, "Error");
102static_assert(!std::is_constructible<Empty, int[]>::value, "Error");
103static_assert(!std::is_constructible<Empty, int[3]>::value, "Error");
104static_assert(!std::is_constructible<Empty, int>::value, "Error");
105static_assert(!std::is_constructible<Abstract, int>::value, "Error");
106static_assert(!std::is_constructible<Abstract, std::nullptr_t>::value, "Error");
107static_assert(!std::is_constructible<std::nullptr_t, Abstract>::value, "Error");
108static_assert(!std::is_constructible<Abstract, int[]>::value, "Error");
109static_assert(std::is_constructible<B, D>::value, "Error");
f6b2b790 110#ifndef __cpp_aggregate_paren_init
123c516a 111static_assert(!std::is_constructible<D, B>::value, "Error");
f6b2b790 112#endif
123c516a
PC
113static_assert(!std::is_constructible<int[], int[1]>::value, "Error");
114static_assert(!std::is_constructible<int[1], int[]>::value, "Error");
115static_assert(!std::is_constructible<int[], Empty>::value, "Error");
116static_assert(!std::is_constructible<int[], std::nullptr_t>::value, "Error");
117static_assert(!std::is_constructible<int[1], Abstract>::value, "Error");
118
119static_assert(std::is_constructible<const int*, int*>::value, "Error");
120static_assert(std::is_constructible<const void*, void*>::value, "Error");
121static_assert(std::is_constructible<const void*, int*>::value, "Error");
122static_assert(!std::is_constructible<int*, const void*>::value, "Error");
123
124static_assert(std::is_constructible<int, E>::value, "Error");
125static_assert(!std::is_constructible<E, int>::value, "Error");
126static_assert(!std::is_constructible<E, E2>::value, "Error");
127static_assert(std::is_constructible<E, E>::value, "Error");
128static_assert(std::is_constructible<bool, E>::value, "Error");
129static_assert(!std::is_constructible<E, bool>::value, "Error");
130static_assert(std::is_constructible<double, E>::value, "Error");
131static_assert(!std::is_constructible<E, double>::value, "Error");
132static_assert(!std::is_constructible<std::nullptr_t, E>::value, "Error");
133static_assert(!std::is_constructible<E, std::nullptr_t>::value, "Error");
134
135static_assert(std::is_constructible<int, OpE>::value, "Error");
136static_assert(!std::is_constructible<OpE, int>::value, "Error");
137static_assert(!std::is_constructible<OpE, E2>::value, "Error");
138static_assert(std::is_constructible<OpE, OpE>::value, "Error");
139static_assert(std::is_constructible<bool, OpE>::value, "Error");
140static_assert(!std::is_constructible<OpE, bool>::value, "Error");
141static_assert(std::is_constructible<double, OpE>::value, "Error");
142static_assert(!std::is_constructible<OpE, double>::value, "Error");
143static_assert(!std::is_constructible<std::nullptr_t, OpE>::value, "Error");
144static_assert(!std::is_constructible<OpE, std::nullptr_t>::value, "Error");
145
146static_assert(!std::is_constructible<int, SE>::value, "Error");
147static_assert(!std::is_constructible<SE, int>::value, "Error");
148static_assert(!std::is_constructible<E, SE>::value, "Error");
149static_assert(!std::is_constructible<SE, SE2>::value, "Error");
150static_assert(std::is_constructible<SE, SE>::value, "Error");
151static_assert(!std::is_constructible<bool, SE>::value, "Error");
152static_assert(!std::is_constructible<SE, bool>::value, "Error");
153static_assert(!std::is_constructible<double, SE>::value, "Error");
154static_assert(!std::is_constructible<SE, double>::value, "Error");
155static_assert(!std::is_constructible<std::nullptr_t, SE>::value, "Error");
156static_assert(!std::is_constructible<SE, std::nullptr_t>::value, "Error");
157
158static_assert(!std::is_constructible<int, OpSE>::value, "Error");
159static_assert(!std::is_constructible<OpSE, int>::value, "Error");
160static_assert(!std::is_constructible<OpE, OpSE>::value, "Error");
161static_assert(!std::is_constructible<OpSE, SE2>::value, "Error");
162static_assert(std::is_constructible<OpSE, OpSE>::value, "Error");
163static_assert(!std::is_constructible<bool, OpSE>::value, "Error");
164static_assert(!std::is_constructible<OpSE, bool>::value, "Error");
165static_assert(!std::is_constructible<double, OpSE>::value, "Error");
166static_assert(!std::is_constructible<OpSE, double>::value, "Error");
167static_assert(!std::is_constructible<std::nullptr_t, OpSE>::value, "Error");
168static_assert(!std::is_constructible<OpSE, std::nullptr_t>::value, "Error");
169
170static_assert(!std::is_constructible<D*, B*>::value, "Error");
171static_assert(!std::is_constructible<const volatile D*, B*>::value, "Error");
172static_assert(!std::is_constructible<D*, const volatile B*>::value, "Error");
173
174static_assert(!std::is_constructible<D*, B* const>::value, "Error");
175static_assert(!std::is_constructible<const volatile D*, B* const>::value,
176 "Error");
177static_assert(!std::is_constructible<D*, const volatile B* const>::value,
178 "Error");
179
180static_assert(!std::is_constructible<D*, B*&>::value, "Error");
181static_assert(!std::is_constructible<const volatile D*, B*&>::value, "Error");
182static_assert(!std::is_constructible<D*, const volatile B*&>::value, "Error");
183
184static_assert(!std::is_constructible<int B::*, int D::*>::value, "Error");
185static_assert(!std::is_constructible<const volatile int B::*, int D::*>::value,
186 "Error");
187static_assert(!std::is_constructible<int B::*, const volatile int D::*>::value,
188 "Error");
189
190static_assert(!std::is_constructible<int B::*, int D::* const>::value, "Error");
191static_assert(!std::is_constructible<const volatile int B::*,
192 int D::* const>::value, "Error");
193static_assert(!std::is_constructible<int B::*,
194 const volatile int D::* const>::value, "Error");
195
196static_assert(!std::is_constructible<int B::*, int D::*&>::value, "Error");
197static_assert(!std::is_constructible<const volatile int B::*,
198 int D::*&>::value, "Error");
199static_assert(!std::is_constructible<int B::*,
200 const volatile int D::*&>::value, "Error");
201
202static_assert(!std::is_constructible<int B::*, int D::* const &>::value,
203 "Error");
204static_assert(!std::is_constructible<const volatile int B::*,
205 int D::* const &>::value, "Error");
206static_assert(!std::is_constructible<int B::*,
207 const volatile int D::* const &>::value, "Error");
208
209static_assert(!std::is_constructible<int&&, int&>::value, "Error");
210static_assert(!std::is_constructible<const int&&, int&>::value, "Error");
211
212static_assert(std::is_constructible<B&, D&>::value, "Error");
213static_assert(std::is_constructible<B&&, D&&>::value, "Error");
214static_assert(std::is_constructible<const B&, D&>::value, "Error");
215static_assert(std::is_constructible<const B&&, D&&>::value, "Error");
216static_assert(!std::is_constructible<B&, const D&>::value, "Error");
217static_assert(!std::is_constructible<B&&, const D&&>::value, "Error");
218
0ea89b15
JW
219#if __cpp_aggregate_bases && __cpp_aggregate_paren_init
220// In C++20 an rvalue reference or const lvalue reference can bind to a
221// temporary of aggregate type that is initialized from a base class value.
222constexpr bool v = true;
223#else
224constexpr bool v = false;
225#endif
226
123c516a 227static_assert(!std::is_constructible<D&, B&>::value, "Error");
0ea89b15 228static_assert(v == std::is_constructible<D&&, B&&>::value, "Error");
123c516a 229static_assert(!std::is_constructible<D&, const B&>::value, "Error");
0ea89b15
JW
230static_assert(v == std::is_constructible<D&&, const B&&>::value, "Error");
231static_assert(v == std::is_constructible<const D&, B&>::value, "Error");
232static_assert(v == std::is_constructible<const D&&, B&&>::value, "Error");
123c516a
PC
233
234static_assert(!std::is_constructible<B&&, B&>::value, "Error");
235static_assert(!std::is_constructible<B&&, D&>::value, "Error");
236static_assert(std::is_constructible<B&&, ImplicitTo<D&&>>::value, "Error");
237static_assert(std::is_constructible<B&&, ImplicitTo<D&&>&>::value, "Error");
238static_assert(std::is_constructible<int&&, double&>::value, "Error");
239static_assert(std::is_constructible<const int&,
240 ImplicitTo<int&>&>::value, "Error");
241static_assert(std::is_constructible<const int&,
242 ImplicitTo<int&>>::value, "Error");
243static_assert(std::is_constructible<const int&,
244 ExplicitTo<int&>&>::value, "Error");
245static_assert(std::is_constructible<const int&,
246 ExplicitTo<int&>>::value, "Error");
247
62a405dd
JM
248static_assert(!std::is_constructible<B&&, ExplicitTo<D&&>>::value, "Error");
249static_assert(!std::is_constructible<B&&, ExplicitTo<D&&>&>::value, "Error");
123c516a
PC
250
251static_assert(!std::is_constructible<B&, B&&>::value, "Error");
252static_assert(!std::is_constructible<D&, B&&>::value, "Error");
253static_assert(!std::is_constructible<B&, D&&>::value, "Error");
254
255static_assert(std::is_constructible<void(&)(), void(&)()>::value, "Error");
256static_assert(std::is_constructible<void(&&)(), void(&&)()>::value, "Error");
257static_assert(std::is_constructible<void(&&)(), void()>::value, "Error");
258
259static_assert(!std::is_constructible<void>::value, "Error" );
260static_assert(!std::is_constructible<void, int>::value, "Error" );
261static_assert(!std::is_constructible<void, int, double>::value, "Error" );
262
263static_assert(!std::is_constructible<int&>::value, "Error" );
264static_assert(!std::is_constructible<const int&>::value, "Error" );
265static_assert(!std::is_constructible<int&, int, int>::value, "Error" );
266static_assert(!std::is_constructible<const int&, int, int>::value, "Error" );
267
268static_assert(std::is_constructible<void(&)(), void()>::value, "Error");
269static_assert(std::is_constructible<void(&)(), void(&&)()>::value, "Error");
270
271static_assert(std::is_constructible<int&, int&>::value, "Error");
272static_assert(!std::is_constructible<int&, const int&>::value, "Error");
273static_assert(!std::is_constructible<int&, int>::value, "Error");
274static_assert(!std::is_constructible<int&, int&&>::value, "Error");
275static_assert(!std::is_constructible<int&, const int&&>::value, "Error");
276static_assert(std::is_constructible<const int&, int&>::value, "Error");
277static_assert(std::is_constructible<const int&, int>::value, "Error");
278static_assert(std::is_constructible<const int&, const int>::value, "Error");
279static_assert(std::is_constructible<const int&, int&&>::value, "Error");
280static_assert(std::is_constructible<const int&, const int&&>::value, "Error");
281static_assert(std::is_constructible<volatile int&, int&>::value, "Error");
282static_assert(!std::is_constructible<volatile int&, const int&>::value,
283 "Error");
284static_assert(!std::is_constructible<volatile int&, int>::value, "Error");
285static_assert(!std::is_constructible<volatile int&, int&&>::value, "Error");
286static_assert(!std::is_constructible<volatile int&, const int&&>::value,
287 "Error");
288static_assert(std::is_constructible<const volatile int&, int&>::value, "Error");
289static_assert(!std::is_constructible<const volatile int&, int>::value, "Error");
290static_assert(!std::is_constructible<const volatile int&, const int>::value,
291 "Error");
292static_assert(!std::is_constructible<const volatile int&, int&&>::value,
293 "Error");
294static_assert(!std::is_constructible<const volatile int&, const int&&>::value,
295 "Error");
296
297static_assert(std::is_constructible<int&&, int>::value, "Error");
298static_assert(std::is_constructible<int&&, int&&>::value, "Error");
299static_assert(!std::is_constructible<int&&, const int&&>::value, "Error");
300static_assert(!std::is_constructible<int&&, int&>::value, "Error");
301static_assert(!std::is_constructible<int&&, const int&>::value, "Error");
302static_assert(std::is_constructible<int&&, double&>::value, "Error");
303static_assert(std::is_constructible<const int&&, int>::value, "Error");
304static_assert(std::is_constructible<const int&&, int&&>::value, "Error");
305static_assert(std::is_constructible<const int&&, const int>::value, "Error");
306static_assert(std::is_constructible<const int&&, const int&&>::value, "Error");
307static_assert(!std::is_constructible<int&&, const int&>::value, "Error");
308static_assert(!std::is_constructible<const int&&, int&>::value, "Error");
309static_assert(!std::is_constructible<const int&&, const int&>::value, "Error");
310static_assert(std::is_constructible<volatile int&&, int>::value, "Error");
311static_assert(std::is_constructible<volatile int&&, int&&>::value, "Error");
312static_assert(!std::is_constructible<volatile int&&, const int&&>::value,
313 "Error");
314static_assert(!std::is_constructible<volatile int&&, int&>::value, "Error");
315static_assert(!std::is_constructible<volatile int&&, const int&>::value,
316 "Error");
317static_assert(std::is_constructible<volatile int&&, double&>::value, "Error");
318static_assert(std::is_constructible<volatile const int&&, int>::value, "Error");
319static_assert(std::is_constructible<const volatile int&&, int&&>::value,
320 "Error");
321static_assert(std::is_constructible<const volatile int&&, const int>::value,
322 "Error");
323static_assert(std::is_constructible<const volatile int&&, const int&&>::value,
324 "Error");
325static_assert(!std::is_constructible<volatile int&&, const int&>::value,
326 "Error");
327static_assert(!std::is_constructible<const volatile int&&, int&>::value,
328 "Error");
329static_assert(!std::is_constructible<const volatile int&&,
330 const int&>::value, "Error");
331
332static_assert(std::is_constructible<Empty&, Empty&>::value, "Error");
333static_assert(!std::is_constructible<Empty&, const Empty&>::value, "Error");
334static_assert(!std::is_constructible<Empty&, Empty>::value, "Error");
335static_assert(!std::is_constructible<Empty&, Empty&&>::value, "Error");
336static_assert(!std::is_constructible<Empty&, const Empty&&>::value, "Error");
337static_assert(std::is_constructible<const Empty&, Empty&>::value, "Error");
338static_assert(std::is_constructible<const Empty&, Empty>::value, "Error");
339static_assert(std::is_constructible<const Empty&, const Empty>::value, "Error");
340static_assert(std::is_constructible<const Empty&, Empty&&>::value, "Error");
341static_assert(std::is_constructible<const Empty&, const Empty&&>::value,
342 "Error");
343static_assert(std::is_constructible<volatile Empty&, Empty&>::value, "Error");
344static_assert(!std::is_constructible<volatile Empty&, const Empty&>::value,
345 "Error");
346static_assert(!std::is_constructible<volatile Empty&, Empty>::value, "Error");
347static_assert(!std::is_constructible<volatile Empty&, Empty&&>::value, "Error");
348static_assert(!std::is_constructible<volatile Empty&, const Empty&&>::value,
349 "Error");
350static_assert(std::is_constructible<const volatile Empty&, Empty&>::value,
351 "Error");
352static_assert(!std::is_constructible<const volatile Empty&, Empty>::value,
353 "Error");
354static_assert(!std::is_constructible<const volatile Empty&,
355 const Empty>::value, "Error");
356static_assert(!std::is_constructible<const volatile Empty&,
357 Empty&&>::value, "Error");
358static_assert(!std::is_constructible<const volatile Empty&,
359 const Empty&&>::value, "Error");
360
361static_assert(std::is_constructible<Empty&&, Empty>::value, "Error");
362static_assert(std::is_constructible<Empty&&, Empty&&>::value, "Error");
363static_assert(!std::is_constructible<Empty&&, const Empty&&>::value, "Error");
364static_assert(!std::is_constructible<Empty&&, Empty&>::value, "Error");
365static_assert(!std::is_constructible<Empty&&, const Empty&>::value, "Error");
366static_assert(!std::is_constructible<Empty&&, double&>::value, "Error");
367static_assert(!std::is_constructible<Empty&&, const double&>::value, "Error");
368static_assert(std::is_constructible<const Empty&&, Empty>::value, "Error");
369static_assert(std::is_constructible<const Empty&&, Empty&&>::value, "Error");
370static_assert(std::is_constructible<const Empty&&, const Empty>::value,
371 "Error");
372static_assert(std::is_constructible<const Empty&&, const Empty&&>::value,
373 "Error");
374static_assert(!std::is_constructible<Empty&&, const Empty&>::value, "Error");
375static_assert(!std::is_constructible<const Empty&&, Empty&>::value, "Error");
376static_assert(!std::is_constructible<const Empty&&, const Empty&>::value,
377 "Error");
378static_assert(std::is_constructible<volatile Empty&&, Empty>::value, "Error");
379static_assert(std::is_constructible<volatile Empty&&, Empty&&>::value, "Error");
380static_assert(!std::is_constructible<volatile Empty&&, const Empty&&>::value,
381 "Error");
382static_assert(!std::is_constructible<volatile Empty&&, Empty&>::value, "Error");
383static_assert(!std::is_constructible<volatile Empty&&, const Empty&>::value,
384 "Error");
385static_assert(!std::is_constructible<volatile Empty&&, double&>::value,
386 "Error");
387static_assert(!std::is_constructible<volatile Empty&&, const double&>::value,
388 "Error");
389static_assert(std::is_constructible<const volatile Empty&&, Empty>::value,
390 "Error");
391static_assert(std::is_constructible<const volatile Empty&&, Empty&&>::value,
392 "Error");
393static_assert(std::is_constructible<const volatile Empty&&,
394 const Empty>::value, "Error");
395static_assert(std::is_constructible<const volatile Empty&&,
396 const Empty&&>::value, "Error");
397static_assert(!std::is_constructible<volatile Empty&&,
398 const Empty&>::value, "Error");
399static_assert(!std::is_constructible<const volatile Empty&&,
400 Empty&>::value, "Error");
401static_assert(!std::is_constructible<const volatile Empty&&,
402 const Empty&>::value, "Error");
403
404static_assert(std::is_constructible<Ellipsis, int>::value, "Error");
405static_assert(std::is_constructible<Ellipsis, Empty>::value, "Error");
406static_assert(std::is_constructible<Ellipsis, std::nullptr_t>::value, "Error");
407static_assert(std::is_constructible<Ellipsis, int[]>::value, "Error");
408static_assert(std::is_constructible<Ellipsis, int[1]>::value, "Error");
409static_assert(!std::is_constructible<Ellipsis, void>::value, "Error");
410
411static_assert(std::is_constructible<int(&)[1], int(&)[1]>::value, "Error");
412static_assert(std::is_constructible<const int(&)[1],
413 int(&)[1]>::value, "Error");
414static_assert(std::is_constructible<volatile int(&)[1],
415 int(&)[1]>::value, "Error");
416static_assert(std::is_constructible<const volatile int(&)[1],
417 int(&)[1]>::value, "Error");
418static_assert(!std::is_constructible<int(&)[1],
419 const int(&)[1]>::value, "Error");
420static_assert(!std::is_constructible<const int(&)[1],
421 volatile int(&)[1]>::value, "Error");
422
423static_assert(std::is_constructible<int(&)[], int(&)[]>::value, "Error");
424
425static_assert(!std::is_constructible<int(&)[1], int(&)[2]>::value, "Error");
426static_assert(!std::is_constructible<int(&)[1], int&>::value, "Error");
427static_assert(!std::is_constructible<int&, int(&)[1]>::value, "Error");
428
f6b2b790 429#ifndef __cpp_aggregate_paren_init
123c516a 430static_assert(!std::is_constructible<U, int>::value, "Error");
f6b2b790 431#endif
123c516a
PC
432static_assert(!std::is_constructible<U, Empty>::value, "Error");
433
434static_assert(!std::is_constructible<void(), void()>::value, "Error");
435static_assert(!std::is_constructible<void(), int>::value, "Error");
436static_assert(!std::is_constructible<void(), Abstract>::value, "Error");
437static_assert(!std::is_constructible<void(), std::nullptr_t>::value, "Error");
438static_assert(!std::is_constructible<void(), Empty>::value, "Error");
439static_assert(!std::is_constructible<void(), U>::value, "Error");
440static_assert(!std::is_constructible<void(), E>::value, "Error");
441static_assert(!std::is_constructible<void(), SE>::value, "Error");
442static_assert(!std::is_constructible<void(), OpE>::value, "Error");
443static_assert(!std::is_constructible<void(), OpSE>::value, "Error");
444static_assert(!std::is_constructible<void(), int[]>::value, "Error");
445static_assert(!std::is_constructible<void(), int[1]>::value, "Error");
446
447static_assert(!std::is_constructible<void() const,
448 void() volatile>::value, "Error");
449static_assert(!std::is_constructible<void() const, int>::value, "Error");
450static_assert(!std::is_constructible<void() const, Abstract>::value, "Error");
451static_assert(!std::is_constructible<void() const, std::nullptr_t>::value,
452 "Error");
453static_assert(!std::is_constructible<void() const, Empty>::value, "Error");
454static_assert(!std::is_constructible<void() const, U>::value, "Error");
455static_assert(!std::is_constructible<void() const, E>::value, "Error");
456static_assert(!std::is_constructible<void() const, SE>::value, "Error");
457static_assert(!std::is_constructible<void() const, OpE>::value, "Error");
458static_assert(!std::is_constructible<void() const, OpSE>::value, "Error");
459static_assert(!std::is_constructible<void() const, int[]>::value, "Error");
460static_assert(!std::is_constructible<void() const, int[1]>::value, "Error");
461
462static_assert(!std::is_constructible<void(int), void()>::value, "Error");
463static_assert(!std::is_constructible<int, void()>::value, "Error");
464static_assert(!std::is_constructible<Abstract, void()>::value, "Error");
465static_assert(!std::is_constructible<std::nullptr_t, void()>::value, "Error");
466static_assert(!std::is_constructible<Empty, void()>::value, "Error");
467static_assert(!std::is_constructible<U, void()>::value, "Error");
468static_assert(!std::is_constructible<E, void()>::value, "Error");
469static_assert(!std::is_constructible<SE, void()>::value, "Error");
470static_assert(!std::is_constructible<OpE, void()>::value, "Error");
471static_assert(!std::is_constructible<OpSE, void()>::value, "Error");
472static_assert(!std::is_constructible<int[], void()>::value, "Error");
473static_assert(!std::is_constructible<int[1], void()>::value, "Error");
474
89898034
DK
475static_assert(!std::is_constructible<void(int) const,
476 void() const>::value, "Error");
477static_assert(!std::is_constructible<int, void() const>::value, "Error");
478static_assert(!std::is_constructible<Abstract, void() const>::value, "Error");
479static_assert(!std::is_constructible<std::nullptr_t, void() const>::value,
480 "Error");
481static_assert(!std::is_constructible<Empty, void() const>::value, "Error");
482static_assert(!std::is_constructible<U, void() const>::value, "Error");
483static_assert(!std::is_constructible<E, void() const>::value, "Error");
484static_assert(!std::is_constructible<SE, void() const>::value, "Error");
485static_assert(!std::is_constructible<OpE, void() const>::value, "Error");
486static_assert(!std::is_constructible<OpSE, void() const>::value, "Error");
487static_assert(!std::is_constructible<int[], void() const>::value, "Error");
488static_assert(!std::is_constructible<int[1], void() const>::value, "Error");
123c516a
PC
489
490static_assert(!std::is_constructible<void, int, int>::value, "Error");
491static_assert(!std::is_constructible<void, Empty, B>::value, "Error");
492static_assert(!std::is_constructible<void, Empty, Empty>::value, "Error");
493static_assert(!std::is_constructible<void, U, Empty>::value, "Error");
494static_assert(!std::is_constructible<void, U, U>::value, "Error");
495static_assert(!std::is_constructible<void, std::nullptr_t,
496 std::nullptr_t>::value, "Error");
497static_assert(!std::is_constructible<void, int[1], int[1]>::value, "Error");
498static_assert(!std::is_constructible<void, int[], int[]>::value, "Error");
499static_assert(!std::is_constructible<void, void, int>::value, "Error");
500static_assert(!std::is_constructible<void, void, void>::value, "Error");
501static_assert(!std::is_constructible<void, void(), void()>::value, "Error");
89898034
DK
502static_assert(!std::is_constructible<void, void() const,
503 void() volatile>::value, "Error");
123c516a
PC
504
505static_assert(!std::is_constructible<int, int, int>::value, "Error");
506static_assert(!std::is_constructible<const int, int, int>::value, "Error");
507static_assert(!std::is_constructible<int, void, int>::value, "Error");
508static_assert(!std::is_constructible<const int, void, int>::value, "Error");
509static_assert(!std::is_constructible<int, void, void>::value, "Error");
510static_assert(!std::is_constructible<const int, void, void>::value, "Error");
511static_assert(!std::is_constructible<bool, int, int>::value, "Error");
512static_assert(!std::is_constructible<const bool, int, int>::value, "Error");
513static_assert(!std::is_constructible<std::nullptr_t, int, int>::value, "Error");
514static_assert(!std::is_constructible<const std::nullptr_t, int, int>::value,
515 "Error");
516static_assert(!std::is_constructible<std::nullptr_t, void, int>::value,
517 "Error");
518static_assert(!std::is_constructible<const std::nullptr_t, void, int>::value,
519 "Error");
520static_assert(!std::is_constructible<std::nullptr_t, void, void>::value,
521 "Error");
522static_assert(!std::is_constructible<const std::nullptr_t, void, void>::value,
523 "Error");
524static_assert(!std::is_constructible<E, int, int>::value, "Error");
525static_assert(!std::is_constructible<const E, int, int>::value, "Error");
526static_assert(!std::is_constructible<E, void, int>::value, "Error");
527static_assert(!std::is_constructible<const E, void, int>::value, "Error");
528static_assert(!std::is_constructible<E, void, void>::value, "Error");
529static_assert(!std::is_constructible<const E, void, void>::value, "Error");
530static_assert(!std::is_constructible<SE, int, int>::value, "Error");
531static_assert(!std::is_constructible<const SE, int, int>::value, "Error");
532static_assert(!std::is_constructible<SE, void, int>::value, "Error");
533static_assert(!std::is_constructible<const SE, void, int>::value, "Error");
534static_assert(!std::is_constructible<SE, void, void>::value, "Error");
535static_assert(!std::is_constructible<const SE, void, void>::value, "Error");
536static_assert(!std::is_constructible<OpE, int, int>::value, "Error");
537static_assert(!std::is_constructible<const OpE, int, int>::value, "Error");
538static_assert(!std::is_constructible<OpE, void, int>::value, "Error");
539static_assert(!std::is_constructible<const OpE, void, int>::value, "Error");
540static_assert(!std::is_constructible<OpE, void, void>::value, "Error");
541static_assert(!std::is_constructible<const OpE, void, void>::value, "Error");
542static_assert(!std::is_constructible<OpSE, int, int>::value, "Error");
543static_assert(!std::is_constructible<const OpSE, int, int>::value, "Error");
544static_assert(!std::is_constructible<OpSE, void, int>::value, "Error");
545static_assert(!std::is_constructible<const OpSE, void, int>::value, "Error");
546static_assert(!std::is_constructible<OpSE, void, void>::value, "Error");
547static_assert(!std::is_constructible<const OpSE, void, void>::value, "Error");
548static_assert(!std::is_constructible<Empty, int, int>::value, "Error");
549static_assert(!std::is_constructible<const Empty, int, int>::value, "Error");
550static_assert(!std::is_constructible<Empty, void, int>::value, "Error");
551static_assert(!std::is_constructible<const Empty, void, int>::value, "Error");
552static_assert(!std::is_constructible<Empty, void, void>::value, "Error");
553static_assert(!std::is_constructible<const Empty, void, void>::value, "Error");
554static_assert(!std::is_constructible<U, int, int>::value, "Error");
555static_assert(!std::is_constructible<const U, int, int>::value, "Error");
556static_assert(!std::is_constructible<U, void, int>::value, "Error");
557static_assert(!std::is_constructible<const U, void, int>::value, "Error");
558static_assert(!std::is_constructible<U, void, void>::value, "Error");
559static_assert(!std::is_constructible<const U, void, void>::value, "Error");
560static_assert(!std::is_constructible<B, int, int>::value, "Error");
561static_assert(!std::is_constructible<const B, int, int>::value, "Error");
562static_assert(!std::is_constructible<B, void, int>::value, "Error");
563static_assert(!std::is_constructible<const B, void, int>::value, "Error");
564static_assert(!std::is_constructible<B, void, void>::value, "Error");
565static_assert(!std::is_constructible<const B, void, void>::value, "Error");
566static_assert(!std::is_constructible<Any, int, int>::value, "Error");
567static_assert(!std::is_constructible<const Any, int, int>::value, "Error");
568static_assert(!std::is_constructible<Any, void, int>::value, "Error");
569static_assert(!std::is_constructible<const Any, void, int>::value, "Error");
570static_assert(!std::is_constructible<Any, void, void>::value, "Error");
571static_assert(!std::is_constructible<const Any, void, void>::value, "Error");
572static_assert(!std::is_constructible<nAny, void, int>::value, "Error");
573static_assert(!std::is_constructible<const nAny, void, int>::value, "Error");
574static_assert(!std::is_constructible<nAny, void, void>::value, "Error");
575static_assert(!std::is_constructible<const nAny, void, void>::value, "Error");
576static_assert(!std::is_constructible<FromArgs<>, int, int>::value, "Error");
577static_assert(!std::is_constructible<const FromArgs<>, int, int>::value,
578 "Error");
579static_assert(!std::is_constructible<FromArgs<>, void, int>::value, "Error");
580static_assert(!std::is_constructible<const FromArgs<>, void, int>::value,
581 "Error");
582static_assert(!std::is_constructible<FromArgs<>, void, void>::value, "Error");
583static_assert(!std::is_constructible<const FromArgs<>, void, void>::value,
584 "Error");
585static_assert(!std::is_constructible<Abstract, int, int>::value, "Error");
586static_assert(!std::is_constructible<const Abstract, int, int>::value, "Error");
587static_assert(!std::is_constructible<Abstract, void, int>::value, "Error");
588static_assert(!std::is_constructible<const Abstract, void, int>::value,
589 "Error");
590static_assert(!std::is_constructible<Abstract, void, void>::value, "Error");
591static_assert(!std::is_constructible<const Abstract, void, void>::value,
592 "Error");
593static_assert(!std::is_constructible<AbstractDelDtor, int, int>::value,
594 "Error");
595static_assert(!std::is_constructible<const AbstractDelDtor, int, int>::value,
596 "Error");
597static_assert(!std::is_constructible<AbstractDelDtor, void, int>::value,
598 "Error");
599static_assert(!std::is_constructible<const AbstractDelDtor, void, int>::value,
600 "Error");
601static_assert(!std::is_constructible<AbstractDelDtor, void, void>::value,
602 "Error");
603static_assert(!std::is_constructible<const AbstractDelDtor, void, void>::value,
604 "Error");
605static_assert(!std::is_constructible<int[1], int, int>::value, "Error");
606static_assert(!std::is_constructible<const int[1], int, int>::value, "Error");
607static_assert(!std::is_constructible<int[1], void, int>::value, "Error");
608static_assert(!std::is_constructible<const int[1], void, int>::value, "Error");
609static_assert(!std::is_constructible<int[1], void, void>::value, "Error");
610static_assert(!std::is_constructible<const int[1], void, void>::value, "Error");
611static_assert(!std::is_constructible<int&, int, int>::value, "Error");
612static_assert(!std::is_constructible<int&, void, int>::value, "Error");
613static_assert(!std::is_constructible<int&, void, void>::value, "Error");
614static_assert(!std::is_constructible<int&, int&, int&>::value, "Error");
615static_assert(!std::is_constructible<int&, void, int&>::value, "Error");
616static_assert(!std::is_constructible<int&, void, void>::value, "Error");
617static_assert(!std::is_constructible<std::nullptr_t&, int, int>::value,
618 "Error");
619static_assert(!std::is_constructible<std::nullptr_t&, void, int>::value,
620 "Error");
621static_assert(!std::is_constructible<std::nullptr_t&, void, void>::value,
622 "Error");
623static_assert(!std::is_constructible<E&, int, int>::value, "Error");
624static_assert(!std::is_constructible<E&, void, int>::value, "Error");
625static_assert(!std::is_constructible<E&, void, void>::value, "Error");
626static_assert(!std::is_constructible<SE&, int, int>::value, "Error");
627static_assert(!std::is_constructible<SE&, void, int>::value, "Error");
628static_assert(!std::is_constructible<SE&, void, void>::value, "Error");
629static_assert(!std::is_constructible<OpE&, int, int>::value, "Error");
630static_assert(!std::is_constructible<OpE&, void, int>::value, "Error");
631static_assert(!std::is_constructible<OpE&, void, void>::value, "Error");
632static_assert(!std::is_constructible<OpSE&, int, int>::value, "Error");
633static_assert(!std::is_constructible<OpSE&, void, int>::value, "Error");
634static_assert(!std::is_constructible<OpSE&, void, void>::value, "Error");
635static_assert(!std::is_constructible<Empty&, int, int>::value, "Error");
636static_assert(!std::is_constructible<Empty&, void, int>::value, "Error");
637static_assert(!std::is_constructible<Empty&, void, void>::value, "Error");
638static_assert(!std::is_constructible<U&, int, int>::value, "Error");
639static_assert(!std::is_constructible<U&, void, int>::value, "Error");
640static_assert(!std::is_constructible<U&, void, void>::value, "Error");
641static_assert(!std::is_constructible<B&, int, int>::value, "Error");
642static_assert(!std::is_constructible<B&, void, int>::value, "Error");
643static_assert(!std::is_constructible<B&, void, void>::value, "Error");
644static_assert(!std::is_constructible<Any&, int, int>::value, "Error");
645static_assert(!std::is_constructible<Any&, void, int>::value, "Error");
646static_assert(!std::is_constructible<Any&, void, void>::value, "Error");
647static_assert(!std::is_constructible<nAny&, void, int>::value, "Error");
648static_assert(!std::is_constructible<nAny&, void, void>::value, "Error");
649static_assert(!std::is_constructible<FromArgs<>&, int, int>::value, "Error");
650static_assert(!std::is_constructible<FromArgs<>&, void, int>::value, "Error");
651static_assert(!std::is_constructible<FromArgs<>&, void, void>::value, "Error");
652static_assert(!std::is_constructible<Abstract&, int, int>::value, "Error");
653static_assert(!std::is_constructible<Abstract&, void, int>::value, "Error");
654static_assert(!std::is_constructible<Abstract&, void, void>::value, "Error");
655static_assert(!std::is_constructible<int(&)[1], int, int>::value, "Error");
656static_assert(!std::is_constructible<int(&)[1], void, int>::value, "Error");
657static_assert(!std::is_constructible<int(&)[1], void, void>::value, "Error");
658
659static_assert(!std::is_constructible<void(), int, int>::value, "Error");
660static_assert(!std::is_constructible<void(), void, int>::value, "Error");
661static_assert(!std::is_constructible<void(), void, void>::value, "Error");
662static_assert(!std::is_constructible<void(), void(), int>::value, "Error");
663static_assert(!std::is_constructible<void(), void(), void()>::value, "Error");
664
89898034
DK
665static_assert(!std::is_constructible<void() const, int, int>::value, "Error");
666static_assert(!std::is_constructible<void() const, void, int>::value, "Error");
667static_assert(!std::is_constructible<void() const, void, void>::value, "Error");
668static_assert(!std::is_constructible<void() const, void() volatile,
669 int>::value, "Error");
670static_assert(!std::is_constructible<void() const, void() volatile const,
671 void() const>::value, "Error");
123c516a
PC
672
673static_assert(!std::is_constructible<FromArgs<int>, int, int>::value, "Error");
674static_assert(!std::is_constructible<const FromArgs<int>, int, int>::value,
675 "Error");
676static_assert(!std::is_constructible<FromArgs<int>, void, int>::value, "Error");
677static_assert(!std::is_constructible<const FromArgs<int>, void, int>::value,
678 "Error");
679static_assert(!std::is_constructible<FromArgs<int, int>, void, int>::value,
680 "Error");
681static_assert(!std::is_constructible<const FromArgs<int, int>, void,
682 int>::value, "Error");
683
684static_assert(!std::is_constructible<DelDtor, int, B, U>::value, "Error");
685static_assert(!std::is_constructible<const DelDtor, int, B, U>::value, "Error");
686static_assert(!std::is_constructible<DelDtor, int>::value, "Error");
687static_assert(!std::is_constructible<const DelDtor, int>::value, "Error");
688static_assert(!std::is_constructible<DelDtor>::value, "Error");
689static_assert(!std::is_constructible<const DelDtor>::value, "Error");
690static_assert(!std::is_constructible<DelDtor, void*, void(&)()>::value,
691 "Error");
692static_assert(!std::is_constructible<const DelDtor, void*, void(&)()>::value,
693 "Error");
694
695static_assert(!std::is_constructible<AbstractDelDtor>::value, "Error");
696static_assert(!std::is_constructible<const AbstractDelDtor>::value, "Error");
697static_assert(!std::is_constructible<DelEllipsis>::value, "Error");
698static_assert(!std::is_constructible<const DelEllipsis>::value, "Error");
699static_assert(!std::is_constructible<DelEllipsis, double>::value, "Error");
700static_assert(!std::is_constructible<const DelEllipsis, double>::value,
701 "Error");
702static_assert(!std::is_constructible<DelEllipsis, double, int&>::value,
703 "Error");
704static_assert(!std::is_constructible<const DelEllipsis, double, int&>::value,
705 "Error");
706static_assert(!std::is_constructible<DelnAny>::value, "Error");
707static_assert(!std::is_constructible<const DelnAny>::value, "Error");
708static_assert(!std::is_constructible<DelnAny, int>::value, "Error");
709static_assert(!std::is_constructible<const DelnAny, int>::value, "Error");
710static_assert(!std::is_constructible<DelnAny, int, void*>::value, "Error");
711static_assert(!std::is_constructible<const DelnAny, int, void*>::value,
712 "Error");
713static_assert(!std::is_constructible<DelnAny, Empty, B, D>::value, "Error");
714static_assert(!std::is_constructible<const DelnAny, Empty, B, D>::value,
715 "Error");
716
717// Deleted members in unions with non-trivial members:
718static_assert(!std::is_constructible<NontrivialUnion>::value, "Error");
719static_assert(!std::is_constructible<NontrivialUnion,
720 const NontrivialUnion&>::value, "Error");
721
722// Unusual copy:
723static_assert(!std::is_constructible<UnusualCopy>::value, "Error");
724static_assert(!std::is_constructible<UnusualCopy, UnusualCopy>::value, "Error");
725static_assert(!std::is_constructible<UnusualCopy,
726 UnusualCopy&&>::value, "Error");
727static_assert(!std::is_constructible<UnusualCopy,
728 const UnusualCopy&>::value, "Error");
729static_assert(std::is_constructible<UnusualCopy, UnusualCopy&>::value, "Error");
730
731static_assert(std::is_constructible<FromArgs<int, char>,
732 int, char>::value, "Error");
733static_assert(std::is_constructible<const FromArgs<int, char>,
734 int, char>::value, "Error");
735static_assert(std::is_constructible<FromArgs<int, char>,
736 int, int>::value, "Error");
737static_assert(std::is_constructible<const FromArgs<int, char>,
738 int, int>::value, "Error");
739static_assert(std::is_constructible<nAny, int, int>::value, "Error");
740static_assert(std::is_constructible<const nAny, int, int>::value, "Error");
741static_assert(std::is_constructible<FromArgs<int, char>,
742 ImplicitTo<int>, ImplicitTo<char>>::value, "Error");
743static_assert(std::is_constructible<const FromArgs<int, char>,
744 ImplicitTo<int>, ImplicitTo<char>>::value, "Error");
745static_assert(std::is_constructible<Ellipsis, int, char>::value, "Error");
746static_assert(std::is_constructible<const Ellipsis, int, char>::value, "Error");
747static_assert(std::is_constructible<Ellipsis, B, U, int&>::value, "Error");
748static_assert(std::is_constructible<const Ellipsis,
749 B, U, int&>::value, "Error");
750static_assert(std::is_constructible<nAny, B, U, int&>::value, "Error");
751static_assert(std::is_constructible<const nAny, B, U, int&>::value, "Error");
752static_assert(std::is_constructible<FromArgs<std::initializer_list<int>,
753 std::initializer_list<B>>, std::initializer_list<int>,
754 std::initializer_list<B>>::value, "Error");
755static_assert(std::is_constructible<const FromArgs<std::initializer_list<int>,
756 std::initializer_list<B>>, std::initializer_list<int>,
757 std::initializer_list<B>>::value, "Error");
758static_assert(std::is_constructible<FromArgs<std::initializer_list<int>,
759 std::initializer_list<B>>, std::initializer_list<int>&,
760 std::initializer_list<B>&>::value, "Error");
761static_assert(!std::is_constructible<FromArgs<std::initializer_list<int>&,
762 std::initializer_list<B>&>, std::initializer_list<int>,
763 std::initializer_list<B>>::value, "Error");
764
0ea89b15
JW
765#if __cpp_aggregate_paren_init
766// In C++20 arrays can be initialized using parentheses.
767constexpr bool w = true;
768#else
769constexpr bool w = false;
770#endif
771
123c516a
PC
772static_assert(!std::is_constructible<FromArgs<std::initializer_list<int>>,
773 int, int>::value, "Error");
62fa805f 774static_assert(!std::is_constructible<const
123c516a 775 FromArgs<std::initializer_list<int>>, int, int>::value, "Error");
0ea89b15
JW
776static_assert(w == std::is_constructible<B[2], B, B>::value, "Error");
777static_assert(w == std::is_constructible<const B[2], B, B>::value, "Error");
778static_assert(w == std::is_constructible<U[2], U, U>::value, "Error");
779static_assert(w == std::is_constructible<const U[2], U, U>::value, "Error");
123c516a
PC
780
781static_assert(!std::is_constructible<E, E, E>::value, "Error");
782static_assert(!std::is_constructible<const E, E, E>::value, "Error");
783static_assert(!std::is_constructible<SE, SE, SE>::value, "Error");
784static_assert(!std::is_constructible<const SE, SE, SE>::value, "Error");
785static_assert(!std::is_constructible<E, B, std::nullptr_t>::value, "Error");
786static_assert(!std::is_constructible<const E, B, std::nullptr_t>::value,
787 "Error");
788static_assert(!std::is_constructible<SE, B, std::nullptr_t>::value, "Error");
789static_assert(!std::is_constructible<const SE, B, std::nullptr_t>::value,
790 "Error");
791static_assert(!std::is_constructible<E, int[], int[]>::value, "Error");
792static_assert(!std::is_constructible<const E, int[], int[]>::value, "Error");
793static_assert(!std::is_constructible<SE, int[], int[]>::value, "Error");
794static_assert(!std::is_constructible<const SE, int[], int[]>::value, "Error");
795
796static_assert(!std::is_constructible<OpE, OpE, OpE>::value, "Error");
797static_assert(!std::is_constructible<const OpE, OpE, OpE>::value, "Error");
798static_assert(!std::is_constructible<OpSE, OpSE, OpSE>::value, "Error");
799static_assert(!std::is_constructible<const OpSE, OpSE, OpSE>::value, "Error");
800static_assert(!std::is_constructible<OpE, B, std::nullptr_t>::value, "Error");
801static_assert(!std::is_constructible<const OpE, B, std::nullptr_t>::value,
802 "Error");
803static_assert(!std::is_constructible<OpSE, B, std::nullptr_t>::value, "Error");
804static_assert(!std::is_constructible<const OpSE, B, std::nullptr_t>::value,
805 "Error");
806static_assert(!std::is_constructible<OpE, int[], int[]>::value, "Error");
807static_assert(!std::is_constructible<const OpE, int[], int[]>::value, "Error");
808static_assert(!std::is_constructible<OpSE, int[], int[]>::value, "Error");
809static_assert(!std::is_constructible<const OpSE, int[], int[]>::value, "Error");
810
811static_assert(!std::is_constructible<int[], int, int>::value, "Error");
812static_assert(!std::is_constructible<const int[], int, int>::value, "Error");
813
814static_assert(std::is_constructible<int&, ImplicitTo<int&>>::value, "Error");
815static_assert(std::is_constructible<const int&, ImplicitTo<int&&>>::value,
816 "Error");
817static_assert(std::is_constructible<int&&, ImplicitTo<int&&>>::value, "Error");
818static_assert(std::is_constructible<const int&, ImplicitTo<int>>::value,
819 "Error");
820
821static_assert(!std::is_constructible<const int&, ExplicitTo<int>>::value,
822 "Error");
823static_assert(!std::is_constructible<int&&, ExplicitTo<int>>::value, "Error");
824
825// Binding through reference-compatible type is required to perform
826// direct-initialization as described in [over.match.ref] p. 1 b. 1:
827static_assert(std::is_constructible<int&, ExplicitTo<int&>>::value, "Error");
123c516a
PC
828static_assert(std::is_constructible<int&&, ExplicitTo<int&&>>::value, "Error");
829
c7e936db
JM
830// But an xvalue doesn't count for direct binding.
831static_assert(!std::is_constructible<const int&, ExplicitTo<int&&>>::value,
832 "Error");
833
123c516a
PC
834// Binding through temporary behaves like copy-initialization,
835// see [dcl.init.ref] p. 5, very last sub-bullet:
836static_assert(!std::is_constructible<const int&, ExplicitTo<double&&>>::value,
837 "Error");
838static_assert(!std::is_constructible<int&&, ExplicitTo<double&&>>::value,
839 "Error");
5db25ab1
DK
840
841static_assert(std::is_constructible<void(&&)(), void(&)()>::value, "Error");