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