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