]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/std/concepts/concepts.lang/concept.arithmetic/floating_point.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / std / concepts / concepts.lang / concept.arithmetic / floating_point.cc
CommitLineData
99dee823 1// Copyright (C) 2019-2021 Free Software Foundation, Inc.
cfc219ae
JW
2//
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)
7// any later version.
8
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.
13
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/>.
17
18// { dg-options "-std=gnu++2a" }
19// { dg-do compile { target c++2a } }
20
21#include <concepts>
22
23static_assert( std::floating_point<float> );
24static_assert( std::floating_point<double> );
25static_assert( std::floating_point<long double> );
dc8c0096 26#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
cfc219ae
JW
27static_assert( std::floating_point<__float128> );
28#endif
29
30static_assert( !std::floating_point<char> );
31static_assert( !std::floating_point<signed char> );
32static_assert( !std::floating_point<bool> );
33static_assert( !std::floating_point<int> );
34static_assert( !std::floating_point<char32_t> );
35
36#ifdef __GLIBCXX_TYPE_INT_N_0
37static_assert( !std::floating_point<signed __GLIBCXX_TYPE_INT_N_0> );
38#endif
39
40static_assert( !std::floating_point<void> );
41static_assert( !std::floating_point<float*> );
42static_assert( !std::floating_point<float&> );
43static_assert( !std::floating_point<float&&> );
44static_assert( !std::floating_point<const float&> );
45static_assert( !std::floating_point<float[]> );
46static_assert( !std::floating_point<float[2]> );
47static_assert( !std::floating_point<float()> );
48static_assert( !std::floating_point<float(*)()> );
49static_assert( !std::floating_point<float(&)()> );
50
51enum E { };
52static_assert( !std::floating_point<E> );
53enum class CE { };
54static_assert( !std::floating_point<CE> );
55struct A { };
56static_assert( !std::floating_point<A> );
57union B { };
58static_assert( !std::floating_point<B> );