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

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