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