Debian Codegraph @

libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp

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