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// <utility>
13
14// Test the feature test macros defined by <utility>
15
16// clang-format off
17
18#include <utility>
19#include "test_macros.h"
20
21#if TEST_STD_VER < 14
22
23# ifdef __cpp_lib_as_const
24# error "__cpp_lib_as_const should not be defined before c++17"
25# endif
26
27# ifdef __cpp_lib_constexpr_algorithms
28# error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
29# endif
30
31# ifdef __cpp_lib_constexpr_utility
32# error "__cpp_lib_constexpr_utility should not be defined before c++20"
33# endif
34
35# ifdef __cpp_lib_constrained_equality
36# error "__cpp_lib_constrained_equality should not be defined before c++26"
37# endif
38
39# ifdef __cpp_lib_exchange_function
40# error "__cpp_lib_exchange_function should not be defined before c++14"
41# endif
42
43# ifdef __cpp_lib_forward_like
44# error "__cpp_lib_forward_like should not be defined before c++23"
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++23"
57# endif
58
59# ifdef __cpp_lib_to_underlying
60# error "__cpp_lib_to_underlying should not be defined before c++23"
61# endif
62
63# ifdef __cpp_lib_tuple_like
64# error "__cpp_lib_tuple_like should not be defined before c++23"
65# endif
66
67# ifdef __cpp_lib_tuples_by_type
68# error "__cpp_lib_tuples_by_type should not be defined before c++14"
69# endif
70
71# ifdef __cpp_lib_unreachable
72# error "__cpp_lib_unreachable should not be defined before c++23"
73# endif
74
75#elif TEST_STD_VER == 14
76
77# ifdef __cpp_lib_as_const
78# error "__cpp_lib_as_const should not be defined before c++17"
79# endif
80
81# ifdef __cpp_lib_constexpr_algorithms
82# error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
83# endif
84
85# ifdef __cpp_lib_constexpr_utility
86# error "__cpp_lib_constexpr_utility should not be defined before c++20"
87# endif
88
89# ifdef __cpp_lib_constrained_equality
90# error "__cpp_lib_constrained_equality should not be defined before c++26"
91# endif
92
93# ifndef __cpp_lib_exchange_function
94# error "__cpp_lib_exchange_function should be defined in c++14"
95# endif
96# if __cpp_lib_exchange_function != 201304L
97# error "__cpp_lib_exchange_function should have the value 201304L in c++14"
98# endif
99
100# ifdef __cpp_lib_forward_like
101# error "__cpp_lib_forward_like should not be defined before c++23"
102# endif
103
104# ifdef __cpp_lib_integer_comparison_functions
105# error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
106# endif
107
108# ifndef __cpp_lib_integer_sequence
109# error "__cpp_lib_integer_sequence should be defined in c++14"
110# endif
111# if __cpp_lib_integer_sequence != 201304L
112# error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
113# endif
114
115# ifdef __cpp_lib_ranges_zip
116# error "__cpp_lib_ranges_zip should not be defined before c++23"
117# endif
118
119# ifdef __cpp_lib_to_underlying
120# error "__cpp_lib_to_underlying should not be defined before c++23"
121# endif
122
123# ifdef __cpp_lib_tuple_like
124# error "__cpp_lib_tuple_like should not be defined before c++23"
125# endif
126
127# ifndef __cpp_lib_tuples_by_type
128# error "__cpp_lib_tuples_by_type should be defined in c++14"
129# endif
130# if __cpp_lib_tuples_by_type != 201304L
131# error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
132# endif
133
134# ifdef __cpp_lib_unreachable
135# error "__cpp_lib_unreachable should not be defined before c++23"
136# endif
137
138#elif TEST_STD_VER == 17
139
140# ifndef __cpp_lib_as_const
141# error "__cpp_lib_as_const should be defined in c++17"
142# endif
143# if __cpp_lib_as_const != 201510L
144# error "__cpp_lib_as_const should have the value 201510L in c++17"
145# endif
146
147# ifdef __cpp_lib_constexpr_algorithms
148# error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
149# endif
150
151# ifdef __cpp_lib_constexpr_utility
152# error "__cpp_lib_constexpr_utility should not be defined before c++20"
153# endif
154
155# ifdef __cpp_lib_constrained_equality
156# error "__cpp_lib_constrained_equality should not be defined before c++26"
157# endif
158
159# ifndef __cpp_lib_exchange_function
160# error "__cpp_lib_exchange_function should be defined in c++17"
161# endif
162# if __cpp_lib_exchange_function != 201304L
163# error "__cpp_lib_exchange_function should have the value 201304L in c++17"
164# endif
165
166# ifdef __cpp_lib_forward_like
167# error "__cpp_lib_forward_like should not be defined before c++23"
168# endif
169
170# ifdef __cpp_lib_integer_comparison_functions
171# error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
172# endif
173
174# ifndef __cpp_lib_integer_sequence
175# error "__cpp_lib_integer_sequence should be defined in c++17"
176# endif
177# if __cpp_lib_integer_sequence != 201304L
178# error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
179# endif
180
181# ifdef __cpp_lib_ranges_zip
182# error "__cpp_lib_ranges_zip should not be defined before c++23"
183# endif
184
185# ifdef __cpp_lib_to_underlying
186# error "__cpp_lib_to_underlying should not be defined before c++23"
187# endif
188
189# ifdef __cpp_lib_tuple_like
190# error "__cpp_lib_tuple_like should not be defined before c++23"
191# endif
192
193# ifndef __cpp_lib_tuples_by_type
194# error "__cpp_lib_tuples_by_type should be defined in c++17"
195# endif
196# if __cpp_lib_tuples_by_type != 201304L
197# error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
198# endif
199
200# ifdef __cpp_lib_unreachable
201# error "__cpp_lib_unreachable should not be defined before c++23"
202# endif
203
204#elif TEST_STD_VER == 20
205
206# ifndef __cpp_lib_as_const
207# error "__cpp_lib_as_const should be defined in c++20"
208# endif
209# if __cpp_lib_as_const != 201510L
210# error "__cpp_lib_as_const should have the value 201510L in c++20"
211# endif
212
213# ifndef __cpp_lib_constexpr_algorithms
214# error "__cpp_lib_constexpr_algorithms should be defined in c++20"
215# endif
216# if __cpp_lib_constexpr_algorithms != 201806L
217# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
218# endif
219
220# ifndef __cpp_lib_constexpr_utility
221# error "__cpp_lib_constexpr_utility should be defined in c++20"
222# endif
223# if __cpp_lib_constexpr_utility != 201811L
224# error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"
225# endif
226
227# ifdef __cpp_lib_constrained_equality
228# error "__cpp_lib_constrained_equality should not be defined before c++26"
229# endif
230
231# ifndef __cpp_lib_exchange_function
232# error "__cpp_lib_exchange_function should be defined in c++20"
233# endif
234# if __cpp_lib_exchange_function != 201304L
235# error "__cpp_lib_exchange_function should have the value 201304L in c++20"
236# endif
237
238# ifdef __cpp_lib_forward_like
239# error "__cpp_lib_forward_like should not be defined before c++23"
240# endif
241
242# ifndef __cpp_lib_integer_comparison_functions
243# error "__cpp_lib_integer_comparison_functions should be defined in c++20"
244# endif
245# if __cpp_lib_integer_comparison_functions != 202002L
246# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20"
247# endif
248
249# ifndef __cpp_lib_integer_sequence
250# error "__cpp_lib_integer_sequence should be defined in c++20"
251# endif
252# if __cpp_lib_integer_sequence != 201304L
253# error "__cpp_lib_integer_sequence should have the value 201304L in c++20"
254# endif
255
256# ifdef __cpp_lib_ranges_zip
257# error "__cpp_lib_ranges_zip should not be defined before c++23"
258# endif
259
260# ifdef __cpp_lib_to_underlying
261# error "__cpp_lib_to_underlying should not be defined before c++23"
262# endif
263
264# ifdef __cpp_lib_tuple_like
265# error "__cpp_lib_tuple_like should not be defined before c++23"
266# endif
267
268# ifndef __cpp_lib_tuples_by_type
269# error "__cpp_lib_tuples_by_type should be defined in c++20"
270# endif
271# if __cpp_lib_tuples_by_type != 201304L
272# error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
273# endif
274
275# ifdef __cpp_lib_unreachable
276# error "__cpp_lib_unreachable should not be defined before c++23"
277# endif
278
279#elif TEST_STD_VER == 23
280
281# ifndef __cpp_lib_as_const
282# error "__cpp_lib_as_const should be defined in c++23"
283# endif
284# if __cpp_lib_as_const != 201510L
285# error "__cpp_lib_as_const should have the value 201510L in c++23"
286# endif
287
288# ifndef __cpp_lib_constexpr_algorithms
289# error "__cpp_lib_constexpr_algorithms should be defined in c++23"
290# endif
291# if __cpp_lib_constexpr_algorithms != 201806L
292# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
293# endif
294
295# ifndef __cpp_lib_constexpr_utility
296# error "__cpp_lib_constexpr_utility should be defined in c++23"
297# endif
298# if __cpp_lib_constexpr_utility != 201811L
299# error "__cpp_lib_constexpr_utility should have the value 201811L in c++23"
300# endif
301
302# ifdef __cpp_lib_constrained_equality
303# error "__cpp_lib_constrained_equality should not be defined before c++26"
304# endif
305
306# ifndef __cpp_lib_exchange_function
307# error "__cpp_lib_exchange_function should be defined in c++23"
308# endif
309# if __cpp_lib_exchange_function != 201304L
310# error "__cpp_lib_exchange_function should have the value 201304L in c++23"
311# endif
312
313# ifndef __cpp_lib_forward_like
314# error "__cpp_lib_forward_like should be defined in c++23"
315# endif
316# if __cpp_lib_forward_like != 202207L
317# error "__cpp_lib_forward_like should have the value 202207L in c++23"
318# endif
319
320# ifndef __cpp_lib_integer_comparison_functions
321# error "__cpp_lib_integer_comparison_functions should be defined in c++23"
322# endif
323# if __cpp_lib_integer_comparison_functions != 202002L
324# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++23"
325# endif
326
327# ifndef __cpp_lib_integer_sequence
328# error "__cpp_lib_integer_sequence should be defined in c++23"
329# endif
330# if __cpp_lib_integer_sequence != 201304L
331# error "__cpp_lib_integer_sequence should have the value 201304L in c++23"
332# endif
333
334# if !defined(_LIBCPP_VERSION)
335# ifndef __cpp_lib_ranges_zip
336# error "__cpp_lib_ranges_zip should be defined in c++23"
337# endif
338# if __cpp_lib_ranges_zip != 202110L
339# error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
340# endif
341# else
342# ifdef __cpp_lib_ranges_zip
343# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
344# endif
345# endif
346
347# ifndef __cpp_lib_to_underlying
348# error "__cpp_lib_to_underlying should be defined in c++23"
349# endif
350# if __cpp_lib_to_underlying != 202102L
351# error "__cpp_lib_to_underlying should have the value 202102L in c++23"
352# endif
353
354# if !defined(_LIBCPP_VERSION)
355# ifndef __cpp_lib_tuple_like
356# error "__cpp_lib_tuple_like should be defined in c++23"
357# endif
358# if __cpp_lib_tuple_like != 202207L
359# error "__cpp_lib_tuple_like should have the value 202207L in c++23"
360# endif
361# else
362# ifdef __cpp_lib_tuple_like
363# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
364# endif
365# endif
366
367# ifndef __cpp_lib_tuples_by_type
368# error "__cpp_lib_tuples_by_type should be defined in c++23"
369# endif
370# if __cpp_lib_tuples_by_type != 201304L
371# error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
372# endif
373
374# ifndef __cpp_lib_unreachable
375# error "__cpp_lib_unreachable should be defined in c++23"
376# endif
377# if __cpp_lib_unreachable != 202202L
378# error "__cpp_lib_unreachable should have the value 202202L in c++23"
379# endif
380
381#elif TEST_STD_VER > 23
382
383# ifndef __cpp_lib_as_const
384# error "__cpp_lib_as_const should be defined in c++26"
385# endif
386# if __cpp_lib_as_const != 201510L
387# error "__cpp_lib_as_const should have the value 201510L in c++26"
388# endif
389
390# ifndef __cpp_lib_constexpr_algorithms
391# error "__cpp_lib_constexpr_algorithms should be defined in c++26"
392# endif
393# if __cpp_lib_constexpr_algorithms != 202306L
394# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
395# endif
396
397# ifndef __cpp_lib_constexpr_utility
398# error "__cpp_lib_constexpr_utility should be defined in c++26"
399# endif
400# if __cpp_lib_constexpr_utility != 201811L
401# error "__cpp_lib_constexpr_utility should have the value 201811L in c++26"
402# endif
403
404# if !defined(_LIBCPP_VERSION)
405# ifndef __cpp_lib_constrained_equality
406# error "__cpp_lib_constrained_equality should be defined in c++26"
407# endif
408# if __cpp_lib_constrained_equality != 202403L
409# error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
410# endif
411# else
412# ifdef __cpp_lib_constrained_equality
413# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
414# endif
415# endif
416
417# ifndef __cpp_lib_exchange_function
418# error "__cpp_lib_exchange_function should be defined in c++26"
419# endif
420# if __cpp_lib_exchange_function != 201304L
421# error "__cpp_lib_exchange_function should have the value 201304L in c++26"
422# endif
423
424# ifndef __cpp_lib_forward_like
425# error "__cpp_lib_forward_like should be defined in c++26"
426# endif
427# if __cpp_lib_forward_like != 202207L
428# error "__cpp_lib_forward_like should have the value 202207L in c++26"
429# endif
430
431# ifndef __cpp_lib_integer_comparison_functions
432# error "__cpp_lib_integer_comparison_functions should be defined in c++26"
433# endif
434# if __cpp_lib_integer_comparison_functions != 202002L
435# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++26"
436# endif
437
438# ifndef __cpp_lib_integer_sequence
439# error "__cpp_lib_integer_sequence should be defined in c++26"
440# endif
441# if __cpp_lib_integer_sequence != 201304L
442# error "__cpp_lib_integer_sequence should have the value 201304L in c++26"
443# endif
444
445# if !defined(_LIBCPP_VERSION)
446# ifndef __cpp_lib_ranges_zip
447# error "__cpp_lib_ranges_zip should be defined in c++26"
448# endif
449# if __cpp_lib_ranges_zip != 202110L
450# error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
451# endif
452# else
453# ifdef __cpp_lib_ranges_zip
454# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
455# endif
456# endif
457
458# ifndef __cpp_lib_to_underlying
459# error "__cpp_lib_to_underlying should be defined in c++26"
460# endif
461# if __cpp_lib_to_underlying != 202102L
462# error "__cpp_lib_to_underlying should have the value 202102L in c++26"
463# endif
464
465# if !defined(_LIBCPP_VERSION)
466# ifndef __cpp_lib_tuple_like
467# error "__cpp_lib_tuple_like should be defined in c++26"
468# endif
469# if __cpp_lib_tuple_like != 202311L
470# error "__cpp_lib_tuple_like should have the value 202311L in c++26"
471# endif
472# else
473# ifdef __cpp_lib_tuple_like
474# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
475# endif
476# endif
477
478# ifndef __cpp_lib_tuples_by_type
479# error "__cpp_lib_tuples_by_type should be defined in c++26"
480# endif
481# if __cpp_lib_tuples_by_type != 201304L
482# error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
483# endif
484
485# ifndef __cpp_lib_unreachable
486# error "__cpp_lib_unreachable should be defined in c++26"
487# endif
488# if __cpp_lib_unreachable != 202202L
489# error "__cpp_lib_unreachable should have the value 202202L in c++26"
490# endif
491
492#endif // TEST_STD_VER > 23
493
494// clang-format on
495
496

source code of libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp