]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/std/concepts/concepts.lang/concept.arithmetic/integral.cc
1 // Copyright (C) 2019-2021 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-options "-std=gnu++2a" }
19 // { dg-do compile { target c++2a } }
23 // signed integer types
24 static_assert( std::integral
<signed char> );
25 static_assert( std::integral
<signed short> );
26 static_assert( std::integral
<signed int> );
27 static_assert( std::integral
<signed long> );
28 static_assert( std::integral
<signed long long> );
30 // unsigned integer types
31 static_assert( std::integral
<unsigned char> );
32 static_assert( std::integral
<unsigned short> );
33 static_assert( std::integral
<unsigned int> );
34 static_assert( std::integral
<unsigned long> );
35 static_assert( std::integral
<unsigned long long> );
37 // other integral types
38 static_assert( std::integral
<bool> );
39 static_assert( std::integral
<char> );
40 static_assert( std::integral
<char16_t
> );
41 static_assert( std::integral
<char32_t
> );
42 static_assert( std::integral
<wchar_t> );
43 #ifdef _GLIBCXX_USE_CHAR8_T
44 static_assert( std::integral
<char8_t
> );
47 #ifdef __GLIBCXX_TYPE_INT_N_0
48 static_assert( std::integral
<signed __GLIBCXX_TYPE_INT_N_0
> );
49 static_assert( std::integral
<unsigned __GLIBCXX_TYPE_INT_N_0
> );
52 static_assert( !std::integral
<void> );
53 static_assert( !std::integral
<float> );
54 static_assert( !std::integral
<int*> );
55 static_assert( !std::integral
<int&> );
56 static_assert( !std::integral
<int&&> );
57 static_assert( !std::integral
<const int&> );
58 static_assert( !std::integral
<int[]> );
59 static_assert( !std::integral
<int[2]> );
60 static_assert( !std::integral
<int()> );
61 static_assert( !std::integral
<int(*)()> );
62 static_assert( !std::integral
<int(&)()> );
65 static_assert( !std::integral
<E
> );
67 static_assert( !std::integral
<CE
> );
69 static_assert( !std::integral
<A
> );
71 static_assert( !std::integral
<B
> );