1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // WARNING: This test was generated by generate_feature_test_macro_components.py
10 // and should not be edited manually.
16 // Test the feature test macros defined by <functional>
19 __cpp_lib_bind_back 202202L [C++23]
20 __cpp_lib_bind_front 201907L [C++20]
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 202207L [C++20]
31 __cpp_lib_reference_wrapper 202403L [C++26]
32 __cpp_lib_result_of_sfinae 201210L [C++14]
33 __cpp_lib_transparent_operators 201210L [C++14]
35 __cpp_lib_unwrap_ref 201811L [C++20]
39 #include "test_macros.h"
43 # ifdef __cpp_lib_bind_back
44 # error "__cpp_lib_bind_back should not be defined before c++23"
47 # ifdef __cpp_lib_bind_front
48 # error "__cpp_lib_bind_front should not be defined before c++20"
51 # ifdef __cpp_lib_boyer_moore_searcher
52 # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
55 # ifdef __cpp_lib_constexpr_functional
56 # error "__cpp_lib_constexpr_functional should not be defined before c++20"
59 # ifdef __cpp_lib_copyable_function
60 # error "__cpp_lib_copyable_function should not be defined before c++26"
63 # ifdef __cpp_lib_function_ref
64 # error "__cpp_lib_function_ref should not be defined before c++26"
67 # ifdef __cpp_lib_invoke
68 # error "__cpp_lib_invoke should not be defined before c++17"
71 # ifdef __cpp_lib_invoke_r
72 # error "__cpp_lib_invoke_r should not be defined before c++23"
75 # ifdef __cpp_lib_move_only_function
76 # error "__cpp_lib_move_only_function should not be defined before c++23"
79 # ifdef __cpp_lib_not_fn
80 # error "__cpp_lib_not_fn should not be defined before c++17"
83 # ifdef __cpp_lib_ranges
84 # error "__cpp_lib_ranges should not be defined before c++20"
87 # ifdef __cpp_lib_reference_wrapper
88 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
91 # ifdef __cpp_lib_result_of_sfinae
92 # error "__cpp_lib_result_of_sfinae should not be defined before c++14"
95 # ifdef __cpp_lib_transparent_operators
96 # error "__cpp_lib_transparent_operators should not be defined before c++14"
99 # ifdef __cpp_lib_unwrap_ref
100 # error "__cpp_lib_unwrap_ref should not be defined before c++20"
103 #elif TEST_STD_VER == 14
105 # ifdef __cpp_lib_bind_back
106 # error "__cpp_lib_bind_back should not be defined before c++23"
109 # ifdef __cpp_lib_bind_front
110 # error "__cpp_lib_bind_front should not be defined before c++20"
113 # ifdef __cpp_lib_boyer_moore_searcher
114 # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
117 # ifdef __cpp_lib_constexpr_functional
118 # error "__cpp_lib_constexpr_functional should not be defined before c++20"
121 # ifdef __cpp_lib_copyable_function
122 # error "__cpp_lib_copyable_function should not be defined before c++26"
125 # ifdef __cpp_lib_function_ref
126 # error "__cpp_lib_function_ref should not be defined before c++26"
129 # ifdef __cpp_lib_invoke
130 # error "__cpp_lib_invoke should not be defined before c++17"
133 # ifdef __cpp_lib_invoke_r
134 # error "__cpp_lib_invoke_r should not be defined before c++23"
137 # ifdef __cpp_lib_move_only_function
138 # error "__cpp_lib_move_only_function should not be defined before c++23"
141 # ifdef __cpp_lib_not_fn
142 # error "__cpp_lib_not_fn should not be defined before c++17"
145 # ifdef __cpp_lib_ranges
146 # error "__cpp_lib_ranges should not be defined before c++20"
149 # ifdef __cpp_lib_reference_wrapper
150 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
153 # ifndef __cpp_lib_result_of_sfinae
154 # error "__cpp_lib_result_of_sfinae should be defined in c++14"
156 # if __cpp_lib_result_of_sfinae != 201210L
157 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
160 # ifndef __cpp_lib_transparent_operators
161 # error "__cpp_lib_transparent_operators should be defined in c++14"
163 # if __cpp_lib_transparent_operators != 201210L
164 # error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
167 # ifdef __cpp_lib_unwrap_ref
168 # error "__cpp_lib_unwrap_ref should not be defined before c++20"
171 #elif TEST_STD_VER == 17
173 # ifdef __cpp_lib_bind_back
174 # error "__cpp_lib_bind_back should not be defined before c++23"
177 # ifdef __cpp_lib_bind_front
178 # error "__cpp_lib_bind_front should not be defined before c++20"
181 # ifndef __cpp_lib_boyer_moore_searcher
182 # error "__cpp_lib_boyer_moore_searcher should be defined in c++17"
184 # if __cpp_lib_boyer_moore_searcher != 201603L
185 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17"
188 # ifdef __cpp_lib_constexpr_functional
189 # error "__cpp_lib_constexpr_functional should not be defined before c++20"
192 # ifdef __cpp_lib_copyable_function
193 # error "__cpp_lib_copyable_function should not be defined before c++26"
196 # ifdef __cpp_lib_function_ref
197 # error "__cpp_lib_function_ref should not be defined before c++26"
200 # ifndef __cpp_lib_invoke
201 # error "__cpp_lib_invoke should be defined in c++17"
203 # if __cpp_lib_invoke != 201411L
204 # error "__cpp_lib_invoke should have the value 201411L in c++17"
207 # ifdef __cpp_lib_invoke_r
208 # error "__cpp_lib_invoke_r should not be defined before c++23"
211 # ifdef __cpp_lib_move_only_function
212 # error "__cpp_lib_move_only_function should not be defined before c++23"
215 # ifndef __cpp_lib_not_fn
216 # error "__cpp_lib_not_fn should be defined in c++17"
218 # if __cpp_lib_not_fn != 201603L
219 # error "__cpp_lib_not_fn should have the value 201603L in c++17"
222 # ifdef __cpp_lib_ranges
223 # error "__cpp_lib_ranges should not be defined before c++20"
226 # ifdef __cpp_lib_reference_wrapper
227 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
230 # ifndef __cpp_lib_result_of_sfinae
231 # error "__cpp_lib_result_of_sfinae should be defined in c++17"
233 # if __cpp_lib_result_of_sfinae != 201210L
234 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
237 # ifndef __cpp_lib_transparent_operators
238 # error "__cpp_lib_transparent_operators should be defined in c++17"
240 # if __cpp_lib_transparent_operators != 201510L
241 # error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
244 # ifdef __cpp_lib_unwrap_ref
245 # error "__cpp_lib_unwrap_ref should not be defined before c++20"
248 #elif TEST_STD_VER == 20
250 # ifdef __cpp_lib_bind_back
251 # error "__cpp_lib_bind_back should not be defined before c++23"
254 # ifndef __cpp_lib_bind_front
255 # error "__cpp_lib_bind_front should be defined in c++20"
257 # if __cpp_lib_bind_front != 201907L
258 # error "__cpp_lib_bind_front should have the value 201907L in c++20"
261 # ifndef __cpp_lib_boyer_moore_searcher
262 # error "__cpp_lib_boyer_moore_searcher should be defined in c++20"
264 # if __cpp_lib_boyer_moore_searcher != 201603L
265 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20"
268 # ifndef __cpp_lib_constexpr_functional
269 # error "__cpp_lib_constexpr_functional should be defined in c++20"
271 # if __cpp_lib_constexpr_functional != 201907L
272 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
275 # ifdef __cpp_lib_copyable_function
276 # error "__cpp_lib_copyable_function should not be defined before c++26"
279 # ifdef __cpp_lib_function_ref
280 # error "__cpp_lib_function_ref should not be defined before c++26"
283 # ifndef __cpp_lib_invoke
284 # error "__cpp_lib_invoke should be defined in c++20"
286 # if __cpp_lib_invoke != 201411L
287 # error "__cpp_lib_invoke should have the value 201411L in c++20"
290 # ifdef __cpp_lib_invoke_r
291 # error "__cpp_lib_invoke_r should not be defined before c++23"
294 # ifdef __cpp_lib_move_only_function
295 # error "__cpp_lib_move_only_function should not be defined before c++23"
298 # ifndef __cpp_lib_not_fn
299 # error "__cpp_lib_not_fn should be defined in c++20"
301 # if __cpp_lib_not_fn != 201603L
302 # error "__cpp_lib_not_fn should have the value 201603L in c++20"
305 # ifndef __cpp_lib_ranges
306 # error "__cpp_lib_ranges should be defined in c++20"
308 # if __cpp_lib_ranges != 202207L
309 # error "__cpp_lib_ranges should have the value 202207L in c++20"
312 # ifdef __cpp_lib_reference_wrapper
313 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
316 # ifndef __cpp_lib_result_of_sfinae
317 # error "__cpp_lib_result_of_sfinae should be defined in c++20"
319 # if __cpp_lib_result_of_sfinae != 201210L
320 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
323 # ifndef __cpp_lib_transparent_operators
324 # error "__cpp_lib_transparent_operators should be defined in c++20"
326 # if __cpp_lib_transparent_operators != 201510L
327 # error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
330 # ifndef __cpp_lib_unwrap_ref
331 # error "__cpp_lib_unwrap_ref should be defined in c++20"
333 # if __cpp_lib_unwrap_ref != 201811L
334 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++20"
337 #elif TEST_STD_VER == 23
339 # ifndef __cpp_lib_bind_back
340 # error "__cpp_lib_bind_back should be defined in c++23"
342 # if __cpp_lib_bind_back != 202202L
343 # error "__cpp_lib_bind_back should have the value 202202L in c++23"
346 # ifndef __cpp_lib_bind_front
347 # error "__cpp_lib_bind_front should be defined in c++23"
349 # if __cpp_lib_bind_front != 201907L
350 # error "__cpp_lib_bind_front should have the value 201907L in c++23"
353 # ifndef __cpp_lib_boyer_moore_searcher
354 # error "__cpp_lib_boyer_moore_searcher should be defined in c++23"
356 # if __cpp_lib_boyer_moore_searcher != 201603L
357 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++23"
360 # ifndef __cpp_lib_constexpr_functional
361 # error "__cpp_lib_constexpr_functional should be defined in c++23"
363 # if __cpp_lib_constexpr_functional != 201907L
364 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++23"
367 # ifdef __cpp_lib_copyable_function
368 # error "__cpp_lib_copyable_function should not be defined before c++26"
371 # ifdef __cpp_lib_function_ref
372 # error "__cpp_lib_function_ref should not be defined before c++26"
375 # ifndef __cpp_lib_invoke
376 # error "__cpp_lib_invoke should be defined in c++23"
378 # if __cpp_lib_invoke != 201411L
379 # error "__cpp_lib_invoke should have the value 201411L in c++23"
382 # ifndef __cpp_lib_invoke_r
383 # error "__cpp_lib_invoke_r should be defined in c++23"
385 # if __cpp_lib_invoke_r != 202106L
386 # error "__cpp_lib_invoke_r should have the value 202106L in c++23"
389 # if !defined(_LIBCPP_VERSION)
390 # ifndef __cpp_lib_move_only_function
391 # error "__cpp_lib_move_only_function should be defined in c++23"
393 # if __cpp_lib_move_only_function != 202110L
394 # error "__cpp_lib_move_only_function should have the value 202110L in c++23"
396 # else // _LIBCPP_VERSION
397 # ifdef __cpp_lib_move_only_function
398 # error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
402 # ifndef __cpp_lib_not_fn
403 # error "__cpp_lib_not_fn should be defined in c++23"
405 # if __cpp_lib_not_fn != 201603L
406 # error "__cpp_lib_not_fn should have the value 201603L in c++23"
409 # ifndef __cpp_lib_ranges
410 # error "__cpp_lib_ranges should be defined in c++23"
412 # if __cpp_lib_ranges != 202207L
413 # error "__cpp_lib_ranges should have the value 202207L in c++23"
416 # ifdef __cpp_lib_reference_wrapper
417 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
420 # ifndef __cpp_lib_result_of_sfinae
421 # error "__cpp_lib_result_of_sfinae should be defined in c++23"
423 # if __cpp_lib_result_of_sfinae != 201210L
424 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
427 # ifndef __cpp_lib_transparent_operators
428 # error "__cpp_lib_transparent_operators should be defined in c++23"
430 # if __cpp_lib_transparent_operators != 201510L
431 # error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
434 # ifndef __cpp_lib_unwrap_ref
435 # error "__cpp_lib_unwrap_ref should be defined in c++23"
437 # if __cpp_lib_unwrap_ref != 201811L
438 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++23"
441 #elif TEST_STD_VER > 23
443 # ifndef __cpp_lib_bind_back
444 # error "__cpp_lib_bind_back should be defined in c++26"
446 # if __cpp_lib_bind_back != 202202L
447 # error "__cpp_lib_bind_back should have the value 202202L in c++26"
450 # ifndef __cpp_lib_bind_front
451 # error "__cpp_lib_bind_front should be defined in c++26"
453 # if __cpp_lib_bind_front != 202306L
454 # error "__cpp_lib_bind_front should have the value 202306L in c++26"
457 # ifndef __cpp_lib_boyer_moore_searcher
458 # error "__cpp_lib_boyer_moore_searcher should be defined in c++26"
460 # if __cpp_lib_boyer_moore_searcher != 201603L
461 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++26"
464 # ifndef __cpp_lib_constexpr_functional
465 # error "__cpp_lib_constexpr_functional should be defined in c++26"
467 # if __cpp_lib_constexpr_functional != 201907L
468 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++26"
471 # if !defined(_LIBCPP_VERSION)
472 # ifndef __cpp_lib_copyable_function
473 # error "__cpp_lib_copyable_function should be defined in c++26"
475 # if __cpp_lib_copyable_function != 202306L
476 # error "__cpp_lib_copyable_function should have the value 202306L in c++26"
478 # else // _LIBCPP_VERSION
479 # ifdef __cpp_lib_copyable_function
480 # error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!"
484 # if !defined(_LIBCPP_VERSION)
485 # ifndef __cpp_lib_function_ref
486 # error "__cpp_lib_function_ref should be defined in c++26"
488 # if __cpp_lib_function_ref != 202306L
489 # error "__cpp_lib_function_ref should have the value 202306L in c++26"
491 # else // _LIBCPP_VERSION
492 # ifdef __cpp_lib_function_ref
493 # error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!"
497 # ifndef __cpp_lib_invoke
498 # error "__cpp_lib_invoke should be defined in c++26"
500 # if __cpp_lib_invoke != 201411L
501 # error "__cpp_lib_invoke should have the value 201411L in c++26"
504 # ifndef __cpp_lib_invoke_r
505 # error "__cpp_lib_invoke_r should be defined in c++26"
507 # if __cpp_lib_invoke_r != 202106L
508 # error "__cpp_lib_invoke_r should have the value 202106L in c++26"
511 # if !defined(_LIBCPP_VERSION)
512 # ifndef __cpp_lib_move_only_function
513 # error "__cpp_lib_move_only_function should be defined in c++26"
515 # if __cpp_lib_move_only_function != 202110L
516 # error "__cpp_lib_move_only_function should have the value 202110L in c++26"
518 # else // _LIBCPP_VERSION
519 # ifdef __cpp_lib_move_only_function
520 # error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
524 # ifndef __cpp_lib_not_fn
525 # error "__cpp_lib_not_fn should be defined in c++26"
527 # if __cpp_lib_not_fn != 201603L
528 # error "__cpp_lib_not_fn should have the value 201603L in c++26"
531 # ifndef __cpp_lib_ranges
532 # error "__cpp_lib_ranges should be defined in c++26"
534 # if __cpp_lib_ranges != 202207L
535 # error "__cpp_lib_ranges should have the value 202207L in c++26"
538 # ifndef __cpp_lib_reference_wrapper
539 # error "__cpp_lib_reference_wrapper should be defined in c++26"
541 # if __cpp_lib_reference_wrapper != 202403L
542 # error "__cpp_lib_reference_wrapper should have the value 202403L in c++26"
545 # ifndef __cpp_lib_result_of_sfinae
546 # error "__cpp_lib_result_of_sfinae should be defined in c++26"
548 # if __cpp_lib_result_of_sfinae != 201210L
549 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
552 # ifndef __cpp_lib_transparent_operators
553 # error "__cpp_lib_transparent_operators should be defined in c++26"
555 # if __cpp_lib_transparent_operators != 201510L
556 # error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
559 # ifndef __cpp_lib_unwrap_ref
560 # error "__cpp_lib_unwrap_ref should be defined in c++26"
562 # if __cpp_lib_unwrap_ref != 201811L
563 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++26"
566 #endif // TEST_STD_VER > 23