]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/is_complete_or_unbounded/value.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / is_complete_or_unbounded / value.cc
CommitLineData
608a080c
AP
1// { dg-do compile { target c++11 } }
2
7adcbafe 3// Copyright (C) 2019-2022 Free Software Foundation, Inc.
608a080c
AP
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
22
23struct incomplete_type;
24class incomplete_type2;
25union incomplete_union;
26enum class incomplete_enum: int;
27enum incomplete_enum2: int;
28static_assert(!std::__is_complete_or_unbounded(std::__type_identity<incomplete_type>{}), "");
29static_assert(!std::__is_complete_or_unbounded(std::__type_identity<incomplete_type2>{}), "");
30static_assert(!std::__is_complete_or_unbounded(std::__type_identity<incomplete_union>{}), "");
31static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_enum>{}), "");
32static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_enum2>{}), "");
33
34static_assert(!std::__is_complete_or_unbounded(std::__type_identity<incomplete_type[42]>{}), "");
35static_assert(!std::__is_complete_or_unbounded(std::__type_identity<incomplete_type2[42]>{}), "");
36static_assert(!std::__is_complete_or_unbounded(std::__type_identity<incomplete_union[42]>{}), "");
37static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_enum[42]>{}), "");
38static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_enum2[42]>{}), "");
39
40static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_type[]>{}), "");
41static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_type2[]>{}), "");
42static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_union[]>{}), "");
43static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_enum[]>{}), "");
44static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_enum2[]>{}), "");
45
46
47struct complete_type{ ~complete_type() = delete; };
48class complete_type2{ int i; };
49union complete_union{};
50enum class complete_enum: int {};
51enum complete_enum2: int {};
52static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type>{}), "");
53static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type2>{}), "");
54static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_union>{}), "");
55static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_enum>{}), "");
56static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_enum2>{}), "");
57
58static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type[42]>{}), "");
59static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type2[42]>{}), "");
60static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_union[42]>{}), "");
61static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_enum[42]>{}), "");
62static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_enum2[42]>{}), "");
63
64static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type[]>{}), "");
65static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type2[]>{}), "");
66static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_union[]>{}), "");
67static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_enum[]>{}), "");
68static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_enum2[]>{}), "");
69
70
71static_assert(std::__is_complete_or_unbounded(std::__type_identity<const complete_type>{}), "");
72static_assert(std::__is_complete_or_unbounded(std::__type_identity<const complete_type2>{}), "");
73static_assert(std::__is_complete_or_unbounded(std::__type_identity<const complete_union>{}), "");
74static_assert(std::__is_complete_or_unbounded(std::__type_identity<const complete_enum>{}), "");
75static_assert(std::__is_complete_or_unbounded(std::__type_identity<const complete_enum2>{}), "");
76
77static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_type*>{}), "");
78static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type*>{}), "");
79static_assert(std::__is_complete_or_unbounded(std::__type_identity<const incomplete_type*>{}), "");
80static_assert(std::__is_complete_or_unbounded(std::__type_identity<const complete_type*>{}), "");
81static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_type&>{}), "");
82static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type&>{}), "");
83static_assert(std::__is_complete_or_unbounded(std::__type_identity<incomplete_type&&>{}), "");
84static_assert(std::__is_complete_or_unbounded(std::__type_identity<complete_type&&>{}), "");
85static_assert(std::__is_complete_or_unbounded(std::__type_identity<int complete_type::*>{}), "");
86static_assert(std::__is_complete_or_unbounded(std::__type_identity<int (complete_type::*)(int)>{}), "");
87static_assert(std::__is_complete_or_unbounded(std::__type_identity<int incomplete_type::*>{}), "");
88static_assert(std::__is_complete_or_unbounded(std::__type_identity<int (incomplete_type::*)(int)>{}), "");
89
90static_assert(std::__is_complete_or_unbounded(std::__type_identity<void(*)() noexcept>{}), "");
91static_assert(std::__is_complete_or_unbounded(std::__type_identity<void(...) noexcept>{}), "");
92static_assert(std::__is_complete_or_unbounded(std::__type_identity<void(&)(int)>{}), "");
93static_assert(std::__is_complete_or_unbounded(std::__type_identity<void(*)()>{}), "");
94static_assert(std::__is_complete_or_unbounded(std::__type_identity<void(incomplete_type)>{}), "");
95static_assert(std::__is_complete_or_unbounded(std::__type_identity<void(&)()>{}), "");
96
97static_assert(std::__is_complete_or_unbounded(std::__type_identity<std::nullptr_t>{}), "");
98static_assert(std::__is_complete_or_unbounded(std::__type_identity<void>{}), "");
99static_assert(std::__is_complete_or_unbounded(std::__type_identity<void*>{}), "");
100static_assert(std::__is_complete_or_unbounded(std::__type_identity<const void* const>{}), "");