]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/std/concepts/concepts.lang/concept.arithmetic/integral.cc
1 // Copyright (C) 2019-2023 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do compile { target c++20 } }
22 // signed integer types
23 static_assert( std::integral
<signed char> );
24 static_assert( std::integral
<signed short> );
25 static_assert( std::integral
<signed int> );
26 static_assert( std::integral
<signed long> );
27 static_assert( std::integral
<signed long long> );
29 // unsigned integer types
30 static_assert( std::integral
<unsigned char> );
31 static_assert( std::integral
<unsigned short> );
32 static_assert( std::integral
<unsigned int> );
33 static_assert( std::integral
<unsigned long> );
34 static_assert( std::integral
<unsigned long long> );
36 // other integral types
37 static_assert( std::integral
<bool> );
38 static_assert( std::integral
<char> );
39 static_assert( std::integral
<char16_t
> );
40 static_assert( std::integral
<char32_t
> );
41 static_assert( std::integral
<wchar_t> );
42 #ifdef _GLIBCXX_USE_CHAR8_T
43 static_assert( std::integral
<char8_t
> );
46 #ifdef __GLIBCXX_TYPE_INT_N_0
47 static_assert( std::integral
<signed __GLIBCXX_TYPE_INT_N_0
> );
48 static_assert( std::integral
<unsigned __GLIBCXX_TYPE_INT_N_0
> );
51 static_assert( !std::integral
<void> );
52 static_assert( !std::integral
<float> );
53 static_assert( !std::integral
<int*> );
54 static_assert( !std::integral
<int&> );
55 static_assert( !std::integral
<int&&> );
56 static_assert( !std::integral
<const int&> );
57 static_assert( !std::integral
<int[]> );
58 static_assert( !std::integral
<int[2]> );
59 static_assert( !std::integral
<int()> );
60 static_assert( !std::integral
<int(*)()> );
61 static_assert( !std::integral
<int(&)()> );
64 static_assert( !std::integral
<E
> );
66 static_assert( !std::integral
<CE
> );
68 static_assert( !std::integral
<A
> );
70 static_assert( !std::integral
<B
> );