annotate libstdc++-v3/testsuite/17_intro/freestanding.cc @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-options "-lsupc++ -fvtable-verify=none" }
kono
parents:
diff changeset
2 // { dg-do run { target c++11 } }
kono
parents:
diff changeset
3
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
4 // Copyright (C) 2010-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
5 //
kono
parents:
diff changeset
6 // This file is part of the GNU ISO C++ Library. This library is free
kono
parents:
diff changeset
7 // software; you can redistribute it and/or modify it under the
kono
parents:
diff changeset
8 // terms of the GNU General Public License as published by the
kono
parents:
diff changeset
9 // Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
10 // any later version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 // This library is distributed in the hope that it will be useful,
kono
parents:
diff changeset
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
15 // GNU General Public License for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 // You should have received a copy of the GNU General Public License along
kono
parents:
diff changeset
18 // with this library; see the file COPYING3. If not see
kono
parents:
diff changeset
19 // <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 #include <cstdarg>
kono
parents:
diff changeset
22 #include <cstddef>
kono
parents:
diff changeset
23 #include <cstdlib>
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 #include <exception>
kono
parents:
diff changeset
26 #include <limits>
kono
parents:
diff changeset
27 #include <new>
kono
parents:
diff changeset
28 #include <typeinfo>
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 #include <initializer_list>
kono
parents:
diff changeset
31 #include <type_traits>
kono
parents:
diff changeset
32
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
33 // C++2a headers:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
34 #include <bit>
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
35 #include <version>
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
36
111
kono
parents:
diff changeset
37 int main()
kono
parents:
diff changeset
38 {
kono
parents:
diff changeset
39 std::exception e;
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 const char* str __attribute__((unused)) = typeid(e).name();
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 typedef std::numeric_limits<long> limit_type;
kono
parents:
diff changeset
44 limit_type limit_l __attribute__((unused));
kono
parents:
diff changeset
45 int r __attribute__((unused)) = limit_type::radix;
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 const char* cp = new char;
kono
parents:
diff changeset
48 delete cp;
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 bool b __attribute__((unused)) = std::is_integral<int>::value;
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 std::initializer_list<int> ilisti __attribute__((unused));
kono
parents:
diff changeset
53
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
54 #if __cplusplus > 201703L
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
55 static_assert( std::ispow2(256u) );
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
56 static_assert( __cpp_lib_void_t >= 201411L );
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
57 #endif
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
58
111
kono
parents:
diff changeset
59 return 0;
kono
parents:
diff changeset
60 }