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