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]
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]
36 __cpp_lib_unwrap_ref 201811L [C++20]
40 #include "test_macros.h"
44 # ifdef __cpp_lib_bind_back
45 # error "__cpp_lib_bind_back should not be defined before c++23"
48 # ifdef __cpp_lib_bind_front
49 # error "__cpp_lib_bind_front should not be defined before c++20"
52 # ifdef __cpp_lib_boyer_moore_searcher
53 # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
56 # ifdef __cpp_lib_constexpr_functional
57 # error "__cpp_lib_constexpr_functional should not be defined before c++20"
60 # ifdef __cpp_lib_copyable_function
61 # error "__cpp_lib_copyable_function should not be defined before c++26"
64 # ifdef __cpp_lib_function_ref
65 # error "__cpp_lib_function_ref should not be defined before c++26"
68 # ifdef __cpp_lib_invoke
69 # error "__cpp_lib_invoke should not be defined before c++17"
72 # ifdef __cpp_lib_invoke_r
73 # error "__cpp_lib_invoke_r should not be defined before c++23"
76 # ifdef __cpp_lib_move_only_function
77 # error "__cpp_lib_move_only_function should not be defined before c++23"
80 # ifdef __cpp_lib_not_fn
81 # error "__cpp_lib_not_fn should not be defined before c++17"
84 # ifdef __cpp_lib_ranges
85 # error "__cpp_lib_ranges should not be defined before c++20"
88 # ifdef __cpp_lib_reference_wrapper
89 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
92 # ifdef __cpp_lib_result_of_sfinae
93 # error "__cpp_lib_result_of_sfinae should not be defined before c++14"
96 # ifdef __cpp_lib_transparent_operators
97 # error "__cpp_lib_transparent_operators should not be defined before c++14"
100 # ifdef __cpp_lib_unwrap_ref
101 # error "__cpp_lib_unwrap_ref should not be defined before c++20"
104 #elif TEST_STD_VER == 14
106 # ifdef __cpp_lib_bind_back
107 # error "__cpp_lib_bind_back should not be defined before c++23"
110 # ifdef __cpp_lib_bind_front
111 # error "__cpp_lib_bind_front should not be defined before c++20"
114 # ifdef __cpp_lib_boyer_moore_searcher
115 # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
118 # ifdef __cpp_lib_constexpr_functional
119 # error "__cpp_lib_constexpr_functional should not be defined before c++20"
122 # ifdef __cpp_lib_copyable_function
123 # error "__cpp_lib_copyable_function should not be defined before c++26"
126 # ifdef __cpp_lib_function_ref
127 # error "__cpp_lib_function_ref should not be defined before c++26"
130 # ifdef __cpp_lib_invoke
131 # error "__cpp_lib_invoke should not be defined before c++17"
134 # ifdef __cpp_lib_invoke_r
135 # error "__cpp_lib_invoke_r should not be defined before c++23"
138 # ifdef __cpp_lib_move_only_function
139 # error "__cpp_lib_move_only_function should not be defined before c++23"
142 # ifdef __cpp_lib_not_fn
143 # error "__cpp_lib_not_fn should not be defined before c++17"
146 # ifdef __cpp_lib_ranges
147 # error "__cpp_lib_ranges should not be defined before c++20"
150 # ifdef __cpp_lib_reference_wrapper
151 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
154 # ifndef __cpp_lib_result_of_sfinae
155 # error "__cpp_lib_result_of_sfinae should be defined in c++14"
157 # if __cpp_lib_result_of_sfinae != 201210L
158 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
161 # ifndef __cpp_lib_transparent_operators
162 # error "__cpp_lib_transparent_operators should be defined in c++14"
164 # if __cpp_lib_transparent_operators != 201210L
165 # error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
168 # ifdef __cpp_lib_unwrap_ref
169 # error "__cpp_lib_unwrap_ref should not be defined before c++20"
172 #elif TEST_STD_VER == 17
174 # ifdef __cpp_lib_bind_back
175 # error "__cpp_lib_bind_back should not be defined before c++23"
178 # ifdef __cpp_lib_bind_front
179 # error "__cpp_lib_bind_front should not be defined before c++20"
182 # ifndef __cpp_lib_boyer_moore_searcher
183 # error "__cpp_lib_boyer_moore_searcher should be defined in c++17"
185 # if __cpp_lib_boyer_moore_searcher != 201603L
186 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17"
189 # ifdef __cpp_lib_constexpr_functional
190 # error "__cpp_lib_constexpr_functional should not be defined before c++20"
193 # ifdef __cpp_lib_copyable_function
194 # error "__cpp_lib_copyable_function should not be defined before c++26"
197 # ifdef __cpp_lib_function_ref
198 # error "__cpp_lib_function_ref should not be defined before c++26"
201 # ifndef __cpp_lib_invoke
202 # error "__cpp_lib_invoke should be defined in c++17"
204 # if __cpp_lib_invoke != 201411L
205 # error "__cpp_lib_invoke should have the value 201411L in c++17"
208 # ifdef __cpp_lib_invoke_r
209 # error "__cpp_lib_invoke_r should not be defined before c++23"
212 # ifdef __cpp_lib_move_only_function
213 # error "__cpp_lib_move_only_function should not be defined before c++23"
216 # ifndef __cpp_lib_not_fn
217 # error "__cpp_lib_not_fn should be defined in c++17"
219 # if __cpp_lib_not_fn != 201603L
220 # error "__cpp_lib_not_fn should have the value 201603L in c++17"
223 # ifdef __cpp_lib_ranges
224 # error "__cpp_lib_ranges should not be defined before c++20"
227 # ifdef __cpp_lib_reference_wrapper
228 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
231 # ifndef __cpp_lib_result_of_sfinae
232 # error "__cpp_lib_result_of_sfinae should be defined in c++17"
234 # if __cpp_lib_result_of_sfinae != 201210L
235 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
238 # ifndef __cpp_lib_transparent_operators
239 # error "__cpp_lib_transparent_operators should be defined in c++17"
241 # if __cpp_lib_transparent_operators != 201510L
242 # error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
245 # ifdef __cpp_lib_unwrap_ref
246 # error "__cpp_lib_unwrap_ref should not be defined before c++20"
249 #elif TEST_STD_VER == 20
251 # ifdef __cpp_lib_bind_back
252 # error "__cpp_lib_bind_back should not be defined before c++23"
255 # ifndef __cpp_lib_bind_front
256 # error "__cpp_lib_bind_front should be defined in c++20"
258 # if __cpp_lib_bind_front != 201907L
259 # error "__cpp_lib_bind_front should have the value 201907L in c++20"
262 # ifndef __cpp_lib_boyer_moore_searcher
263 # error "__cpp_lib_boyer_moore_searcher should be defined in c++20"
265 # if __cpp_lib_boyer_moore_searcher != 201603L
266 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20"
269 # ifndef __cpp_lib_constexpr_functional
270 # error "__cpp_lib_constexpr_functional should be defined in c++20"
272 # if __cpp_lib_constexpr_functional != 201907L
273 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
276 # ifdef __cpp_lib_copyable_function
277 # error "__cpp_lib_copyable_function should not be defined before c++26"
280 # ifdef __cpp_lib_function_ref
281 # error "__cpp_lib_function_ref should not be defined before c++26"
284 # ifndef __cpp_lib_invoke
285 # error "__cpp_lib_invoke should be defined in c++20"
287 # if __cpp_lib_invoke != 201411L
288 # error "__cpp_lib_invoke should have the value 201411L in c++20"
291 # ifdef __cpp_lib_invoke_r
292 # error "__cpp_lib_invoke_r should not be defined before c++23"
295 # ifdef __cpp_lib_move_only_function
296 # error "__cpp_lib_move_only_function should not be defined before c++23"
299 # ifndef __cpp_lib_not_fn
300 # error "__cpp_lib_not_fn should be defined in c++20"
302 # if __cpp_lib_not_fn != 201603L
303 # error "__cpp_lib_not_fn should have the value 201603L in c++20"
306 # ifndef __cpp_lib_ranges
307 # error "__cpp_lib_ranges should be defined in c++20"
309 # if __cpp_lib_ranges != 202207L
310 # error "__cpp_lib_ranges should have the value 202207L in c++20"
313 # ifdef __cpp_lib_reference_wrapper
314 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
317 # ifndef __cpp_lib_result_of_sfinae
318 # error "__cpp_lib_result_of_sfinae should be defined in c++20"
320 # if __cpp_lib_result_of_sfinae != 201210L
321 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
324 # ifndef __cpp_lib_transparent_operators
325 # error "__cpp_lib_transparent_operators should be defined in c++20"
327 # if __cpp_lib_transparent_operators != 201510L
328 # error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
331 # ifndef __cpp_lib_unwrap_ref
332 # error "__cpp_lib_unwrap_ref should be defined in c++20"
334 # if __cpp_lib_unwrap_ref != 201811L
335 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++20"
338 #elif TEST_STD_VER == 23
340 # ifndef __cpp_lib_bind_back
341 # error "__cpp_lib_bind_back should be defined in c++23"
343 # if __cpp_lib_bind_back != 202202L
344 # error "__cpp_lib_bind_back should have the value 202202L in c++23"
347 # ifndef __cpp_lib_bind_front
348 # error "__cpp_lib_bind_front should be defined in c++23"
350 # if __cpp_lib_bind_front != 201907L
351 # error "__cpp_lib_bind_front should have the value 201907L in c++23"
354 # ifndef __cpp_lib_boyer_moore_searcher
355 # error "__cpp_lib_boyer_moore_searcher should be defined in c++23"
357 # if __cpp_lib_boyer_moore_searcher != 201603L
358 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++23"
361 # ifndef __cpp_lib_constexpr_functional
362 # error "__cpp_lib_constexpr_functional should be defined in c++23"
364 # if __cpp_lib_constexpr_functional != 201907L
365 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++23"
368 # ifdef __cpp_lib_copyable_function
369 # error "__cpp_lib_copyable_function should not be defined before c++26"
372 # ifdef __cpp_lib_function_ref
373 # error "__cpp_lib_function_ref should not be defined before c++26"
376 # ifndef __cpp_lib_invoke
377 # error "__cpp_lib_invoke should be defined in c++23"
379 # if __cpp_lib_invoke != 201411L
380 # error "__cpp_lib_invoke should have the value 201411L in c++23"
383 # ifndef __cpp_lib_invoke_r
384 # error "__cpp_lib_invoke_r should be defined in c++23"
386 # if __cpp_lib_invoke_r != 202106L
387 # error "__cpp_lib_invoke_r should have the value 202106L in c++23"
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"
394 # if __cpp_lib_move_only_function != 202110L
395 # error "__cpp_lib_move_only_function should have the value 202110L in c++23"
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++!"
403 # ifndef __cpp_lib_not_fn
404 # error "__cpp_lib_not_fn should be defined in c++23"
406 # if __cpp_lib_not_fn != 201603L
407 # error "__cpp_lib_not_fn should have the value 201603L in c++23"
410 # ifndef __cpp_lib_ranges
411 # error "__cpp_lib_ranges should be defined in c++23"
413 # if __cpp_lib_ranges != 202211L
414 # error "__cpp_lib_ranges should have the value 202211L in c++23"
417 # ifdef __cpp_lib_reference_wrapper
418 # error "__cpp_lib_reference_wrapper should not be defined before c++26"
421 # ifndef __cpp_lib_result_of_sfinae
422 # error "__cpp_lib_result_of_sfinae should be defined in c++23"
424 # if __cpp_lib_result_of_sfinae != 201210L
425 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
428 # ifndef __cpp_lib_transparent_operators
429 # error "__cpp_lib_transparent_operators should be defined in c++23"
431 # if __cpp_lib_transparent_operators != 201510L
432 # error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
435 # ifndef __cpp_lib_unwrap_ref
436 # error "__cpp_lib_unwrap_ref should be defined in c++23"
438 # if __cpp_lib_unwrap_ref != 201811L
439 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++23"
442 #elif TEST_STD_VER > 23
444 # ifndef __cpp_lib_bind_back
445 # error "__cpp_lib_bind_back should be defined in c++26"
447 # if __cpp_lib_bind_back != 202202L
448 # error "__cpp_lib_bind_back should have the value 202202L in c++26"
451 # ifndef __cpp_lib_bind_front
452 # error "__cpp_lib_bind_front should be defined in c++26"
454 # if __cpp_lib_bind_front != 202306L
455 # error "__cpp_lib_bind_front should have the value 202306L in c++26"
458 # ifndef __cpp_lib_boyer_moore_searcher
459 # error "__cpp_lib_boyer_moore_searcher should be defined in c++26"
461 # if __cpp_lib_boyer_moore_searcher != 201603L
462 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++26"
465 # ifndef __cpp_lib_constexpr_functional
466 # error "__cpp_lib_constexpr_functional should be defined in c++26"
468 # if __cpp_lib_constexpr_functional != 201907L
469 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++26"
472 # if !defined(_LIBCPP_VERSION)
473 # ifndef __cpp_lib_copyable_function
474 # error "__cpp_lib_copyable_function should be defined in c++26"
476 # if __cpp_lib_copyable_function != 202306L
477 # error "__cpp_lib_copyable_function should have the value 202306L in c++26"
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++!"
485 # if !defined(_LIBCPP_VERSION)
486 # ifndef __cpp_lib_function_ref
487 # error "__cpp_lib_function_ref should be defined in c++26"
489 # if __cpp_lib_function_ref != 202306L
490 # error "__cpp_lib_function_ref should have the value 202306L in c++26"
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++!"
498 # ifndef __cpp_lib_invoke
499 # error "__cpp_lib_invoke should be defined in c++26"
501 # if __cpp_lib_invoke != 201411L
502 # error "__cpp_lib_invoke should have the value 201411L in c++26"
505 # ifndef __cpp_lib_invoke_r
506 # error "__cpp_lib_invoke_r should be defined in c++26"
508 # if __cpp_lib_invoke_r != 202106L
509 # error "__cpp_lib_invoke_r should have the value 202106L in c++26"
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"
516 # if __cpp_lib_move_only_function != 202110L
517 # error "__cpp_lib_move_only_function should have the value 202110L in c++26"
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++!"
525 # ifndef __cpp_lib_not_fn
526 # error "__cpp_lib_not_fn should be defined in c++26"
528 # if __cpp_lib_not_fn != 201603L
529 # error "__cpp_lib_not_fn should have the value 201603L in c++26"
532 # ifndef __cpp_lib_ranges
533 # error "__cpp_lib_ranges should be defined in c++26"
535 # if __cpp_lib_ranges != 202211L
536 # error "__cpp_lib_ranges should have the value 202211L in c++26"
539 # ifndef __cpp_lib_reference_wrapper
540 # error "__cpp_lib_reference_wrapper should be defined in c++26"
542 # if __cpp_lib_reference_wrapper != 202403L
543 # error "__cpp_lib_reference_wrapper should have the value 202403L in c++26"
546 # ifndef __cpp_lib_result_of_sfinae
547 # error "__cpp_lib_result_of_sfinae should be defined in c++26"
549 # if __cpp_lib_result_of_sfinae != 201210L
550 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
553 # ifndef __cpp_lib_transparent_operators
554 # error "__cpp_lib_transparent_operators should be defined in c++26"
556 # if __cpp_lib_transparent_operators != 201510L
557 # error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
560 # ifndef __cpp_lib_unwrap_ref
561 # error "__cpp_lib_unwrap_ref should be defined in c++26"
563 # if __cpp_lib_unwrap_ref != 201811L
564 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++26"
567 #endif // TEST_STD_VER > 23