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++2b] 20 __cpp_lib_bind_front 201907L [C++20] 21 __cpp_lib_boyer_moore_searcher 201603L [C++17] 22 __cpp_lib_constexpr_functional 201907L [C++20] 23 __cpp_lib_invoke 201411L [C++17] 24 __cpp_lib_invoke_r 202106L [C++2b] 25 __cpp_lib_move_only_function 202110L [C++2b] 26 __cpp_lib_not_fn 201603L [C++17] 27 __cpp_lib_ranges 201811L [C++20] 28 __cpp_lib_result_of_sfinae 201210L [C++14] 29 __cpp_lib_transparent_operators 201210L [C++14] 30 201510L [C++17] 31 __cpp_lib_unwrap_ref 201811L [C++20] 32 */ 33 34 #include <functional> 35 #include "test_macros.h" 36 37 #if TEST_STD_VER < 14 38 39 # ifdef __cpp_lib_bind_back 40 # error "__cpp_lib_bind_back should not be defined before c++2b" 41 # endif 42 43 # ifdef __cpp_lib_bind_front 44 # error "__cpp_lib_bind_front should not be defined before c++20" 45 # endif 46 47 # ifdef __cpp_lib_boyer_moore_searcher 48 # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17" 49 # endif 50 51 # ifdef __cpp_lib_constexpr_functional 52 # error "__cpp_lib_constexpr_functional should not be defined before c++20" 53 # endif 54 55 # ifdef __cpp_lib_invoke 56 # error "__cpp_lib_invoke should not be defined before c++17" 57 # endif 58 59 # ifdef __cpp_lib_invoke_r 60 # error "__cpp_lib_invoke_r should not be defined before c++2b" 61 # endif 62 63 # ifdef __cpp_lib_move_only_function 64 # error "__cpp_lib_move_only_function should not be defined before c++2b" 65 # endif 66 67 # ifdef __cpp_lib_not_fn 68 # error "__cpp_lib_not_fn should not be defined before c++17" 69 # endif 70 71 # ifdef __cpp_lib_ranges 72 # error "__cpp_lib_ranges should not be defined before c++20" 73 # endif 74 75 # ifdef __cpp_lib_result_of_sfinae 76 # error "__cpp_lib_result_of_sfinae should not be defined before c++14" 77 # endif 78 79 # ifdef __cpp_lib_transparent_operators 80 # error "__cpp_lib_transparent_operators should not be defined before c++14" 81 # endif 82 83 # ifdef __cpp_lib_unwrap_ref 84 # error "__cpp_lib_unwrap_ref should not be defined before c++20" 85 # endif 86 87 #elif TEST_STD_VER == 14 88 89 # ifdef __cpp_lib_bind_back 90 # error "__cpp_lib_bind_back should not be defined before c++2b" 91 # endif 92 93 # ifdef __cpp_lib_bind_front 94 # error "__cpp_lib_bind_front should not be defined before c++20" 95 # endif 96 97 # ifdef __cpp_lib_boyer_moore_searcher 98 # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17" 99 # endif 100 101 # ifdef __cpp_lib_constexpr_functional 102 # error "__cpp_lib_constexpr_functional should not be defined before c++20" 103 # endif 104 105 # ifdef __cpp_lib_invoke 106 # error "__cpp_lib_invoke should not be defined before c++17" 107 # endif 108 109 # ifdef __cpp_lib_invoke_r 110 # error "__cpp_lib_invoke_r should not be defined before c++2b" 111 # endif 112 113 # ifdef __cpp_lib_move_only_function 114 # error "__cpp_lib_move_only_function should not be defined before c++2b" 115 # endif 116 117 # ifdef __cpp_lib_not_fn 118 # error "__cpp_lib_not_fn should not be defined before c++17" 119 # endif 120 121 # ifdef __cpp_lib_ranges 122 # error "__cpp_lib_ranges should not be defined before c++20" 123 # endif 124 125 # ifndef __cpp_lib_result_of_sfinae 126 # error "__cpp_lib_result_of_sfinae should be defined in c++14" 127 # endif 128 # if __cpp_lib_result_of_sfinae != 201210L 129 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14" 130 # endif 131 132 # ifndef __cpp_lib_transparent_operators 133 # error "__cpp_lib_transparent_operators should be defined in c++14" 134 # endif 135 # if __cpp_lib_transparent_operators != 201210L 136 # error "__cpp_lib_transparent_operators should have the value 201210L in c++14" 137 # endif 138 139 # ifdef __cpp_lib_unwrap_ref 140 # error "__cpp_lib_unwrap_ref should not be defined before c++20" 141 # endif 142 143 #elif TEST_STD_VER == 17 144 145 # ifdef __cpp_lib_bind_back 146 # error "__cpp_lib_bind_back should not be defined before c++2b" 147 # endif 148 149 # ifdef __cpp_lib_bind_front 150 # error "__cpp_lib_bind_front should not be defined before c++20" 151 # endif 152 153 # if !defined(_LIBCPP_VERSION) 154 # ifndef __cpp_lib_boyer_moore_searcher 155 # error "__cpp_lib_boyer_moore_searcher should be defined in c++17" 156 # endif 157 # if __cpp_lib_boyer_moore_searcher != 201603L 158 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17" 159 # endif 160 # else // _LIBCPP_VERSION 161 # ifdef __cpp_lib_boyer_moore_searcher 162 # error "__cpp_lib_boyer_moore_searcher should not be defined because it is unimplemented in libc++!" 163 # endif 164 # endif 165 166 # ifdef __cpp_lib_constexpr_functional 167 # error "__cpp_lib_constexpr_functional should not be defined before c++20" 168 # endif 169 170 # ifndef __cpp_lib_invoke 171 # error "__cpp_lib_invoke should be defined in c++17" 172 # endif 173 # if __cpp_lib_invoke != 201411L 174 # error "__cpp_lib_invoke should have the value 201411L in c++17" 175 # endif 176 177 # ifdef __cpp_lib_invoke_r 178 # error "__cpp_lib_invoke_r should not be defined before c++2b" 179 # endif 180 181 # ifdef __cpp_lib_move_only_function 182 # error "__cpp_lib_move_only_function should not be defined before c++2b" 183 # endif 184 185 # ifndef __cpp_lib_not_fn 186 # error "__cpp_lib_not_fn should be defined in c++17" 187 # endif 188 # if __cpp_lib_not_fn != 201603L 189 # error "__cpp_lib_not_fn should have the value 201603L in c++17" 190 # endif 191 192 # ifdef __cpp_lib_ranges 193 # error "__cpp_lib_ranges should not be defined before c++20" 194 # endif 195 196 # ifndef __cpp_lib_result_of_sfinae 197 # error "__cpp_lib_result_of_sfinae should be defined in c++17" 198 # endif 199 # if __cpp_lib_result_of_sfinae != 201210L 200 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17" 201 # endif 202 203 # ifndef __cpp_lib_transparent_operators 204 # error "__cpp_lib_transparent_operators should be defined in c++17" 205 # endif 206 # if __cpp_lib_transparent_operators != 201510L 207 # error "__cpp_lib_transparent_operators should have the value 201510L in c++17" 208 # endif 209 210 # ifdef __cpp_lib_unwrap_ref 211 # error "__cpp_lib_unwrap_ref should not be defined before c++20" 212 # endif 213 214 #elif TEST_STD_VER == 20 215 216 # ifdef __cpp_lib_bind_back 217 # error "__cpp_lib_bind_back should not be defined before c++2b" 218 # endif 219 220 # ifndef __cpp_lib_bind_front 221 # error "__cpp_lib_bind_front should be defined in c++20" 222 # endif 223 # if __cpp_lib_bind_front != 201907L 224 # error "__cpp_lib_bind_front should have the value 201907L in c++20" 225 # endif 226 227 # if !defined(_LIBCPP_VERSION) 228 # ifndef __cpp_lib_boyer_moore_searcher 229 # error "__cpp_lib_boyer_moore_searcher should be defined in c++20" 230 # endif 231 # if __cpp_lib_boyer_moore_searcher != 201603L 232 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20" 233 # endif 234 # else // _LIBCPP_VERSION 235 # ifdef __cpp_lib_boyer_moore_searcher 236 # error "__cpp_lib_boyer_moore_searcher should not be defined because it is unimplemented in libc++!" 237 # endif 238 # endif 239 240 # ifndef __cpp_lib_constexpr_functional 241 # error "__cpp_lib_constexpr_functional should be defined in c++20" 242 # endif 243 # if __cpp_lib_constexpr_functional != 201907L 244 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++20" 245 # endif 246 247 # ifndef __cpp_lib_invoke 248 # error "__cpp_lib_invoke should be defined in c++20" 249 # endif 250 # if __cpp_lib_invoke != 201411L 251 # error "__cpp_lib_invoke should have the value 201411L in c++20" 252 # endif 253 254 # ifdef __cpp_lib_invoke_r 255 # error "__cpp_lib_invoke_r should not be defined before c++2b" 256 # endif 257 258 # ifdef __cpp_lib_move_only_function 259 # error "__cpp_lib_move_only_function should not be defined before c++2b" 260 # endif 261 262 # ifndef __cpp_lib_not_fn 263 # error "__cpp_lib_not_fn should be defined in c++20" 264 # endif 265 # if __cpp_lib_not_fn != 201603L 266 # error "__cpp_lib_not_fn should have the value 201603L in c++20" 267 # endif 268 269 # if !defined(_LIBCPP_VERSION) 270 # ifndef __cpp_lib_ranges 271 # error "__cpp_lib_ranges should be defined in c++20" 272 # endif 273 # if __cpp_lib_ranges != 201811L 274 # error "__cpp_lib_ranges should have the value 201811L in c++20" 275 # endif 276 # else // _LIBCPP_VERSION 277 # ifdef __cpp_lib_ranges 278 # error "__cpp_lib_ranges should not be defined because it is unimplemented in libc++!" 279 # endif 280 # endif 281 282 # ifndef __cpp_lib_result_of_sfinae 283 # error "__cpp_lib_result_of_sfinae should be defined in c++20" 284 # endif 285 # if __cpp_lib_result_of_sfinae != 201210L 286 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20" 287 # endif 288 289 # ifndef __cpp_lib_transparent_operators 290 # error "__cpp_lib_transparent_operators should be defined in c++20" 291 # endif 292 # if __cpp_lib_transparent_operators != 201510L 293 # error "__cpp_lib_transparent_operators should have the value 201510L in c++20" 294 # endif 295 296 # ifndef __cpp_lib_unwrap_ref 297 # error "__cpp_lib_unwrap_ref should be defined in c++20" 298 # endif 299 # if __cpp_lib_unwrap_ref != 201811L 300 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++20" 301 # endif 302 303 #elif TEST_STD_VER > 20 304 305 # if !defined(_LIBCPP_VERSION) 306 # ifndef __cpp_lib_bind_back 307 # error "__cpp_lib_bind_back should be defined in c++2b" 308 # endif 309 # if __cpp_lib_bind_back != 202202L 310 # error "__cpp_lib_bind_back should have the value 202202L in c++2b" 311 # endif 312 # else // _LIBCPP_VERSION 313 # ifdef __cpp_lib_bind_back 314 # error "__cpp_lib_bind_back should not be defined because it is unimplemented in libc++!" 315 # endif 316 # endif 317 318 # ifndef __cpp_lib_bind_front 319 # error "__cpp_lib_bind_front should be defined in c++2b" 320 # endif 321 # if __cpp_lib_bind_front != 201907L 322 # error "__cpp_lib_bind_front should have the value 201907L in c++2b" 323 # endif 324 325 # if !defined(_LIBCPP_VERSION) 326 # ifndef __cpp_lib_boyer_moore_searcher 327 # error "__cpp_lib_boyer_moore_searcher should be defined in c++2b" 328 # endif 329 # if __cpp_lib_boyer_moore_searcher != 201603L 330 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++2b" 331 # endif 332 # else // _LIBCPP_VERSION 333 # ifdef __cpp_lib_boyer_moore_searcher 334 # error "__cpp_lib_boyer_moore_searcher should not be defined because it is unimplemented in libc++!" 335 # endif 336 # endif 337 338 # ifndef __cpp_lib_constexpr_functional 339 # error "__cpp_lib_constexpr_functional should be defined in c++2b" 340 # endif 341 # if __cpp_lib_constexpr_functional != 201907L 342 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++2b" 343 # endif 344 345 # ifndef __cpp_lib_invoke 346 # error "__cpp_lib_invoke should be defined in c++2b" 347 # endif 348 # if __cpp_lib_invoke != 201411L 349 # error "__cpp_lib_invoke should have the value 201411L in c++2b" 350 # endif 351 352 # if !defined(_LIBCPP_VERSION) 353 # ifndef __cpp_lib_invoke_r 354 # error "__cpp_lib_invoke_r should be defined in c++2b" 355 # endif 356 # if __cpp_lib_invoke_r != 202106L 357 # error "__cpp_lib_invoke_r should have the value 202106L in c++2b" 358 # endif 359 # else // _LIBCPP_VERSION 360 # ifdef __cpp_lib_invoke_r 361 # error "__cpp_lib_invoke_r should not be defined because it is unimplemented in libc++!" 362 # endif 363 # endif 364 365 # if !defined(_LIBCPP_VERSION) 366 # ifndef __cpp_lib_move_only_function 367 # error "__cpp_lib_move_only_function should be defined in c++2b" 368 # endif 369 # if __cpp_lib_move_only_function != 202110L 370 # error "__cpp_lib_move_only_function should have the value 202110L in c++2b" 371 # endif 372 # else // _LIBCPP_VERSION 373 # ifdef __cpp_lib_move_only_function 374 # error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!" 375 # endif 376 # endif 377 378 # ifndef __cpp_lib_not_fn 379 # error "__cpp_lib_not_fn should be defined in c++2b" 380 # endif 381 # if __cpp_lib_not_fn != 201603L 382 # error "__cpp_lib_not_fn should have the value 201603L in c++2b" 383 # endif 384 385 # if !defined(_LIBCPP_VERSION) 386 # ifndef __cpp_lib_ranges 387 # error "__cpp_lib_ranges should be defined in c++2b" 388 # endif 389 # if __cpp_lib_ranges != 201811L 390 # error "__cpp_lib_ranges should have the value 201811L in c++2b" 391 # endif 392 # else // _LIBCPP_VERSION 393 # ifdef __cpp_lib_ranges 394 # error "__cpp_lib_ranges should not be defined because it is unimplemented in libc++!" 395 # endif 396 # endif 397 398 # ifndef __cpp_lib_result_of_sfinae 399 # error "__cpp_lib_result_of_sfinae should be defined in c++2b" 400 # endif 401 # if __cpp_lib_result_of_sfinae != 201210L 402 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++2b" 403 # endif 404 405 # ifndef __cpp_lib_transparent_operators 406 # error "__cpp_lib_transparent_operators should be defined in c++2b" 407 # endif 408 # if __cpp_lib_transparent_operators != 201510L 409 # error "__cpp_lib_transparent_operators should have the value 201510L in c++2b" 410 # endif 411 412 # ifndef __cpp_lib_unwrap_ref 413 # error "__cpp_lib_unwrap_ref should be defined in c++2b" 414 # endif 415 # if __cpp_lib_unwrap_ref != 201811L 416 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++2b" 417 # endif 418 419 #endif // TEST_STD_VER > 20 420 421