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

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