]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/is_default_constructible/value.cc
i386.md (*add<mode>_2): Add r/r/0 alternative.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / is_default_constructible / value.cc
CommitLineData
123c516a
PC
1// { dg-options "-std=gnu++0x" }
2// { dg-do compile }
3
4// Copyright (C) 2011 Free Software Foundation, Inc.
5//
6// This file is part of the GNU ISO C++ Library. This library is free
7// software; you can redistribute it and/or modify it under the
8// terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 3, or (at your option)
10// any later version.
11//
12// This library is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License along
18// with this library; see the file COPYING3. If not see
19// <http://www.gnu.org/licenses/>.
20
21#include <type_traits>
22#include <initializer_list>
23#include <testsuite_tr1.h>
24
25using namespace __gnu_test::construct_destruct;
26
27static_assert(std::is_default_constructible<int>::value, "Error");
28static_assert(std::is_default_constructible<int const>::value, "Error");
29static_assert(std::is_default_constructible<int const volatile>::value,
30 "Error");
31static_assert(std::is_default_constructible<int*>::value, "Error");
32static_assert(std::is_default_constructible<void*>::value, "Error");
33static_assert(std::is_default_constructible<void* const>::value, "Error");
34static_assert(std::is_default_constructible<int B::*>::value, "Error");
35static_assert(std::is_default_constructible<void(*)()>::value, "Error");
36static_assert(std::is_default_constructible<std::nullptr_t>::value, "Error");
37static_assert(std::is_default_constructible<std::nullptr_t const>::value,
38 "Error");
39static_assert(std::is_default_constructible<Empty>::value, "Error");
40static_assert(std::is_default_constructible<Empty const>::value, "Error");
41static_assert(std::is_default_constructible<FromArgs<>>::value, "Error");
42static_assert(std::is_default_constructible<FromArgs<> const>::value, "Error");
43static_assert(std::is_default_constructible<nAny>::value, "Error");
44static_assert(std::is_default_constructible<nAny const>::value, "Error");
45static_assert(std::is_default_constructible<Ellipsis>::value, "Error");
46static_assert(std::is_default_constructible<Ellipsis const>::value, "Error");
47static_assert(std::is_default_constructible<U>::value, "Error");
48static_assert(std::is_default_constructible<U const>::value, "Error");
49static_assert(std::is_default_constructible<E>::value, "Error");
50static_assert(std::is_default_constructible<E const>::value, "Error");
51static_assert(std::is_default_constructible<SE>::value, "Error");
52static_assert(std::is_default_constructible<SE const>::value, "Error");
53static_assert(std::is_default_constructible<OpE>::value, "Error");
54static_assert(std::is_default_constructible<OpE const>::value, "Error");
55static_assert(std::is_default_constructible<OpSE>::value, "Error");
56static_assert(std::is_default_constructible<OpSE const>::value, "Error");
57static_assert(std::is_default_constructible<int[1]>::value, "Error");
58static_assert(std::is_default_constructible<const int[1]>::value, "Error");
59static_assert(std::is_default_constructible<int[1][2]>::value, "Error");
60static_assert(std::is_default_constructible<const int[1][2]>::value, "Error");
61static_assert(std::is_default_constructible<FromArgs<>[1]>::value, "Error");
62static_assert(std::is_default_constructible<const FromArgs<>[1]>::value,
63 "Error");
64static_assert(std::is_default_constructible<U[1]>::value, "Error");
65static_assert(std::is_default_constructible<const U[1]>::value, "Error");
66static_assert(std::is_default_constructible<Empty[1]>::value, "Error");
67static_assert(std::is_default_constructible<const Empty[1]>::value, "Error");
68static_assert(std::is_default_constructible<Ellipsis[1]>::value, "Error");
69static_assert(std::is_default_constructible<const Ellipsis[1]>::value, "Error");
70static_assert(std::is_default_constructible<std::nullptr_t[1]>::value, "Error");
71static_assert(std::is_default_constructible<const std::nullptr_t[1]>::value,
72 "Error");
73static_assert(std::is_default_constructible<nAny[1]>::value, "Error");
74static_assert(std::is_default_constructible<const nAny[1]>::value, "Error");
75static_assert(std::is_default_constructible<E[1]>::value, "Error");
76static_assert(std::is_default_constructible<const E[1]>::value, "Error");
77static_assert(std::is_default_constructible<SE[1]>::value, "Error");
78static_assert(std::is_default_constructible<const SE[1]>::value, "Error");
79static_assert(std::is_default_constructible<OpE[1]>::value, "Error");
80static_assert(std::is_default_constructible<const OpE[1]>::value, "Error");
81static_assert(std::is_default_constructible<OpSE[1]>::value, "Error");
82static_assert(std::is_default_constructible<const OpSE[1]>::value, "Error");
83static_assert(std::is_default_constructible<int*[1]>::value, "Error");
84static_assert(std::is_default_constructible<int* const[1]>::value, "Error");
85static_assert(std::is_default_constructible<int B::*[1]>::value, "Error");
86static_assert(std::is_default_constructible<int B::* const[1]>::value, "Error");
87static_assert(std::is_default_constructible<std::initializer_list<int>>::value,
88 "Error");
89static_assert(std::is_default_constructible<const
90 std::initializer_list<int>>::value, "Error");
91static_assert(std::is_default_constructible<
92 std::initializer_list<int>[1]>::value, "Error");
93static_assert(std::is_default_constructible<const
94 std::initializer_list<int>[1]>::value, "Error");
95
65cee9bd
PC
96static_assert(std::is_default_constructible
97 <__gnu_test::NoexceptDefaultClass>::value, "Error");
98static_assert(std::is_default_constructible
99 <__gnu_test::ThrowDefaultClass>::value, "Error");
100static_assert(std::is_default_constructible
101 <__gnu_test::ExceptDefaultClass>::value, "Error");
102
123c516a
PC
103static_assert(!std::is_default_constructible<void>::value, "Error");
104static_assert(!std::is_default_constructible<const void>::value, "Error");
105static_assert(!std::is_default_constructible<Abstract>::value, "Error");
106static_assert(!std::is_default_constructible<const Abstract>::value, "Error");
107static_assert(!std::is_default_constructible<Any>::value, "Error");
108static_assert(!std::is_default_constructible<const Any>::value, "Error");
109static_assert(!std::is_default_constructible<FromArgs<int>>::value, "Error");
110static_assert(!std::is_default_constructible<const FromArgs<int>>::value,
111 "Error");
112static_assert(!std::is_default_constructible<int&>::value, "Error");
113static_assert(!std::is_default_constructible<int&&>::value, "Error");
114static_assert(!std::is_default_constructible<void()>::value, "Error");
115static_assert(!std::is_default_constructible<void() const volatile>::value,
116 "Error");
117static_assert(!std::is_default_constructible<void(&)()>::value, "Error");
118static_assert(!std::is_default_constructible<int(&)[1]>::value, "Error");
119static_assert(!std::is_default_constructible<int(&)[]>::value, "Error");
120static_assert(!std::is_default_constructible<int[]>::value, "Error");
121static_assert(!std::is_default_constructible<const int[]>::value, "Error");
122static_assert(!std::is_default_constructible<int[][1][2]>::value, "Error");
123static_assert(!std::is_default_constructible<const int[][1][2]>::value,
124 "Error");
125static_assert(!std::is_default_constructible<Any[1]>::value, "Error");
126static_assert(!std::is_default_constructible<const Any[1]>::value, "Error");
127static_assert(!std::is_default_constructible<FromArgs<int>[1]>::value, "Error");
128static_assert(!std::is_default_constructible<const FromArgs<int>[1]>::value,
129 "Error");
130static_assert(!std::is_default_constructible<
131 FromArgs<std::initializer_list<int>>>::value, "Error");
132static_assert(!std::is_default_constructible<const
133 FromArgs<std::initializer_list<int>>>::value, "Error");
134static_assert(!std::is_default_constructible<const
135 FromArgs<const std::initializer_list<int>>>::value, "Error");
136static_assert(!std::is_default_constructible<DelDef>::value, "Error");
137static_assert(!std::is_default_constructible<const DelDef>::value, "Error");
138static_assert(!std::is_default_constructible<DelCopy>::value, "Error");
139static_assert(!std::is_default_constructible<const DelCopy>::value, "Error");
140static_assert(!std::is_default_constructible<DelDtor>::value, "Error");
141static_assert(!std::is_default_constructible<const DelDtor>::value, "Error");