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 # ifndef __cpp_lib_boyer_moore_searcher 154 # error "__cpp_lib_boyer_moore_searcher should be defined in c++17" 155 # endif 156 # if __cpp_lib_boyer_moore_searcher != 201603L 157 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17" 158 # endif 159 160 # ifdef __cpp_lib_constexpr_functional 161 # error "__cpp_lib_constexpr_functional should not be defined before c++20" 162 # endif 163 164 # ifndef __cpp_lib_invoke 165 # error "__cpp_lib_invoke should be defined in c++17" 166 # endif 167 # if __cpp_lib_invoke != 201411L 168 # error "__cpp_lib_invoke should have the value 201411L in c++17" 169 # endif 170 171 # ifdef __cpp_lib_invoke_r 172 # error "__cpp_lib_invoke_r should not be defined before c++2b" 173 # endif 174 175 # ifdef __cpp_lib_move_only_function 176 # error "__cpp_lib_move_only_function should not be defined before c++2b" 177 # endif 178 179 # ifndef __cpp_lib_not_fn 180 # error "__cpp_lib_not_fn should be defined in c++17" 181 # endif 182 # if __cpp_lib_not_fn != 201603L 183 # error "__cpp_lib_not_fn should have the value 201603L in c++17" 184 # endif 185 186 # ifdef __cpp_lib_ranges 187 # error "__cpp_lib_ranges should not be defined before c++20" 188 # endif 189 190 # ifndef __cpp_lib_result_of_sfinae 191 # error "__cpp_lib_result_of_sfinae should be defined in c++17" 192 # endif 193 # if __cpp_lib_result_of_sfinae != 201210L 194 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17" 195 # endif 196 197 # ifndef __cpp_lib_transparent_operators 198 # error "__cpp_lib_transparent_operators should be defined in c++17" 199 # endif 200 # if __cpp_lib_transparent_operators != 201510L 201 # error "__cpp_lib_transparent_operators should have the value 201510L in c++17" 202 # endif 203 204 # ifdef __cpp_lib_unwrap_ref 205 # error "__cpp_lib_unwrap_ref should not be defined before c++20" 206 # endif 207 208 #elif TEST_STD_VER == 20 209 210 # ifdef __cpp_lib_bind_back 211 # error "__cpp_lib_bind_back should not be defined before c++2b" 212 # endif 213 214 # ifndef __cpp_lib_bind_front 215 # error "__cpp_lib_bind_front should be defined in c++20" 216 # endif 217 # if __cpp_lib_bind_front != 201907L 218 # error "__cpp_lib_bind_front should have the value 201907L in c++20" 219 # endif 220 221 # ifndef __cpp_lib_boyer_moore_searcher 222 # error "__cpp_lib_boyer_moore_searcher should be defined in c++20" 223 # endif 224 # if __cpp_lib_boyer_moore_searcher != 201603L 225 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20" 226 # endif 227 228 # ifndef __cpp_lib_constexpr_functional 229 # error "__cpp_lib_constexpr_functional should be defined in c++20" 230 # endif 231 # if __cpp_lib_constexpr_functional != 201907L 232 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++20" 233 # endif 234 235 # ifndef __cpp_lib_invoke 236 # error "__cpp_lib_invoke should be defined in c++20" 237 # endif 238 # if __cpp_lib_invoke != 201411L 239 # error "__cpp_lib_invoke should have the value 201411L in c++20" 240 # endif 241 242 # ifdef __cpp_lib_invoke_r 243 # error "__cpp_lib_invoke_r should not be defined before c++2b" 244 # endif 245 246 # ifdef __cpp_lib_move_only_function 247 # error "__cpp_lib_move_only_function should not be defined before c++2b" 248 # endif 249 250 # ifndef __cpp_lib_not_fn 251 # error "__cpp_lib_not_fn should be defined in c++20" 252 # endif 253 # if __cpp_lib_not_fn != 201603L 254 # error "__cpp_lib_not_fn should have the value 201603L in c++20" 255 # endif 256 257 # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) 258 # ifndef __cpp_lib_ranges 259 # error "__cpp_lib_ranges should be defined in c++20" 260 # endif 261 # if __cpp_lib_ranges != 201811L 262 # error "__cpp_lib_ranges should have the value 201811L in c++20" 263 # endif 264 # else 265 # ifdef __cpp_lib_ranges 266 # error "__cpp_lib_ranges should not be defined when !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) is not defined!" 267 # endif 268 # endif 269 270 # ifndef __cpp_lib_result_of_sfinae 271 # error "__cpp_lib_result_of_sfinae should be defined in c++20" 272 # endif 273 # if __cpp_lib_result_of_sfinae != 201210L 274 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20" 275 # endif 276 277 # ifndef __cpp_lib_transparent_operators 278 # error "__cpp_lib_transparent_operators should be defined in c++20" 279 # endif 280 # if __cpp_lib_transparent_operators != 201510L 281 # error "__cpp_lib_transparent_operators should have the value 201510L in c++20" 282 # endif 283 284 # ifndef __cpp_lib_unwrap_ref 285 # error "__cpp_lib_unwrap_ref should be defined in c++20" 286 # endif 287 # if __cpp_lib_unwrap_ref != 201811L 288 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++20" 289 # endif 290 291 #elif TEST_STD_VER > 20 292 293 # if !defined(_LIBCPP_VERSION) 294 # ifndef __cpp_lib_bind_back 295 # error "__cpp_lib_bind_back should be defined in c++2b" 296 # endif 297 # if __cpp_lib_bind_back != 202202L 298 # error "__cpp_lib_bind_back should have the value 202202L in c++2b" 299 # endif 300 # else // _LIBCPP_VERSION 301 # ifdef __cpp_lib_bind_back 302 # error "__cpp_lib_bind_back should not be defined because it is unimplemented in libc++!" 303 # endif 304 # endif 305 306 # ifndef __cpp_lib_bind_front 307 # error "__cpp_lib_bind_front should be defined in c++2b" 308 # endif 309 # if __cpp_lib_bind_front != 201907L 310 # error "__cpp_lib_bind_front should have the value 201907L in c++2b" 311 # endif 312 313 # ifndef __cpp_lib_boyer_moore_searcher 314 # error "__cpp_lib_boyer_moore_searcher should be defined in c++2b" 315 # endif 316 # if __cpp_lib_boyer_moore_searcher != 201603L 317 # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++2b" 318 # endif 319 320 # ifndef __cpp_lib_constexpr_functional 321 # error "__cpp_lib_constexpr_functional should be defined in c++2b" 322 # endif 323 # if __cpp_lib_constexpr_functional != 201907L 324 # error "__cpp_lib_constexpr_functional should have the value 201907L in c++2b" 325 # endif 326 327 # ifndef __cpp_lib_invoke 328 # error "__cpp_lib_invoke should be defined in c++2b" 329 # endif 330 # if __cpp_lib_invoke != 201411L 331 # error "__cpp_lib_invoke should have the value 201411L in c++2b" 332 # endif 333 334 # if !defined(_LIBCPP_VERSION) 335 # ifndef __cpp_lib_invoke_r 336 # error "__cpp_lib_invoke_r should be defined in c++2b" 337 # endif 338 # if __cpp_lib_invoke_r != 202106L 339 # error "__cpp_lib_invoke_r should have the value 202106L in c++2b" 340 # endif 341 # else // _LIBCPP_VERSION 342 # ifdef __cpp_lib_invoke_r 343 # error "__cpp_lib_invoke_r should not be defined because it is unimplemented in libc++!" 344 # endif 345 # endif 346 347 # if !defined(_LIBCPP_VERSION) 348 # ifndef __cpp_lib_move_only_function 349 # error "__cpp_lib_move_only_function should be defined in c++2b" 350 # endif 351 # if __cpp_lib_move_only_function != 202110L 352 # error "__cpp_lib_move_only_function should have the value 202110L in c++2b" 353 # endif 354 # else // _LIBCPP_VERSION 355 # ifdef __cpp_lib_move_only_function 356 # error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!" 357 # endif 358 # endif 359 360 # ifndef __cpp_lib_not_fn 361 # error "__cpp_lib_not_fn should be defined in c++2b" 362 # endif 363 # if __cpp_lib_not_fn != 201603L 364 # error "__cpp_lib_not_fn should have the value 201603L in c++2b" 365 # endif 366 367 # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) 368 # ifndef __cpp_lib_ranges 369 # error "__cpp_lib_ranges should be defined in c++2b" 370 # endif 371 # if __cpp_lib_ranges != 201811L 372 # error "__cpp_lib_ranges should have the value 201811L in c++2b" 373 # endif 374 # else 375 # ifdef __cpp_lib_ranges 376 # error "__cpp_lib_ranges should not be defined when !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) is not defined!" 377 # endif 378 # endif 379 380 # ifndef __cpp_lib_result_of_sfinae 381 # error "__cpp_lib_result_of_sfinae should be defined in c++2b" 382 # endif 383 # if __cpp_lib_result_of_sfinae != 201210L 384 # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++2b" 385 # endif 386 387 # ifndef __cpp_lib_transparent_operators 388 # error "__cpp_lib_transparent_operators should be defined in c++2b" 389 # endif 390 # if __cpp_lib_transparent_operators != 201510L 391 # error "__cpp_lib_transparent_operators should have the value 201510L in c++2b" 392 # endif 393 394 # ifndef __cpp_lib_unwrap_ref 395 # error "__cpp_lib_unwrap_ref should be defined in c++2b" 396 # endif 397 # if __cpp_lib_unwrap_ref != 201811L 398 # error "__cpp_lib_unwrap_ref should have the value 201811L in c++2b" 399 # endif 400 401 #endif // TEST_STD_VER > 20 402 403