1 // Copyright (C) 2017-2021 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/>.
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.
49 #if __cplusplus >= 201103L
50 // <random> defines member functions called a() and b()
55 // <queue> and <stack> defined data members called c
56 #if __cplusplus <= 201703L
57 // <chrono> defines operator""d in C++20
59 // <numbers> defines std::numbers::e in C++20
64 #if __cplusplus >= 201402L
65 // <chrono> defines operator ""h in C++14
66 // <complex> defines operator ""i in C++14
72 #if __cplusplus >= 201103L
73 // <random> defines member functions called k()
78 #if __cplusplus >= 201103L
79 // <random> defines member functions called m() and n()
85 #if __cplusplus >= 201103L
86 // <random> defines member functions called p()
92 #if __cplusplus >= 201103L
93 // <random> defines member functions called s() and t()
94 // <chrono> and <string> define operator ""s in C++14
103 #if __cplusplus <= 201703L
104 // <chrono> defines operator""y in C++20
114 #if __cplusplus < 201103L
115 #define uses_allocator (
118 #if __cplusplus < 201402L
119 // <complex> defines operator""il
123 #if __cplusplus < 201703L
124 // <charconv> defines to_chars_result::ptr and to_chars_result::ec
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
199 // See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html
204 // <sys/var.h> defines vario::v
209 // inttypes.h: extern intmax_t imaxabs(intmax_t j);
218 #if defined (__linux__) && defined (__arm__)
219 // <sys/ucontext.h> defines fpregset_t::fpregs::j
223 #if defined (__linux__) && defined (__powerpc__)
224 // <asm/types.h> defines __vector128::u
228 #if defined (__linux__) && defined (__sparc__)
232 #if __has_include(<newlib.h>)
233 // newlib's <sys/cdefs.h> defines __lockable as a macro.
235 // newlib's <time.h> defines __tzrule_type with these members.
240 // newlib's <math.h> uses this for parameters
242 // newlib's <inttypes.h> uses this for parameters
247 // <fenv.h> defines these as members of fex_numeric_t
253 // See https://gcc.gnu.org/ml/libstdc++/2019-05/msg00175.html
255 // <sys/timespec_util.h> uses this as parameter
257 // <stdlib.h> uses this as member of drand48_data
263 #include <_vxworks-versions.h>
265 // Some VxWorks 6 or 7 headers are using those.
270 // arch/ppc/ffs/ArchLib.h
281 // VxWorks >= 7 specificities
283 #if _VXWORKS_MAJOR_GE(7)
285 // regs.h regs structure has a field 'r'
289 // in bootLib.h, bootParamCheck has parameters x, a-f
298 #endif // VxWorks Major >= 7
300 #endif // __VXWORKS__
304 // <stdlib.h> defines _CRT_FLOAT::f
306 // <stdlib.h> defines _CRT_DOUBLE::x and _LONGDOUBLE::x
308 // <math.h> defines _complex::x and _complex::y
312 #include <bits/stdc++.h>