]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/std/concepts/concepts.lang/concept.arithmetic/floating_point.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-options "-std=gnu++2a" }
19 // { dg-do compile { target c++2a } }
23 static_assert( std::floating_point
<float> );
24 static_assert( std::floating_point
<double> );
25 static_assert( std::floating_point
<long double> );
26 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
27 static_assert( std::floating_point
<__float128
> );
30 static_assert( !std::floating_point
<char> );
31 static_assert( !std::floating_point
<signed char> );
32 static_assert( !std::floating_point
<bool> );
33 static_assert( !std::floating_point
<int> );
34 static_assert( !std::floating_point
<char32_t
> );
36 #ifdef __GLIBCXX_TYPE_INT_N_0
37 static_assert( !std::floating_point
<signed __GLIBCXX_TYPE_INT_N_0
> );
40 static_assert( !std::floating_point
<void> );
41 static_assert( !std::floating_point
<float*> );
42 static_assert( !std::floating_point
<float&> );
43 static_assert( !std::floating_point
<float&&> );
44 static_assert( !std::floating_point
<const float&> );
45 static_assert( !std::floating_point
<float[]> );
46 static_assert( !std::floating_point
<float[2]> );
47 static_assert( !std::floating_point
<float()> );
48 static_assert( !std::floating_point
<float(*)()> );
49 static_assert( !std::floating_point
<float(&)()> );
52 static_assert( !std::floating_point
<E
> );
54 static_assert( !std::floating_point
<CE
> );
56 static_assert( !std::floating_point
<A
> );
58 static_assert( !std::floating_point
<B
> );