1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // WARNING: This test was generated by generate_feature_test_macro_components.py
10 // and should not be edited manually.
11 //
12 // clang-format off
13 
14 // <utility>
15 
16 // Test the feature test macros defined by <utility>
17 
18 /*  Constant                                  Value
19     __cpp_lib_as_const                        201510L [C++17]
20     __cpp_lib_constexpr_utility               201811L [C++20]
21     __cpp_lib_exchange_function               201304L [C++14]
22     __cpp_lib_integer_comparison_functions    202002L [C++20]
23     __cpp_lib_integer_sequence                201304L [C++14]
24     __cpp_lib_ranges_zip                      202110L [C++2b]
25     __cpp_lib_to_underlying                   202102L [C++2b]
26     __cpp_lib_tuples_by_type                  201304L [C++14]
27     __cpp_lib_unreachable                     202202L [C++2b]
28 */
29 
30 #include <utility>
31 #include "test_macros.h"
32 
33 #if TEST_STD_VER < 14
34 
35 # ifdef __cpp_lib_as_const
36 #   error "__cpp_lib_as_const should not be defined before c++17"
37 # endif
38 
39 # ifdef __cpp_lib_constexpr_utility
40 #   error "__cpp_lib_constexpr_utility should not be defined before c++20"
41 # endif
42 
43 # ifdef __cpp_lib_exchange_function
44 #   error "__cpp_lib_exchange_function should not be defined before c++14"
45 # endif
46 
47 # ifdef __cpp_lib_integer_comparison_functions
48 #   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
49 # endif
50 
51 # ifdef __cpp_lib_integer_sequence
52 #   error "__cpp_lib_integer_sequence should not be defined before c++14"
53 # endif
54 
55 # ifdef __cpp_lib_ranges_zip
56 #   error "__cpp_lib_ranges_zip should not be defined before c++2b"
57 # endif
58 
59 # ifdef __cpp_lib_to_underlying
60 #   error "__cpp_lib_to_underlying should not be defined before c++2b"
61 # endif
62 
63 # ifdef __cpp_lib_tuples_by_type
64 #   error "__cpp_lib_tuples_by_type should not be defined before c++14"
65 # endif
66 
67 # ifdef __cpp_lib_unreachable
68 #   error "__cpp_lib_unreachable should not be defined before c++2b"
69 # endif
70 
71 #elif TEST_STD_VER == 14
72 
73 # ifdef __cpp_lib_as_const
74 #   error "__cpp_lib_as_const should not be defined before c++17"
75 # endif
76 
77 # ifdef __cpp_lib_constexpr_utility
78 #   error "__cpp_lib_constexpr_utility should not be defined before c++20"
79 # endif
80 
81 # ifndef __cpp_lib_exchange_function
82 #   error "__cpp_lib_exchange_function should be defined in c++14"
83 # endif
84 # if __cpp_lib_exchange_function != 201304L
85 #   error "__cpp_lib_exchange_function should have the value 201304L in c++14"
86 # endif
87 
88 # ifdef __cpp_lib_integer_comparison_functions
89 #   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
90 # endif
91 
92 # ifndef __cpp_lib_integer_sequence
93 #   error "__cpp_lib_integer_sequence should be defined in c++14"
94 # endif
95 # if __cpp_lib_integer_sequence != 201304L
96 #   error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
97 # endif
98 
99 # ifdef __cpp_lib_ranges_zip
100 #   error "__cpp_lib_ranges_zip should not be defined before c++2b"
101 # endif
102 
103 # ifdef __cpp_lib_to_underlying
104 #   error "__cpp_lib_to_underlying should not be defined before c++2b"
105 # endif
106 
107 # ifndef __cpp_lib_tuples_by_type
108 #   error "__cpp_lib_tuples_by_type should be defined in c++14"
109 # endif
110 # if __cpp_lib_tuples_by_type != 201304L
111 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
112 # endif
113 
114 # ifdef __cpp_lib_unreachable
115 #   error "__cpp_lib_unreachable should not be defined before c++2b"
116 # endif
117 
118 #elif TEST_STD_VER == 17
119 
120 # ifndef __cpp_lib_as_const
121 #   error "__cpp_lib_as_const should be defined in c++17"
122 # endif
123 # if __cpp_lib_as_const != 201510L
124 #   error "__cpp_lib_as_const should have the value 201510L in c++17"
125 # endif
126 
127 # ifdef __cpp_lib_constexpr_utility
128 #   error "__cpp_lib_constexpr_utility should not be defined before c++20"
129 # endif
130 
131 # ifndef __cpp_lib_exchange_function
132 #   error "__cpp_lib_exchange_function should be defined in c++17"
133 # endif
134 # if __cpp_lib_exchange_function != 201304L
135 #   error "__cpp_lib_exchange_function should have the value 201304L in c++17"
136 # endif
137 
138 # ifdef __cpp_lib_integer_comparison_functions
139 #   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
140 # endif
141 
142 # ifndef __cpp_lib_integer_sequence
143 #   error "__cpp_lib_integer_sequence should be defined in c++17"
144 # endif
145 # if __cpp_lib_integer_sequence != 201304L
146 #   error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
147 # endif
148 
149 # ifdef __cpp_lib_ranges_zip
150 #   error "__cpp_lib_ranges_zip should not be defined before c++2b"
151 # endif
152 
153 # ifdef __cpp_lib_to_underlying
154 #   error "__cpp_lib_to_underlying should not be defined before c++2b"
155 # endif
156 
157 # ifndef __cpp_lib_tuples_by_type
158 #   error "__cpp_lib_tuples_by_type should be defined in c++17"
159 # endif
160 # if __cpp_lib_tuples_by_type != 201304L
161 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
162 # endif
163 
164 # ifdef __cpp_lib_unreachable
165 #   error "__cpp_lib_unreachable should not be defined before c++2b"
166 # endif
167 
168 #elif TEST_STD_VER == 20
169 
170 # ifndef __cpp_lib_as_const
171 #   error "__cpp_lib_as_const should be defined in c++20"
172 # endif
173 # if __cpp_lib_as_const != 201510L
174 #   error "__cpp_lib_as_const should have the value 201510L in c++20"
175 # endif
176 
177 # ifndef __cpp_lib_constexpr_utility
178 #   error "__cpp_lib_constexpr_utility should be defined in c++20"
179 # endif
180 # if __cpp_lib_constexpr_utility != 201811L
181 #   error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"
182 # endif
183 
184 # ifndef __cpp_lib_exchange_function
185 #   error "__cpp_lib_exchange_function should be defined in c++20"
186 # endif
187 # if __cpp_lib_exchange_function != 201304L
188 #   error "__cpp_lib_exchange_function should have the value 201304L in c++20"
189 # endif
190 
191 # ifndef __cpp_lib_integer_comparison_functions
192 #   error "__cpp_lib_integer_comparison_functions should be defined in c++20"
193 # endif
194 # if __cpp_lib_integer_comparison_functions != 202002L
195 #   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20"
196 # endif
197 
198 # ifndef __cpp_lib_integer_sequence
199 #   error "__cpp_lib_integer_sequence should be defined in c++20"
200 # endif
201 # if __cpp_lib_integer_sequence != 201304L
202 #   error "__cpp_lib_integer_sequence should have the value 201304L in c++20"
203 # endif
204 
205 # ifdef __cpp_lib_ranges_zip
206 #   error "__cpp_lib_ranges_zip should not be defined before c++2b"
207 # endif
208 
209 # ifdef __cpp_lib_to_underlying
210 #   error "__cpp_lib_to_underlying should not be defined before c++2b"
211 # endif
212 
213 # ifndef __cpp_lib_tuples_by_type
214 #   error "__cpp_lib_tuples_by_type should be defined in c++20"
215 # endif
216 # if __cpp_lib_tuples_by_type != 201304L
217 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
218 # endif
219 
220 # ifdef __cpp_lib_unreachable
221 #   error "__cpp_lib_unreachable should not be defined before c++2b"
222 # endif
223 
224 #elif TEST_STD_VER > 20
225 
226 # ifndef __cpp_lib_as_const
227 #   error "__cpp_lib_as_const should be defined in c++2b"
228 # endif
229 # if __cpp_lib_as_const != 201510L
230 #   error "__cpp_lib_as_const should have the value 201510L in c++2b"
231 # endif
232 
233 # ifndef __cpp_lib_constexpr_utility
234 #   error "__cpp_lib_constexpr_utility should be defined in c++2b"
235 # endif
236 # if __cpp_lib_constexpr_utility != 201811L
237 #   error "__cpp_lib_constexpr_utility should have the value 201811L in c++2b"
238 # endif
239 
240 # ifndef __cpp_lib_exchange_function
241 #   error "__cpp_lib_exchange_function should be defined in c++2b"
242 # endif
243 # if __cpp_lib_exchange_function != 201304L
244 #   error "__cpp_lib_exchange_function should have the value 201304L in c++2b"
245 # endif
246 
247 # ifndef __cpp_lib_integer_comparison_functions
248 #   error "__cpp_lib_integer_comparison_functions should be defined in c++2b"
249 # endif
250 # if __cpp_lib_integer_comparison_functions != 202002L
251 #   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++2b"
252 # endif
253 
254 # ifndef __cpp_lib_integer_sequence
255 #   error "__cpp_lib_integer_sequence should be defined in c++2b"
256 # endif
257 # if __cpp_lib_integer_sequence != 201304L
258 #   error "__cpp_lib_integer_sequence should have the value 201304L in c++2b"
259 # endif
260 
261 # if !defined(_LIBCPP_VERSION)
262 #   ifndef __cpp_lib_ranges_zip
263 #     error "__cpp_lib_ranges_zip should be defined in c++2b"
264 #   endif
265 #   if __cpp_lib_ranges_zip != 202110L
266 #     error "__cpp_lib_ranges_zip should have the value 202110L in c++2b"
267 #   endif
268 # else // _LIBCPP_VERSION
269 #   ifdef __cpp_lib_ranges_zip
270 #     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
271 #   endif
272 # endif
273 
274 # ifndef __cpp_lib_to_underlying
275 #   error "__cpp_lib_to_underlying should be defined in c++2b"
276 # endif
277 # if __cpp_lib_to_underlying != 202102L
278 #   error "__cpp_lib_to_underlying should have the value 202102L in c++2b"
279 # endif
280 
281 # ifndef __cpp_lib_tuples_by_type
282 #   error "__cpp_lib_tuples_by_type should be defined in c++2b"
283 # endif
284 # if __cpp_lib_tuples_by_type != 201304L
285 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++2b"
286 # endif
287 
288 # ifndef __cpp_lib_unreachable
289 #   error "__cpp_lib_unreachable should be defined in c++2b"
290 # endif
291 # if __cpp_lib_unreachable != 202202L
292 #   error "__cpp_lib_unreachable should have the value 202202L in c++2b"
293 # endif
294 
295 #endif // TEST_STD_VER > 20
296 
297