Improve atomic store implementation on hppa-linux.
[official-gcc.git] / libstdc++-v3 / testsuite / 17_intro / names.cc
blob1341bed7a62aec34681129f48d428b97cfdc5bea
1 // Copyright (C) 2017-2021 Free Software Foundation, Inc.
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.
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-do compile }
19 // { dg-add-options no_pch }
21 // Define macros for some common variables names that we must not use for
22 // naming variables, parameters etc. in the library.
23 #define A (
24 #define B (
25 #define C (
26 #define D (
27 #define E (
28 #define F (
29 #define G (
30 #define H (
31 #define I (
32 #define J (
33 #define K (
34 #define L (
35 #define M (
36 #define N (
37 #define O (
38 #define P (
39 #define Q (
40 #define R (
41 #define S (
42 #define T (
43 #define U (
44 #define V (
45 #define W (
46 #define X (
47 #define Y (
48 #define Z (
49 #if __cplusplus >= 201103L
50 // <random> defines member functions called a() and b()
51 #else
52 #define a (
53 #define b (
54 #endif
55 // <queue> and <stack> defined data members called c
56 #if __cplusplus <= 201703L
57 // <chrono> defines operator""d in C++20
58 #define d (
59 // <numbers> defines std::numbers::e in C++20
60 #define e (
61 #endif
62 #define f (
63 #define g (
64 #if __cplusplus >= 201402L
65 // <chrono> defines operator ""h in C++14
66 // <complex> defines operator ""i in C++14
67 #else
68 #define h (
69 #define i (
70 #endif
71 #define j (
72 #if __cplusplus >= 201103L
73 // <random> defines member functions called k()
74 #else
75 #define k (
76 #endif
77 #define l (
78 #if __cplusplus >= 201103L
79 // <random> defines member functions called m() and n()
80 #else
81 #define m (
82 #define n (
83 #endif
84 #define o (
85 #if __cplusplus >= 201103L
86 // <random> defines member functions called p()
87 #else
88 #define p (
89 #endif
90 #define q (
91 #define r (
92 #if __cplusplus >= 201103L
93 // <random> defines member functions called s() and t()
94 // <chrono> and <string> define operator ""s in C++14
95 #else
96 #define s (
97 #define t (
98 #endif
99 #define u (
100 #define v (
101 #define w (
102 #define x (
103 #if __cplusplus <= 201703L
104 // <chrono> defines operator""y in C++20
105 #define y (
106 #endif
107 #define z (
109 #define func (
110 #define tmp (
111 #define sz (
112 #define token (
114 #if __cplusplus < 201103L
115 #define uses_allocator (
116 #endif
118 #if __cplusplus < 201402L
119 // <complex> defines operator""il
120 #define il (
121 #endif
123 #if __cplusplus < 201703L
124 // <charconv> defines to_chars_result::ptr and to_chars_result::ec
125 #define ec (
126 #define ptr (
127 #endif
129 // This clashes with newlib so don't use it.
130 # define __lockable cannot be used as an identifier
133 // Common template parameter names
134 #define OutputIterator OutputIterator is not a reserved name
135 #define InputIterator InputIterator is not a reserved name
136 #define ForwardIterator ForwardIterator is not a reserved name
137 #define BidirectionalIterator BidirectionalIterator is not a reserved name
138 #define RandomAccessIterator RandomAccessIterator is not a reserved name
139 #define RandomAccessOutputIterator RandomAccessOutputIterator is not a reserved name
140 #define RAI RAI is not a reserved name
141 #define RAIter RAIter is not a reserved name
142 #define FwdIter FwdIter is not a reserved name
143 #define OutIter OutIter is not a reserved name
144 #define InIter InIter is not a reserved name
146 #define Alloc Alloc is not a reserved name
147 #define BinaryFunction1 BinaryFunction1 is not a reserved name
148 #define BinaryFunction2 BinaryFunction2 is not a reserved name
149 #define Char Char is not a reserved name
150 #define CharT CharT is not a reserved name
151 #define Cmp Cmp is not a reserved name
152 #define Compare Compare is not a reserved name
153 #define Const_Iterator Const_Iterator is not a reserved name
154 #define Const_Key_Reference Const_Key_Reference is not a reserved name
155 #define Const_Node_Iter Const_Node_Iter is not a reserved name
156 #define Const_Pointer Const_Pointer is not a reserved name
157 #define Const_Reference Const_Reference is not a reserved name
158 #define Data Data is not a reserved name
159 #define DiffType DiffType is not a reserved name
160 #define Eq Eq is not a reserved name
161 #define ExecPolicy ExecPolicy is not a reserved name
162 #define Expected Expected is not a reserved name
163 #define External_Load_Access External_Load_Access is not a reserved name
164 #define External_Size_Access External_Size_Access is not a reserved name
165 #define Fn Fn is not a reserved name
166 #define Function Function is not a reserved name
167 #define Functor Functor is not a reserved name
168 #define Hash Hash is not a reserved name
169 #define H1 H1 is not a reserved name
170 #define H2 H2 is not a reserved name
171 #define Head Head is not a reserved name
172 #define It It is not a reserved name
173 #define Iter Iter is not a reserved name
174 #define Iterator Iterator is not a reserved name
175 #define Key Key is not a reserved name
176 #define Mapped Mapped is not a reserved name
177 #define Node Node is not a reserved name
178 #define Node_iter Node_iter is not a reserved name
179 #define Node_ptr Node_ptr is not a reserved name
180 #define Overflow Overflow is not a reserved name
181 #define Pointer Pointer is not a reserved name
182 #define Policy Policy is not a reserved name
183 #define Pred Pred is not a reserved name
184 #define Ptr Ptr is not a reserved name
185 #define Reference Reference is not a reserved name
186 #define Seq Seq is not a reserved name
187 #define Seq_RAIter Seq_RAIter is not a reserved name
188 #define Series Series is not a reserved name
189 #define Set Set is not a reserved name
190 #define String String is not a reserved name
191 #define Tp Tp is not a reserved name
192 #define Traits Traits is not a reserved name
193 #define Type Type is not a reserved name
194 #define Value Value is not a reserved name
195 #define ValueT ValueT is not a reserved name
196 #define ValueType ValueType is not a reserved name
198 #ifdef _AIX
199 // See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html
200 #undef f
201 #undef r
202 #undef x
203 #undef y
204 // <sys/var.h> defines vario::v
205 #undef v
206 #endif
208 #ifdef __APPLE__
209 // inttypes.h: extern intmax_t imaxabs(intmax_t j);
210 #undef j
211 #endif
213 #ifdef __hpux__
214 #undef d
215 #undef r
216 #endif
218 #if defined (__linux__) && defined (__arm__)
219 // <sys/ucontext.h> defines fpregset_t::fpregs::j
220 #undef j
221 #endif
223 #if defined (__linux__) && defined (__powerpc__)
224 // <asm/types.h> defines __vector128::u
225 #undef u
226 #endif
228 #if defined (__linux__) && defined (__sparc__)
229 #undef y
230 #endif
232 #if __has_include(<newlib.h>)
233 // newlib's <sys/cdefs.h> defines __lockable as a macro.
234 #undef __lockable
235 // newlib's <time.h> defines __tzrule_type with these members.
236 #undef d
237 #undef m
238 #undef n
239 #undef s
240 // newlib's <math.h> uses this for parameters
241 #undef x
242 // newlib's <inttypes.h> uses this for parameters
243 #undef j
244 #endif
246 #ifdef __sun__
247 // <fenv.h> defines these as members of fex_numeric_t
248 #undef l
249 #undef f
250 #undef d
251 #undef q
252 #undef p
253 // See https://gcc.gnu.org/ml/libstdc++/2019-05/msg00175.html
254 #undef ptr
255 // <sys/timespec_util.h> uses this as parameter
256 #undef r
257 // <stdlib.h> uses this as member of drand48_data
258 #undef x
259 #endif
261 #ifdef __VXWORKS__
263 #include <_vxworks-versions.h>
265 // Some VxWorks 6 or 7 headers are using those.
267 // private/objLibP.h
268 #undef u
270 // arch/ppc/ffs/ArchLib.h
271 #undef i
272 #undef j
274 // math.h
275 #undef x
276 #undef y
278 // stdio.h
279 #undef ptr
281 // VxWorks >= 7 specificities
283 #if _VXWORKS_MAJOR_GE(7)
285 // regs.h regs structure has a field 'r'
286 #undef r
288 #ifndef __RTP__
289 // in bootLib.h, bootParamCheck has parameters x, a-f
290 #undef a
291 #undef b
292 #undef c
293 #undef d
294 #undef e
295 #undef f
296 #endif // __RTP__
298 #endif // VxWorks Major >= 7
300 #endif // __VXWORKS__
302 #ifdef _WIN32
303 #undef Value
304 // <stdlib.h> defines _CRT_FLOAT::f
305 #undef f
306 // <stdlib.h> defines _CRT_DOUBLE::x and _LONGDOUBLE::x
307 #undef x
308 // <math.h> defines _complex::x and _complex::y
309 #undef y
310 #endif
312 #include <bits/stdc++.h>