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 // <vector> 15 16 // Test the feature test macros defined by <vector> 17 18 /* Constant Value 19 __cpp_lib_allocator_traits_is_always_equal 201411L [C++17] 20 __cpp_lib_constexpr_vector 201907L [C++20] 21 __cpp_lib_erase_if 202002L [C++20] 22 __cpp_lib_incomplete_container_elements 201505L [C++17] 23 __cpp_lib_nonmember_container_access 201411L [C++17] 24 __cpp_lib_ranges_to_container 202202L [C++2b] 25 */ 26 27 #include <vector> 28 #include "test_macros.h" 29 30 #if TEST_STD_VER < 14 31 32 # ifdef __cpp_lib_allocator_traits_is_always_equal 33 # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" 34 # endif 35 36 # ifdef __cpp_lib_constexpr_vector 37 # error "__cpp_lib_constexpr_vector should not be defined before c++20" 38 # endif 39 40 # ifdef __cpp_lib_erase_if 41 # error "__cpp_lib_erase_if should not be defined before c++20" 42 # endif 43 44 # ifdef __cpp_lib_incomplete_container_elements 45 # error "__cpp_lib_incomplete_container_elements should not be defined before c++17" 46 # endif 47 48 # ifdef __cpp_lib_nonmember_container_access 49 # error "__cpp_lib_nonmember_container_access should not be defined before c++17" 50 # endif 51 52 # ifdef __cpp_lib_ranges_to_container 53 # error "__cpp_lib_ranges_to_container should not be defined before c++2b" 54 # endif 55 56 #elif TEST_STD_VER == 14 57 58 # ifdef __cpp_lib_allocator_traits_is_always_equal 59 # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" 60 # endif 61 62 # ifdef __cpp_lib_constexpr_vector 63 # error "__cpp_lib_constexpr_vector should not be defined before c++20" 64 # endif 65 66 # ifdef __cpp_lib_erase_if 67 # error "__cpp_lib_erase_if should not be defined before c++20" 68 # endif 69 70 # ifdef __cpp_lib_incomplete_container_elements 71 # error "__cpp_lib_incomplete_container_elements should not be defined before c++17" 72 # endif 73 74 # ifdef __cpp_lib_nonmember_container_access 75 # error "__cpp_lib_nonmember_container_access should not be defined before c++17" 76 # endif 77 78 # ifdef __cpp_lib_ranges_to_container 79 # error "__cpp_lib_ranges_to_container should not be defined before c++2b" 80 # endif 81 82 #elif TEST_STD_VER == 17 83 84 # ifndef __cpp_lib_allocator_traits_is_always_equal 85 # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" 86 # endif 87 # if __cpp_lib_allocator_traits_is_always_equal != 201411L 88 # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" 89 # endif 90 91 # ifdef __cpp_lib_constexpr_vector 92 # error "__cpp_lib_constexpr_vector should not be defined before c++20" 93 # endif 94 95 # ifdef __cpp_lib_erase_if 96 # error "__cpp_lib_erase_if should not be defined before c++20" 97 # endif 98 99 # ifndef __cpp_lib_incomplete_container_elements 100 # error "__cpp_lib_incomplete_container_elements should be defined in c++17" 101 # endif 102 # if __cpp_lib_incomplete_container_elements != 201505L 103 # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17" 104 # endif 105 106 # ifndef __cpp_lib_nonmember_container_access 107 # error "__cpp_lib_nonmember_container_access should be defined in c++17" 108 # endif 109 # if __cpp_lib_nonmember_container_access != 201411L 110 # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" 111 # endif 112 113 # ifdef __cpp_lib_ranges_to_container 114 # error "__cpp_lib_ranges_to_container should not be defined before c++2b" 115 # endif 116 117 #elif TEST_STD_VER == 20 118 119 # ifndef __cpp_lib_allocator_traits_is_always_equal 120 # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" 121 # endif 122 # if __cpp_lib_allocator_traits_is_always_equal != 201411L 123 # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" 124 # endif 125 126 # if !defined(_LIBCPP_VERSION) 127 # ifndef __cpp_lib_constexpr_vector 128 # error "__cpp_lib_constexpr_vector should be defined in c++20" 129 # endif 130 # if __cpp_lib_constexpr_vector != 201907L 131 # error "__cpp_lib_constexpr_vector should have the value 201907L in c++20" 132 # endif 133 # else // _LIBCPP_VERSION 134 # ifdef __cpp_lib_constexpr_vector 135 # error "__cpp_lib_constexpr_vector should not be defined because it is unimplemented in libc++!" 136 # endif 137 # endif 138 139 # ifndef __cpp_lib_erase_if 140 # error "__cpp_lib_erase_if should be defined in c++20" 141 # endif 142 # if __cpp_lib_erase_if != 202002L 143 # error "__cpp_lib_erase_if should have the value 202002L in c++20" 144 # endif 145 146 # ifndef __cpp_lib_incomplete_container_elements 147 # error "__cpp_lib_incomplete_container_elements should be defined in c++20" 148 # endif 149 # if __cpp_lib_incomplete_container_elements != 201505L 150 # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20" 151 # endif 152 153 # ifndef __cpp_lib_nonmember_container_access 154 # error "__cpp_lib_nonmember_container_access should be defined in c++20" 155 # endif 156 # if __cpp_lib_nonmember_container_access != 201411L 157 # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" 158 # endif 159 160 # ifdef __cpp_lib_ranges_to_container 161 # error "__cpp_lib_ranges_to_container should not be defined before c++2b" 162 # endif 163 164 #elif TEST_STD_VER > 20 165 166 # ifndef __cpp_lib_allocator_traits_is_always_equal 167 # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2b" 168 # endif 169 # if __cpp_lib_allocator_traits_is_always_equal != 201411L 170 # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2b" 171 # endif 172 173 # if !defined(_LIBCPP_VERSION) 174 # ifndef __cpp_lib_constexpr_vector 175 # error "__cpp_lib_constexpr_vector should be defined in c++2b" 176 # endif 177 # if __cpp_lib_constexpr_vector != 201907L 178 # error "__cpp_lib_constexpr_vector should have the value 201907L in c++2b" 179 # endif 180 # else // _LIBCPP_VERSION 181 # ifdef __cpp_lib_constexpr_vector 182 # error "__cpp_lib_constexpr_vector should not be defined because it is unimplemented in libc++!" 183 # endif 184 # endif 185 186 # ifndef __cpp_lib_erase_if 187 # error "__cpp_lib_erase_if should be defined in c++2b" 188 # endif 189 # if __cpp_lib_erase_if != 202002L 190 # error "__cpp_lib_erase_if should have the value 202002L in c++2b" 191 # endif 192 193 # ifndef __cpp_lib_incomplete_container_elements 194 # error "__cpp_lib_incomplete_container_elements should be defined in c++2b" 195 # endif 196 # if __cpp_lib_incomplete_container_elements != 201505L 197 # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++2b" 198 # endif 199 200 # ifndef __cpp_lib_nonmember_container_access 201 # error "__cpp_lib_nonmember_container_access should be defined in c++2b" 202 # endif 203 # if __cpp_lib_nonmember_container_access != 201411L 204 # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2b" 205 # endif 206 207 # if !defined(_LIBCPP_VERSION) 208 # ifndef __cpp_lib_ranges_to_container 209 # error "__cpp_lib_ranges_to_container should be defined in c++2b" 210 # endif 211 # if __cpp_lib_ranges_to_container != 202202L 212 # error "__cpp_lib_ranges_to_container should have the value 202202L in c++2b" 213 # endif 214 # else // _LIBCPP_VERSION 215 # ifdef __cpp_lib_ranges_to_container 216 # error "__cpp_lib_ranges_to_container should not be defined because it is unimplemented in libc++!" 217 # endif 218 # endif 219 220 #endif // TEST_STD_VER > 20 221 222