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 | # if !defined(_LIBCPP_VERSION) |
282 | # ifndef __cpp_lib_ranges_join_with |
283 | # error "__cpp_lib_ranges_join_with should be defined in c++23" |
284 | # endif |
285 | # if __cpp_lib_ranges_join_with != 202202L |
286 | # error "__cpp_lib_ranges_join_with should have the value 202202L in c++23" |
287 | # endif |
288 | # else |
289 | # ifdef __cpp_lib_ranges_join_with |
290 | # error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!" |
291 | # endif |
292 | # endif |
293 | |
294 | # ifndef __cpp_lib_ranges_repeat |
295 | # error "__cpp_lib_ranges_repeat should be defined in c++23" |
296 | # endif |
297 | # if __cpp_lib_ranges_repeat != 202207L |
298 | # error "__cpp_lib_ranges_repeat should have the value 202207L in c++23" |
299 | # endif |
300 | |
301 | # if !defined(_LIBCPP_VERSION) |
302 | # ifndef __cpp_lib_ranges_slide |
303 | # error "__cpp_lib_ranges_slide should be defined in c++23" |
304 | # endif |
305 | # if __cpp_lib_ranges_slide != 202202L |
306 | # error "__cpp_lib_ranges_slide should have the value 202202L in c++23" |
307 | # endif |
308 | # else |
309 | # ifdef __cpp_lib_ranges_slide |
310 | # error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!" |
311 | # endif |
312 | # endif |
313 | |
314 | # ifndef __cpp_lib_ranges_to_container |
315 | # error "__cpp_lib_ranges_to_container should be defined in c++23" |
316 | # endif |
317 | # if __cpp_lib_ranges_to_container != 202202L |
318 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++23" |
319 | # endif |
320 | |
321 | # if !defined(_LIBCPP_VERSION) |
322 | # ifndef __cpp_lib_ranges_zip |
323 | # error "__cpp_lib_ranges_zip should be defined in c++23" |
324 | # endif |
325 | # if __cpp_lib_ranges_zip != 202110L |
326 | # error "__cpp_lib_ranges_zip should have the value 202110L in c++23" |
327 | # endif |
328 | # else |
329 | # ifdef __cpp_lib_ranges_zip |
330 | # error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" |
331 | # endif |
332 | # endif |
333 | |
334 | #elif TEST_STD_VER > 23 |
335 | |
336 | # if !defined(_LIBCPP_VERSION) |
337 | # ifndef __cpp_lib_default_template_type_for_algorithm_values |
338 | # error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" |
339 | # endif |
340 | # if __cpp_lib_default_template_type_for_algorithm_values != 202403L |
341 | # error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" |
342 | # endif |
343 | # else |
344 | # ifdef __cpp_lib_default_template_type_for_algorithm_values |
345 | # error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" |
346 | # endif |
347 | # endif |
348 | |
349 | # ifndef __cpp_lib_ranges |
350 | # error "__cpp_lib_ranges should be defined in c++26" |
351 | # endif |
352 | # if __cpp_lib_ranges != 202406L |
353 | # error "__cpp_lib_ranges should have the value 202406L in c++26" |
354 | # endif |
355 | |
356 | # if !defined(_LIBCPP_VERSION) |
357 | # ifndef __cpp_lib_ranges_as_const |
358 | # error "__cpp_lib_ranges_as_const should be defined in c++26" |
359 | # endif |
360 | # if __cpp_lib_ranges_as_const != 202207L |
361 | # error "__cpp_lib_ranges_as_const should have the value 202207L in c++26" |
362 | # endif |
363 | # else |
364 | # ifdef __cpp_lib_ranges_as_const |
365 | # error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!" |
366 | # endif |
367 | # endif |
368 | |
369 | # ifndef __cpp_lib_ranges_as_rvalue |
370 | # error "__cpp_lib_ranges_as_rvalue should be defined in c++26" |
371 | # endif |
372 | # if __cpp_lib_ranges_as_rvalue != 202207L |
373 | # error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++26" |
374 | # endif |
375 | |
376 | # if !defined(_LIBCPP_VERSION) |
377 | # ifndef __cpp_lib_ranges_chunk |
378 | # error "__cpp_lib_ranges_chunk should be defined in c++26" |
379 | # endif |
380 | # if __cpp_lib_ranges_chunk != 202202L |
381 | # error "__cpp_lib_ranges_chunk should have the value 202202L in c++26" |
382 | # endif |
383 | # else |
384 | # ifdef __cpp_lib_ranges_chunk |
385 | # error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!" |
386 | # endif |
387 | # endif |
388 | |
389 | # ifndef __cpp_lib_ranges_chunk_by |
390 | # error "__cpp_lib_ranges_chunk_by should be defined in c++26" |
391 | # endif |
392 | # if __cpp_lib_ranges_chunk_by != 202202L |
393 | # error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++26" |
394 | # endif |
395 | |
396 | # if !defined(_LIBCPP_VERSION) |
397 | # ifndef __cpp_lib_ranges_concat |
398 | # error "__cpp_lib_ranges_concat should be defined in c++26" |
399 | # endif |
400 | # if __cpp_lib_ranges_concat != 202403L |
401 | # error "__cpp_lib_ranges_concat should have the value 202403L in c++26" |
402 | # endif |
403 | # else |
404 | # ifdef __cpp_lib_ranges_concat |
405 | # error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!" |
406 | # endif |
407 | # endif |
408 | |
409 | # if !defined(_LIBCPP_VERSION) |
410 | # ifndef __cpp_lib_ranges_join_with |
411 | # error "__cpp_lib_ranges_join_with should be defined in c++26" |
412 | # endif |
413 | # if __cpp_lib_ranges_join_with != 202202L |
414 | # error "__cpp_lib_ranges_join_with should have the value 202202L in c++26" |
415 | # endif |
416 | # else |
417 | # ifdef __cpp_lib_ranges_join_with |
418 | # error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!" |
419 | # endif |
420 | # endif |
421 | |
422 | # ifndef __cpp_lib_ranges_repeat |
423 | # error "__cpp_lib_ranges_repeat should be defined in c++26" |
424 | # endif |
425 | # if __cpp_lib_ranges_repeat != 202207L |
426 | # error "__cpp_lib_ranges_repeat should have the value 202207L in c++26" |
427 | # endif |
428 | |
429 | # if !defined(_LIBCPP_VERSION) |
430 | # ifndef __cpp_lib_ranges_slide |
431 | # error "__cpp_lib_ranges_slide should be defined in c++26" |
432 | # endif |
433 | # if __cpp_lib_ranges_slide != 202202L |
434 | # error "__cpp_lib_ranges_slide should have the value 202202L in c++26" |
435 | # endif |
436 | # else |
437 | # ifdef __cpp_lib_ranges_slide |
438 | # error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!" |
439 | # endif |
440 | # endif |
441 | |
442 | # ifndef __cpp_lib_ranges_to_container |
443 | # error "__cpp_lib_ranges_to_container should be defined in c++26" |
444 | # endif |
445 | # if __cpp_lib_ranges_to_container != 202202L |
446 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++26" |
447 | # endif |
448 | |
449 | # if !defined(_LIBCPP_VERSION) |
450 | # ifndef __cpp_lib_ranges_zip |
451 | # error "__cpp_lib_ranges_zip should be defined in c++26" |
452 | # endif |
453 | # if __cpp_lib_ranges_zip != 202110L |
454 | # error "__cpp_lib_ranges_zip should have the value 202110L in c++26" |
455 | # endif |
456 | # else |
457 | # ifdef __cpp_lib_ranges_zip |
458 | # error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" |
459 | # endif |
460 | # endif |
461 | |
462 | #endif // TEST_STD_VER > 23 |
463 | |
464 | // clang-format on |
465 | |
466 | |