OSDN Git Service

d5f3b3f3926e78c0b6a9eb432bf68e2616bd37bf
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / 18_support / numeric_limits / requirements / constexpr_data.cc
1 // { dg-do compile }
2 // { dg-options "-std=gnu++0x" }
3
4 // Copyright (C) 2010 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library.  This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3.  If not see
19 // <http://www.gnu.org/licenses/>.
20
21 #include <limits>
22 #include <testsuite_common_types.h>
23
24 namespace __gnu_test
25 {
26   struct constexpr_member_data
27   {
28     template<typename _Ttesttype>
29       void
30       operator()()
31       {
32         struct _Concept
33         {
34           void __constraint()
35           { 
36             using std::float_denorm_style;
37             using std::float_round_style;
38             constexpr bool v1(_Ttesttype::is_specialized);
39             constexpr int v2(_Ttesttype::digits);
40             constexpr int v3(_Ttesttype::digits10);
41             constexpr int v4(_Ttesttype::max_digits10);
42             constexpr bool v5(_Ttesttype::is_signed);
43             constexpr bool v6(_Ttesttype::is_integer);
44             constexpr bool v7(_Ttesttype::is_exact);
45             constexpr int v8(_Ttesttype::radix);
46             constexpr int v9(_Ttesttype::min_exponent);
47             constexpr int v10(_Ttesttype::min_exponent10);
48             constexpr int v11(_Ttesttype::max_exponent);
49             constexpr int v12(_Ttesttype::max_exponent10);
50             constexpr bool v13(_Ttesttype::has_infinity);
51             constexpr bool v14(_Ttesttype::has_quiet_NaN);
52             constexpr bool v15(_Ttesttype::has_signaling_NaN);
53             constexpr float_denorm_style v16(_Ttesttype::has_denorm);
54             constexpr bool v17(_Ttesttype::has_denorm_loss);
55             constexpr bool v18(_Ttesttype::is_iec559);
56             constexpr bool v19(_Ttesttype::is_bounded);
57             constexpr bool v20(_Ttesttype::is_modulo);
58             constexpr bool v21(_Ttesttype::traps);
59             constexpr bool v22(_Ttesttype::tinyness_before);
60             constexpr float_round_style v23(_Ttesttype::round_style);
61           }
62         };
63
64         _Concept c;
65         c.__constraint();
66       }
67   };
68 }
69
70 int main()
71 {
72   __gnu_test::constexpr_member_data test;
73   __gnu_cxx::typelist::apply_generator(test, __gnu_test::limits_tl());
74   return 0;
75 }