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 // <array> 152c6217f2SLouis Dionne 162c6217f2SLouis Dionne // Test the feature test macros defined by <array> 172c6217f2SLouis Dionne 182c6217f2SLouis Dionne /* Constant Value 192c6217f2SLouis Dionne __cpp_lib_array_constexpr 201603L [C++17] 202c6217f2SLouis Dionne 201811L [C++20] 21*f49ccca8SMark de Wever __cpp_lib_freestanding_array 202311L [C++26] 222c6217f2SLouis Dionne __cpp_lib_nonmember_container_access 201411L [C++17] 232c6217f2SLouis Dionne __cpp_lib_to_array 201907L [C++20] 242c6217f2SLouis Dionne */ 252c6217f2SLouis Dionne 262c6217f2SLouis Dionne #include <array> 272c6217f2SLouis Dionne #include "test_macros.h" 282c6217f2SLouis Dionne 292c6217f2SLouis Dionne #if TEST_STD_VER < 14 302c6217f2SLouis Dionne 312c6217f2SLouis Dionne # ifdef __cpp_lib_array_constexpr 322c6217f2SLouis Dionne # error "__cpp_lib_array_constexpr should not be defined before c++17" 332c6217f2SLouis Dionne # endif 342c6217f2SLouis Dionne 35*f49ccca8SMark de Wever # ifdef __cpp_lib_freestanding_array 36*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should not be defined before c++26" 37*f49ccca8SMark de Wever # endif 38*f49ccca8SMark de Wever 392c6217f2SLouis Dionne # ifdef __cpp_lib_nonmember_container_access 402c6217f2SLouis Dionne # error "__cpp_lib_nonmember_container_access should not be defined before c++17" 412c6217f2SLouis Dionne # endif 422c6217f2SLouis Dionne 432c6217f2SLouis Dionne # ifdef __cpp_lib_to_array 442c6217f2SLouis Dionne # error "__cpp_lib_to_array should not be defined before c++20" 452c6217f2SLouis Dionne # endif 462c6217f2SLouis Dionne 472c6217f2SLouis Dionne #elif TEST_STD_VER == 14 482c6217f2SLouis Dionne 492c6217f2SLouis Dionne # ifdef __cpp_lib_array_constexpr 502c6217f2SLouis Dionne # error "__cpp_lib_array_constexpr should not be defined before c++17" 512c6217f2SLouis Dionne # endif 522c6217f2SLouis Dionne 53*f49ccca8SMark de Wever # ifdef __cpp_lib_freestanding_array 54*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should not be defined before c++26" 55*f49ccca8SMark de Wever # endif 56*f49ccca8SMark de Wever 572c6217f2SLouis Dionne # ifdef __cpp_lib_nonmember_container_access 582c6217f2SLouis Dionne # error "__cpp_lib_nonmember_container_access should not be defined before c++17" 592c6217f2SLouis Dionne # endif 602c6217f2SLouis Dionne 612c6217f2SLouis Dionne # ifdef __cpp_lib_to_array 622c6217f2SLouis Dionne # error "__cpp_lib_to_array should not be defined before c++20" 632c6217f2SLouis Dionne # endif 642c6217f2SLouis Dionne 652c6217f2SLouis Dionne #elif TEST_STD_VER == 17 662c6217f2SLouis Dionne 672c6217f2SLouis Dionne # ifndef __cpp_lib_array_constexpr 682c6217f2SLouis Dionne # error "__cpp_lib_array_constexpr should be defined in c++17" 692c6217f2SLouis Dionne # endif 702c6217f2SLouis Dionne # if __cpp_lib_array_constexpr != 201603L 712c6217f2SLouis Dionne # error "__cpp_lib_array_constexpr should have the value 201603L in c++17" 722c6217f2SLouis Dionne # endif 732c6217f2SLouis Dionne 74*f49ccca8SMark de Wever # ifdef __cpp_lib_freestanding_array 75*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should not be defined before c++26" 76*f49ccca8SMark de Wever # endif 77*f49ccca8SMark de Wever 782c6217f2SLouis Dionne # ifndef __cpp_lib_nonmember_container_access 792c6217f2SLouis Dionne # error "__cpp_lib_nonmember_container_access should be defined in c++17" 802c6217f2SLouis Dionne # endif 812c6217f2SLouis Dionne # if __cpp_lib_nonmember_container_access != 201411L 822c6217f2SLouis Dionne # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" 832c6217f2SLouis Dionne # endif 842c6217f2SLouis Dionne 852c6217f2SLouis Dionne # ifdef __cpp_lib_to_array 862c6217f2SLouis Dionne # error "__cpp_lib_to_array should not be defined before c++20" 872c6217f2SLouis Dionne # endif 882c6217f2SLouis Dionne 892c6217f2SLouis Dionne #elif TEST_STD_VER == 20 902c6217f2SLouis Dionne 912c6217f2SLouis Dionne # ifndef __cpp_lib_array_constexpr 922c6217f2SLouis Dionne # error "__cpp_lib_array_constexpr should be defined in c++20" 932c6217f2SLouis Dionne # endif 942c6217f2SLouis Dionne # if __cpp_lib_array_constexpr != 201811L 952c6217f2SLouis Dionne # error "__cpp_lib_array_constexpr should have the value 201811L in c++20" 962c6217f2SLouis Dionne # endif 972c6217f2SLouis Dionne 98*f49ccca8SMark de Wever # ifdef __cpp_lib_freestanding_array 99*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should not be defined before c++26" 100*f49ccca8SMark de Wever # endif 101*f49ccca8SMark de Wever 1022c6217f2SLouis Dionne # ifndef __cpp_lib_nonmember_container_access 1032c6217f2SLouis Dionne # error "__cpp_lib_nonmember_container_access should be defined in c++20" 1042c6217f2SLouis Dionne # endif 1052c6217f2SLouis Dionne # if __cpp_lib_nonmember_container_access != 201411L 1062c6217f2SLouis Dionne # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" 1072c6217f2SLouis Dionne # endif 1082c6217f2SLouis Dionne 1092c6217f2SLouis Dionne # ifndef __cpp_lib_to_array 1102c6217f2SLouis Dionne # error "__cpp_lib_to_array should be defined in c++20" 1112c6217f2SLouis Dionne # endif 1122c6217f2SLouis Dionne # if __cpp_lib_to_array != 201907L 1132c6217f2SLouis Dionne # error "__cpp_lib_to_array should have the value 201907L in c++20" 1142c6217f2SLouis Dionne # endif 1152c6217f2SLouis Dionne 11600c97cbcSMark de Wever #elif TEST_STD_VER == 23 1172c6217f2SLouis Dionne 1182c6217f2SLouis Dionne # ifndef __cpp_lib_array_constexpr 11971400505SMark de Wever # error "__cpp_lib_array_constexpr should be defined in c++23" 1202c6217f2SLouis Dionne # endif 1212c6217f2SLouis Dionne # if __cpp_lib_array_constexpr != 201811L 12271400505SMark de Wever # error "__cpp_lib_array_constexpr should have the value 201811L in c++23" 1232c6217f2SLouis Dionne # endif 1242c6217f2SLouis Dionne 125*f49ccca8SMark de Wever # ifdef __cpp_lib_freestanding_array 126*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should not be defined before c++26" 127*f49ccca8SMark de Wever # endif 128*f49ccca8SMark de Wever 1292c6217f2SLouis Dionne # ifndef __cpp_lib_nonmember_container_access 13071400505SMark de Wever # error "__cpp_lib_nonmember_container_access should be defined in c++23" 1312c6217f2SLouis Dionne # endif 1322c6217f2SLouis Dionne # if __cpp_lib_nonmember_container_access != 201411L 13371400505SMark de Wever # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" 1342c6217f2SLouis Dionne # endif 1352c6217f2SLouis Dionne 1362c6217f2SLouis Dionne # ifndef __cpp_lib_to_array 13771400505SMark de Wever # error "__cpp_lib_to_array should be defined in c++23" 1382c6217f2SLouis Dionne # endif 1392c6217f2SLouis Dionne # if __cpp_lib_to_array != 201907L 14071400505SMark de Wever # error "__cpp_lib_to_array should have the value 201907L in c++23" 1412c6217f2SLouis Dionne # endif 1422c6217f2SLouis Dionne 14300c97cbcSMark de Wever #elif TEST_STD_VER > 23 14400c97cbcSMark de Wever 14500c97cbcSMark de Wever # ifndef __cpp_lib_array_constexpr 14600c97cbcSMark de Wever # error "__cpp_lib_array_constexpr should be defined in c++26" 14700c97cbcSMark de Wever # endif 14800c97cbcSMark de Wever # if __cpp_lib_array_constexpr != 201811L 14900c97cbcSMark de Wever # error "__cpp_lib_array_constexpr should have the value 201811L in c++26" 15000c97cbcSMark de Wever # endif 15100c97cbcSMark de Wever 152*f49ccca8SMark de Wever # if !defined(_LIBCPP_VERSION) 153*f49ccca8SMark de Wever # ifndef __cpp_lib_freestanding_array 154*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should be defined in c++26" 155*f49ccca8SMark de Wever # endif 156*f49ccca8SMark de Wever # if __cpp_lib_freestanding_array != 202311L 157*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should have the value 202311L in c++26" 158*f49ccca8SMark de Wever # endif 159*f49ccca8SMark de Wever # else // _LIBCPP_VERSION 160*f49ccca8SMark de Wever # ifdef __cpp_lib_freestanding_array 161*f49ccca8SMark de Wever # error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!" 162*f49ccca8SMark de Wever # endif 163*f49ccca8SMark de Wever # endif 164*f49ccca8SMark de Wever 16500c97cbcSMark de Wever # ifndef __cpp_lib_nonmember_container_access 16600c97cbcSMark de Wever # error "__cpp_lib_nonmember_container_access should be defined in c++26" 16700c97cbcSMark de Wever # endif 16800c97cbcSMark de Wever # if __cpp_lib_nonmember_container_access != 201411L 16900c97cbcSMark de Wever # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" 17000c97cbcSMark de Wever # endif 17100c97cbcSMark de Wever 17200c97cbcSMark de Wever # ifndef __cpp_lib_to_array 17300c97cbcSMark de Wever # error "__cpp_lib_to_array should be defined in c++26" 17400c97cbcSMark de Wever # endif 17500c97cbcSMark de Wever # if __cpp_lib_to_array != 201907L 17600c97cbcSMark de Wever # error "__cpp_lib_to_array should have the value 201907L in c++26" 17700c97cbcSMark de Wever # endif 17800c97cbcSMark de Wever 17900c97cbcSMark de Wever #endif // TEST_STD_VER > 23 1802c6217f2SLouis Dionne 181