array.version.pass.cpp (3299B)
1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // WARNING: This test was generated by generate_feature_test_macro_components.py 11 // and should not be edited manually. 12 13 // <array> 14 15 // Test the feature test macros defined by <array> 16 17 /* Constant Value 18 __cpp_lib_array_constexpr 201603L [C++17] 19 __cpp_lib_constexpr_misc 201811L [C++2a] 20 __cpp_lib_nonmember_container_access 201411L [C++17] 21 */ 22 23 #include <array> 24 #include "test_macros.h" 25 26 #if TEST_STD_VER < 14 27 28 # ifdef __cpp_lib_array_constexpr 29 # error "__cpp_lib_array_constexpr should not be defined before c++17" 30 # endif 31 32 # ifdef __cpp_lib_constexpr_misc 33 # error "__cpp_lib_constexpr_misc should not be defined before c++2a" 34 # endif 35 36 # ifdef __cpp_lib_nonmember_container_access 37 # error "__cpp_lib_nonmember_container_access should not be defined before c++17" 38 # endif 39 40 #elif TEST_STD_VER == 14 41 42 # ifdef __cpp_lib_array_constexpr 43 # error "__cpp_lib_array_constexpr should not be defined before c++17" 44 # endif 45 46 # ifdef __cpp_lib_constexpr_misc 47 # error "__cpp_lib_constexpr_misc should not be defined before c++2a" 48 # endif 49 50 # ifdef __cpp_lib_nonmember_container_access 51 # error "__cpp_lib_nonmember_container_access should not be defined before c++17" 52 # endif 53 54 #elif TEST_STD_VER == 17 55 56 # ifndef __cpp_lib_array_constexpr 57 # error "__cpp_lib_array_constexpr should be defined in c++17" 58 # endif 59 # if __cpp_lib_array_constexpr != 201603L 60 # error "__cpp_lib_array_constexpr should have the value 201603L in c++17" 61 # endif 62 63 # ifdef __cpp_lib_constexpr_misc 64 # error "__cpp_lib_constexpr_misc should not be defined before c++2a" 65 # endif 66 67 # ifndef __cpp_lib_nonmember_container_access 68 # error "__cpp_lib_nonmember_container_access should be defined in c++17" 69 # endif 70 # if __cpp_lib_nonmember_container_access != 201411L 71 # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" 72 # endif 73 74 #elif TEST_STD_VER > 17 75 76 # ifndef __cpp_lib_array_constexpr 77 # error "__cpp_lib_array_constexpr should be defined in c++2a" 78 # endif 79 # if __cpp_lib_array_constexpr != 201603L 80 # error "__cpp_lib_array_constexpr should have the value 201603L in c++2a" 81 # endif 82 83 # if !defined(_LIBCPP_VERSION) 84 # ifndef __cpp_lib_constexpr_misc 85 # error "__cpp_lib_constexpr_misc should be defined in c++2a" 86 # endif 87 # if __cpp_lib_constexpr_misc != 201811L 88 # error "__cpp_lib_constexpr_misc should have the value 201811L in c++2a" 89 # endif 90 # else // _LIBCPP_VERSION 91 # ifdef __cpp_lib_constexpr_misc 92 # error "__cpp_lib_constexpr_misc should not be defined because it is unimplemented in libc++!" 93 # endif 94 # endif 95 96 # ifndef __cpp_lib_nonmember_container_access 97 # error "__cpp_lib_nonmember_container_access should be defined in c++2a" 98 # endif 99 # if __cpp_lib_nonmember_container_access != 201411L 100 # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2a" 101 # endif 102 103 #endif // TEST_STD_VER > 17 104 105 int main() {}