12c6217f2SLouis Dionne //===----------------------------------------------------------------------===// 22c6217f2SLouis Dionne // 32c6217f2SLouis Dionne // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42c6217f2SLouis Dionne // See https://llvm.org/LICENSE.txt for license information. 52c6217f2SLouis Dionne // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 62c6217f2SLouis Dionne // 72c6217f2SLouis Dionne //===----------------------------------------------------------------------===// 82c6217f2SLouis Dionne // 92c6217f2SLouis Dionne // WARNING: This test was generated by generate_feature_test_macro_components.py 102c6217f2SLouis Dionne // and should not be edited manually. 112c6217f2SLouis Dionne // 122c6217f2SLouis Dionne // clang-format off 132c6217f2SLouis Dionne 142c6217f2SLouis Dionne // <tuple> 152c6217f2SLouis Dionne 162c6217f2SLouis Dionne // Test the feature test macros defined by <tuple> 172c6217f2SLouis Dionne 182c6217f2SLouis Dionne /* Constant Value 192c6217f2SLouis Dionne __cpp_lib_apply 201603L [C++17] 202c6217f2SLouis Dionne __cpp_lib_constexpr_tuple 201811L [C++20] 21*b699a9baSLouis Dionne __cpp_lib_constrained_equality 202403L [C++26] 222c6217f2SLouis Dionne __cpp_lib_make_from_tuple 201606L [C++17] 2371400505SMark de Wever __cpp_lib_ranges_zip 202110L [C++23] 242c6217f2SLouis Dionne __cpp_lib_tuple_element_t 201402L [C++14] 25f49ccca8SMark de Wever __cpp_lib_tuple_like 202207L [C++23] 26f49ccca8SMark de Wever 202311L [C++26] 272c6217f2SLouis Dionne __cpp_lib_tuples_by_type 201304L [C++14] 282c6217f2SLouis Dionne */ 292c6217f2SLouis Dionne 302c6217f2SLouis Dionne #include <tuple> 312c6217f2SLouis Dionne #include "test_macros.h" 322c6217f2SLouis Dionne 332c6217f2SLouis Dionne #if TEST_STD_VER < 14 342c6217f2SLouis Dionne 352c6217f2SLouis Dionne # ifdef __cpp_lib_apply 362c6217f2SLouis Dionne # error "__cpp_lib_apply should not be defined before c++17" 372c6217f2SLouis Dionne # endif 382c6217f2SLouis Dionne 392c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_tuple 402c6217f2SLouis Dionne # error "__cpp_lib_constexpr_tuple should not be defined before c++20" 412c6217f2SLouis Dionne # endif 422c6217f2SLouis Dionne 43*b699a9baSLouis Dionne # ifdef __cpp_lib_constrained_equality 44*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should not be defined before c++26" 45*b699a9baSLouis Dionne # endif 46*b699a9baSLouis Dionne 472c6217f2SLouis Dionne # ifdef __cpp_lib_make_from_tuple 482c6217f2SLouis Dionne # error "__cpp_lib_make_from_tuple should not be defined before c++17" 492c6217f2SLouis Dionne # endif 502c6217f2SLouis Dionne 512c6217f2SLouis Dionne # ifdef __cpp_lib_ranges_zip 5271400505SMark de Wever # error "__cpp_lib_ranges_zip should not be defined before c++23" 532c6217f2SLouis Dionne # endif 542c6217f2SLouis Dionne 552c6217f2SLouis Dionne # ifdef __cpp_lib_tuple_element_t 562c6217f2SLouis Dionne # error "__cpp_lib_tuple_element_t should not be defined before c++14" 572c6217f2SLouis Dionne # endif 582c6217f2SLouis Dionne 59f49ccca8SMark de Wever # ifdef __cpp_lib_tuple_like 60f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should not be defined before c++23" 61f49ccca8SMark de Wever # endif 62f49ccca8SMark de Wever 632c6217f2SLouis Dionne # ifdef __cpp_lib_tuples_by_type 642c6217f2SLouis Dionne # error "__cpp_lib_tuples_by_type should not be defined before c++14" 652c6217f2SLouis Dionne # endif 662c6217f2SLouis Dionne 672c6217f2SLouis Dionne #elif TEST_STD_VER == 14 682c6217f2SLouis Dionne 692c6217f2SLouis Dionne # ifdef __cpp_lib_apply 702c6217f2SLouis Dionne # error "__cpp_lib_apply should not be defined before c++17" 712c6217f2SLouis Dionne # endif 722c6217f2SLouis Dionne 732c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_tuple 742c6217f2SLouis Dionne # error "__cpp_lib_constexpr_tuple should not be defined before c++20" 752c6217f2SLouis Dionne # endif 762c6217f2SLouis Dionne 77*b699a9baSLouis Dionne # ifdef __cpp_lib_constrained_equality 78*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should not be defined before c++26" 79*b699a9baSLouis Dionne # endif 80*b699a9baSLouis Dionne 812c6217f2SLouis Dionne # ifdef __cpp_lib_make_from_tuple 822c6217f2SLouis Dionne # error "__cpp_lib_make_from_tuple should not be defined before c++17" 832c6217f2SLouis Dionne # endif 842c6217f2SLouis Dionne 852c6217f2SLouis Dionne # ifdef __cpp_lib_ranges_zip 8671400505SMark de Wever # error "__cpp_lib_ranges_zip should not be defined before c++23" 872c6217f2SLouis Dionne # endif 882c6217f2SLouis Dionne 892c6217f2SLouis Dionne # ifndef __cpp_lib_tuple_element_t 902c6217f2SLouis Dionne # error "__cpp_lib_tuple_element_t should be defined in c++14" 912c6217f2SLouis Dionne # endif 922c6217f2SLouis Dionne # if __cpp_lib_tuple_element_t != 201402L 932c6217f2SLouis Dionne # error "__cpp_lib_tuple_element_t should have the value 201402L in c++14" 942c6217f2SLouis Dionne # endif 952c6217f2SLouis Dionne 96f49ccca8SMark de Wever # ifdef __cpp_lib_tuple_like 97f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should not be defined before c++23" 98f49ccca8SMark de Wever # endif 99f49ccca8SMark de Wever 1002c6217f2SLouis Dionne # ifndef __cpp_lib_tuples_by_type 1012c6217f2SLouis Dionne # error "__cpp_lib_tuples_by_type should be defined in c++14" 1022c6217f2SLouis Dionne # endif 1032c6217f2SLouis Dionne # if __cpp_lib_tuples_by_type != 201304L 1042c6217f2SLouis Dionne # error "__cpp_lib_tuples_by_type should have the value 201304L in c++14" 1052c6217f2SLouis Dionne # endif 1062c6217f2SLouis Dionne 1072c6217f2SLouis Dionne #elif TEST_STD_VER == 17 1082c6217f2SLouis Dionne 1092c6217f2SLouis Dionne # ifndef __cpp_lib_apply 1102c6217f2SLouis Dionne # error "__cpp_lib_apply should be defined in c++17" 1112c6217f2SLouis Dionne # endif 1122c6217f2SLouis Dionne # if __cpp_lib_apply != 201603L 1132c6217f2SLouis Dionne # error "__cpp_lib_apply should have the value 201603L in c++17" 1142c6217f2SLouis Dionne # endif 1152c6217f2SLouis Dionne 1162c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_tuple 1172c6217f2SLouis Dionne # error "__cpp_lib_constexpr_tuple should not be defined before c++20" 1182c6217f2SLouis Dionne # endif 1192c6217f2SLouis Dionne 120*b699a9baSLouis Dionne # ifdef __cpp_lib_constrained_equality 121*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should not be defined before c++26" 122*b699a9baSLouis Dionne # endif 123*b699a9baSLouis Dionne 1242c6217f2SLouis Dionne # ifndef __cpp_lib_make_from_tuple 1252c6217f2SLouis Dionne # error "__cpp_lib_make_from_tuple should be defined in c++17" 1262c6217f2SLouis Dionne # endif 1272c6217f2SLouis Dionne # if __cpp_lib_make_from_tuple != 201606L 1282c6217f2SLouis Dionne # error "__cpp_lib_make_from_tuple should have the value 201606L in c++17" 1292c6217f2SLouis Dionne # endif 1302c6217f2SLouis Dionne 1312c6217f2SLouis Dionne # ifdef __cpp_lib_ranges_zip 13271400505SMark de Wever # error "__cpp_lib_ranges_zip should not be defined before c++23" 1332c6217f2SLouis Dionne # endif 1342c6217f2SLouis Dionne 1352c6217f2SLouis Dionne # ifndef __cpp_lib_tuple_element_t 1362c6217f2SLouis Dionne # error "__cpp_lib_tuple_element_t should be defined in c++17" 1372c6217f2SLouis Dionne # endif 1382c6217f2SLouis Dionne # if __cpp_lib_tuple_element_t != 201402L 1392c6217f2SLouis Dionne # error "__cpp_lib_tuple_element_t should have the value 201402L in c++17" 1402c6217f2SLouis Dionne # endif 1412c6217f2SLouis Dionne 142f49ccca8SMark de Wever # ifdef __cpp_lib_tuple_like 143f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should not be defined before c++23" 144f49ccca8SMark de Wever # endif 145f49ccca8SMark de Wever 1462c6217f2SLouis Dionne # ifndef __cpp_lib_tuples_by_type 1472c6217f2SLouis Dionne # error "__cpp_lib_tuples_by_type should be defined in c++17" 1482c6217f2SLouis Dionne # endif 1492c6217f2SLouis Dionne # if __cpp_lib_tuples_by_type != 201304L 1502c6217f2SLouis Dionne # error "__cpp_lib_tuples_by_type should have the value 201304L in c++17" 1512c6217f2SLouis Dionne # endif 1522c6217f2SLouis Dionne 1532c6217f2SLouis Dionne #elif TEST_STD_VER == 20 1542c6217f2SLouis Dionne 1552c6217f2SLouis Dionne # ifndef __cpp_lib_apply 1562c6217f2SLouis Dionne # error "__cpp_lib_apply should be defined in c++20" 1572c6217f2SLouis Dionne # endif 1582c6217f2SLouis Dionne # if __cpp_lib_apply != 201603L 1592c6217f2SLouis Dionne # error "__cpp_lib_apply should have the value 201603L in c++20" 1602c6217f2SLouis Dionne # endif 1612c6217f2SLouis Dionne 1622c6217f2SLouis Dionne # ifndef __cpp_lib_constexpr_tuple 1632c6217f2SLouis Dionne # error "__cpp_lib_constexpr_tuple should be defined in c++20" 1642c6217f2SLouis Dionne # endif 1652c6217f2SLouis Dionne # if __cpp_lib_constexpr_tuple != 201811L 1662c6217f2SLouis Dionne # error "__cpp_lib_constexpr_tuple should have the value 201811L in c++20" 1672c6217f2SLouis Dionne # endif 1682c6217f2SLouis Dionne 169*b699a9baSLouis Dionne # ifdef __cpp_lib_constrained_equality 170*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should not be defined before c++26" 171*b699a9baSLouis Dionne # endif 172*b699a9baSLouis Dionne 1732c6217f2SLouis Dionne # ifndef __cpp_lib_make_from_tuple 1742c6217f2SLouis Dionne # error "__cpp_lib_make_from_tuple should be defined in c++20" 1752c6217f2SLouis Dionne # endif 1762c6217f2SLouis Dionne # if __cpp_lib_make_from_tuple != 201606L 1772c6217f2SLouis Dionne # error "__cpp_lib_make_from_tuple should have the value 201606L in c++20" 1782c6217f2SLouis Dionne # endif 1792c6217f2SLouis Dionne 1802c6217f2SLouis Dionne # ifdef __cpp_lib_ranges_zip 18171400505SMark de Wever # error "__cpp_lib_ranges_zip should not be defined before c++23" 1822c6217f2SLouis Dionne # endif 1832c6217f2SLouis Dionne 1842c6217f2SLouis Dionne # ifndef __cpp_lib_tuple_element_t 1852c6217f2SLouis Dionne # error "__cpp_lib_tuple_element_t should be defined in c++20" 1862c6217f2SLouis Dionne # endif 1872c6217f2SLouis Dionne # if __cpp_lib_tuple_element_t != 201402L 1882c6217f2SLouis Dionne # error "__cpp_lib_tuple_element_t should have the value 201402L in c++20" 1892c6217f2SLouis Dionne # endif 1902c6217f2SLouis Dionne 191f49ccca8SMark de Wever # ifdef __cpp_lib_tuple_like 192f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should not be defined before c++23" 193f49ccca8SMark de Wever # endif 194f49ccca8SMark de Wever 1952c6217f2SLouis Dionne # ifndef __cpp_lib_tuples_by_type 1962c6217f2SLouis Dionne # error "__cpp_lib_tuples_by_type should be defined in c++20" 1972c6217f2SLouis Dionne # endif 1982c6217f2SLouis Dionne # if __cpp_lib_tuples_by_type != 201304L 1992c6217f2SLouis Dionne # error "__cpp_lib_tuples_by_type should have the value 201304L in c++20" 2002c6217f2SLouis Dionne # endif 2012c6217f2SLouis Dionne 20200c97cbcSMark de Wever #elif TEST_STD_VER == 23 2032c6217f2SLouis Dionne 2042c6217f2SLouis Dionne # ifndef __cpp_lib_apply 20571400505SMark de Wever # error "__cpp_lib_apply should be defined in c++23" 2062c6217f2SLouis Dionne # endif 2072c6217f2SLouis Dionne # if __cpp_lib_apply != 201603L 20871400505SMark de Wever # error "__cpp_lib_apply should have the value 201603L in c++23" 2092c6217f2SLouis Dionne # endif 2102c6217f2SLouis Dionne 2112c6217f2SLouis Dionne # ifndef __cpp_lib_constexpr_tuple 21271400505SMark de Wever # error "__cpp_lib_constexpr_tuple should be defined in c++23" 2132c6217f2SLouis Dionne # endif 2142c6217f2SLouis Dionne # if __cpp_lib_constexpr_tuple != 201811L 21571400505SMark de Wever # error "__cpp_lib_constexpr_tuple should have the value 201811L in c++23" 2162c6217f2SLouis Dionne # endif 2172c6217f2SLouis Dionne 218*b699a9baSLouis Dionne # ifdef __cpp_lib_constrained_equality 219*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should not be defined before c++26" 220*b699a9baSLouis Dionne # endif 221*b699a9baSLouis Dionne 2222c6217f2SLouis Dionne # ifndef __cpp_lib_make_from_tuple 22371400505SMark de Wever # error "__cpp_lib_make_from_tuple should be defined in c++23" 2242c6217f2SLouis Dionne # endif 2252c6217f2SLouis Dionne # if __cpp_lib_make_from_tuple != 201606L 22671400505SMark de Wever # error "__cpp_lib_make_from_tuple should have the value 201606L in c++23" 2272c6217f2SLouis Dionne # endif 2282c6217f2SLouis Dionne 2292c6217f2SLouis Dionne # if !defined(_LIBCPP_VERSION) 2302c6217f2SLouis Dionne # ifndef __cpp_lib_ranges_zip 23171400505SMark de Wever # error "__cpp_lib_ranges_zip should be defined in c++23" 2322c6217f2SLouis Dionne # endif 2332c6217f2SLouis Dionne # if __cpp_lib_ranges_zip != 202110L 23471400505SMark de Wever # error "__cpp_lib_ranges_zip should have the value 202110L in c++23" 2352c6217f2SLouis Dionne # endif 2362c6217f2SLouis Dionne # else // _LIBCPP_VERSION 2372c6217f2SLouis Dionne # ifdef __cpp_lib_ranges_zip 2382c6217f2SLouis Dionne # error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" 2392c6217f2SLouis Dionne # endif 2402c6217f2SLouis Dionne # endif 2412c6217f2SLouis Dionne 2422c6217f2SLouis Dionne # ifndef __cpp_lib_tuple_element_t 24371400505SMark de Wever # error "__cpp_lib_tuple_element_t should be defined in c++23" 2442c6217f2SLouis Dionne # endif 2452c6217f2SLouis Dionne # if __cpp_lib_tuple_element_t != 201402L 24671400505SMark de Wever # error "__cpp_lib_tuple_element_t should have the value 201402L in c++23" 2472c6217f2SLouis Dionne # endif 2482c6217f2SLouis Dionne 249f49ccca8SMark de Wever # if !defined(_LIBCPP_VERSION) 250f49ccca8SMark de Wever # ifndef __cpp_lib_tuple_like 251f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should be defined in c++23" 252f49ccca8SMark de Wever # endif 253f49ccca8SMark de Wever # if __cpp_lib_tuple_like != 202207L 254f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should have the value 202207L in c++23" 255f49ccca8SMark de Wever # endif 256f49ccca8SMark de Wever # else // _LIBCPP_VERSION 257f49ccca8SMark de Wever # ifdef __cpp_lib_tuple_like 258f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" 259f49ccca8SMark de Wever # endif 260f49ccca8SMark de Wever # endif 261f49ccca8SMark de Wever 2622c6217f2SLouis Dionne # ifndef __cpp_lib_tuples_by_type 26371400505SMark de Wever # error "__cpp_lib_tuples_by_type should be defined in c++23" 2642c6217f2SLouis Dionne # endif 2652c6217f2SLouis Dionne # if __cpp_lib_tuples_by_type != 201304L 26671400505SMark de Wever # error "__cpp_lib_tuples_by_type should have the value 201304L in c++23" 2672c6217f2SLouis Dionne # endif 2682c6217f2SLouis Dionne 26900c97cbcSMark de Wever #elif TEST_STD_VER > 23 27000c97cbcSMark de Wever 27100c97cbcSMark de Wever # ifndef __cpp_lib_apply 27200c97cbcSMark de Wever # error "__cpp_lib_apply should be defined in c++26" 27300c97cbcSMark de Wever # endif 27400c97cbcSMark de Wever # if __cpp_lib_apply != 201603L 27500c97cbcSMark de Wever # error "__cpp_lib_apply should have the value 201603L in c++26" 27600c97cbcSMark de Wever # endif 27700c97cbcSMark de Wever 27800c97cbcSMark de Wever # ifndef __cpp_lib_constexpr_tuple 27900c97cbcSMark de Wever # error "__cpp_lib_constexpr_tuple should be defined in c++26" 28000c97cbcSMark de Wever # endif 28100c97cbcSMark de Wever # if __cpp_lib_constexpr_tuple != 201811L 28200c97cbcSMark de Wever # error "__cpp_lib_constexpr_tuple should have the value 201811L in c++26" 28300c97cbcSMark de Wever # endif 28400c97cbcSMark de Wever 285*b699a9baSLouis Dionne # if !defined(_LIBCPP_VERSION) 286*b699a9baSLouis Dionne # ifndef __cpp_lib_constrained_equality 287*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should be defined in c++26" 288*b699a9baSLouis Dionne # endif 289*b699a9baSLouis Dionne # if __cpp_lib_constrained_equality != 202403L 290*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should have the value 202403L in c++26" 291*b699a9baSLouis Dionne # endif 292*b699a9baSLouis Dionne # else // _LIBCPP_VERSION 293*b699a9baSLouis Dionne # ifdef __cpp_lib_constrained_equality 294*b699a9baSLouis Dionne # error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!" 295*b699a9baSLouis Dionne # endif 296*b699a9baSLouis Dionne # endif 297*b699a9baSLouis Dionne 29800c97cbcSMark de Wever # ifndef __cpp_lib_make_from_tuple 29900c97cbcSMark de Wever # error "__cpp_lib_make_from_tuple should be defined in c++26" 30000c97cbcSMark de Wever # endif 30100c97cbcSMark de Wever # if __cpp_lib_make_from_tuple != 201606L 30200c97cbcSMark de Wever # error "__cpp_lib_make_from_tuple should have the value 201606L in c++26" 30300c97cbcSMark de Wever # endif 30400c97cbcSMark de Wever 30500c97cbcSMark de Wever # if !defined(_LIBCPP_VERSION) 30600c97cbcSMark de Wever # ifndef __cpp_lib_ranges_zip 30700c97cbcSMark de Wever # error "__cpp_lib_ranges_zip should be defined in c++26" 30800c97cbcSMark de Wever # endif 30900c97cbcSMark de Wever # if __cpp_lib_ranges_zip != 202110L 31000c97cbcSMark de Wever # error "__cpp_lib_ranges_zip should have the value 202110L in c++26" 31100c97cbcSMark de Wever # endif 31200c97cbcSMark de Wever # else // _LIBCPP_VERSION 31300c97cbcSMark de Wever # ifdef __cpp_lib_ranges_zip 31400c97cbcSMark de Wever # error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" 31500c97cbcSMark de Wever # endif 31600c97cbcSMark de Wever # endif 31700c97cbcSMark de Wever 31800c97cbcSMark de Wever # ifndef __cpp_lib_tuple_element_t 31900c97cbcSMark de Wever # error "__cpp_lib_tuple_element_t should be defined in c++26" 32000c97cbcSMark de Wever # endif 32100c97cbcSMark de Wever # if __cpp_lib_tuple_element_t != 201402L 32200c97cbcSMark de Wever # error "__cpp_lib_tuple_element_t should have the value 201402L in c++26" 32300c97cbcSMark de Wever # endif 32400c97cbcSMark de Wever 325f49ccca8SMark de Wever # if !defined(_LIBCPP_VERSION) 326f49ccca8SMark de Wever # ifndef __cpp_lib_tuple_like 327f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should be defined in c++26" 328f49ccca8SMark de Wever # endif 329f49ccca8SMark de Wever # if __cpp_lib_tuple_like != 202311L 330f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should have the value 202311L in c++26" 331f49ccca8SMark de Wever # endif 332f49ccca8SMark de Wever # else // _LIBCPP_VERSION 333f49ccca8SMark de Wever # ifdef __cpp_lib_tuple_like 334f49ccca8SMark de Wever # error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" 335f49ccca8SMark de Wever # endif 336f49ccca8SMark de Wever # endif 337f49ccca8SMark de Wever 33800c97cbcSMark de Wever # ifndef __cpp_lib_tuples_by_type 33900c97cbcSMark de Wever # error "__cpp_lib_tuples_by_type should be defined in c++26" 34000c97cbcSMark de Wever # endif 34100c97cbcSMark de Wever # if __cpp_lib_tuples_by_type != 201304L 34200c97cbcSMark de Wever # error "__cpp_lib_tuples_by_type should have the value 201304L in c++26" 34300c97cbcSMark de Wever # endif 34400c97cbcSMark de Wever 34500c97cbcSMark de Wever #endif // TEST_STD_VER > 23 3462c6217f2SLouis Dionne 347