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_default_template_type_for_algorithm_values 202403L [C++26] |
22 | __cpp_lib_erase_if 202002L [C++20] |
23 | __cpp_lib_incomplete_container_elements 201505L [C++17] |
24 | __cpp_lib_nonmember_container_access 201411L [C++17] |
25 | __cpp_lib_ranges_to_container 202202L [C++23] |
26 | */ |
27 | |
28 | #include <vector> |
29 | #include "test_macros.h" |
30 | |
31 | #if TEST_STD_VER < 14 |
32 | |
33 | # ifdef __cpp_lib_allocator_traits_is_always_equal |
34 | # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" |
35 | # endif |
36 | |
37 | # ifdef __cpp_lib_constexpr_vector |
38 | # error "__cpp_lib_constexpr_vector should not be defined before c++20" |
39 | # endif |
40 | |
41 | # ifdef __cpp_lib_default_template_type_for_algorithm_values |
42 | # error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" |
43 | # endif |
44 | |
45 | # ifdef __cpp_lib_erase_if |
46 | # error "__cpp_lib_erase_if should not be defined before c++20" |
47 | # endif |
48 | |
49 | # ifdef __cpp_lib_incomplete_container_elements |
50 | # error "__cpp_lib_incomplete_container_elements should not be defined before c++17" |
51 | # endif |
52 | |
53 | # ifdef __cpp_lib_nonmember_container_access |
54 | # error "__cpp_lib_nonmember_container_access should not be defined before c++17" |
55 | # endif |
56 | |
57 | # ifdef __cpp_lib_ranges_to_container |
58 | # error "__cpp_lib_ranges_to_container should not be defined before c++23" |
59 | # endif |
60 | |
61 | #elif TEST_STD_VER == 14 |
62 | |
63 | # ifdef __cpp_lib_allocator_traits_is_always_equal |
64 | # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" |
65 | # endif |
66 | |
67 | # ifdef __cpp_lib_constexpr_vector |
68 | # error "__cpp_lib_constexpr_vector should not be defined before c++20" |
69 | # endif |
70 | |
71 | # ifdef __cpp_lib_default_template_type_for_algorithm_values |
72 | # error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" |
73 | # endif |
74 | |
75 | # ifdef __cpp_lib_erase_if |
76 | # error "__cpp_lib_erase_if should not be defined before c++20" |
77 | # endif |
78 | |
79 | # ifdef __cpp_lib_incomplete_container_elements |
80 | # error "__cpp_lib_incomplete_container_elements should not be defined before c++17" |
81 | # endif |
82 | |
83 | # ifdef __cpp_lib_nonmember_container_access |
84 | # error "__cpp_lib_nonmember_container_access should not be defined before c++17" |
85 | # endif |
86 | |
87 | # ifdef __cpp_lib_ranges_to_container |
88 | # error "__cpp_lib_ranges_to_container should not be defined before c++23" |
89 | # endif |
90 | |
91 | #elif TEST_STD_VER == 17 |
92 | |
93 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
94 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" |
95 | # endif |
96 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
97 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" |
98 | # endif |
99 | |
100 | # ifdef __cpp_lib_constexpr_vector |
101 | # error "__cpp_lib_constexpr_vector should not be defined before c++20" |
102 | # endif |
103 | |
104 | # ifdef __cpp_lib_default_template_type_for_algorithm_values |
105 | # error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" |
106 | # endif |
107 | |
108 | # ifdef __cpp_lib_erase_if |
109 | # error "__cpp_lib_erase_if should not be defined before c++20" |
110 | # endif |
111 | |
112 | # ifndef __cpp_lib_incomplete_container_elements |
113 | # error "__cpp_lib_incomplete_container_elements should be defined in c++17" |
114 | # endif |
115 | # if __cpp_lib_incomplete_container_elements != 201505L |
116 | # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17" |
117 | # endif |
118 | |
119 | # ifndef __cpp_lib_nonmember_container_access |
120 | # error "__cpp_lib_nonmember_container_access should be defined in c++17" |
121 | # endif |
122 | # if __cpp_lib_nonmember_container_access != 201411L |
123 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" |
124 | # endif |
125 | |
126 | # ifdef __cpp_lib_ranges_to_container |
127 | # error "__cpp_lib_ranges_to_container should not be defined before c++23" |
128 | # endif |
129 | |
130 | #elif TEST_STD_VER == 20 |
131 | |
132 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
133 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" |
134 | # endif |
135 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
136 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" |
137 | # endif |
138 | |
139 | # ifndef __cpp_lib_constexpr_vector |
140 | # error "__cpp_lib_constexpr_vector should be defined in c++20" |
141 | # endif |
142 | # if __cpp_lib_constexpr_vector != 201907L |
143 | # error "__cpp_lib_constexpr_vector should have the value 201907L in c++20" |
144 | # endif |
145 | |
146 | # ifdef __cpp_lib_default_template_type_for_algorithm_values |
147 | # error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" |
148 | # endif |
149 | |
150 | # ifndef __cpp_lib_erase_if |
151 | # error "__cpp_lib_erase_if should be defined in c++20" |
152 | # endif |
153 | # if __cpp_lib_erase_if != 202002L |
154 | # error "__cpp_lib_erase_if should have the value 202002L in c++20" |
155 | # endif |
156 | |
157 | # ifndef __cpp_lib_incomplete_container_elements |
158 | # error "__cpp_lib_incomplete_container_elements should be defined in c++20" |
159 | # endif |
160 | # if __cpp_lib_incomplete_container_elements != 201505L |
161 | # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20" |
162 | # endif |
163 | |
164 | # ifndef __cpp_lib_nonmember_container_access |
165 | # error "__cpp_lib_nonmember_container_access should be defined in c++20" |
166 | # endif |
167 | # if __cpp_lib_nonmember_container_access != 201411L |
168 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" |
169 | # endif |
170 | |
171 | # ifdef __cpp_lib_ranges_to_container |
172 | # error "__cpp_lib_ranges_to_container should not be defined before c++23" |
173 | # endif |
174 | |
175 | #elif TEST_STD_VER == 23 |
176 | |
177 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
178 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" |
179 | # endif |
180 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
181 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" |
182 | # endif |
183 | |
184 | # ifndef __cpp_lib_constexpr_vector |
185 | # error "__cpp_lib_constexpr_vector should be defined in c++23" |
186 | # endif |
187 | # if __cpp_lib_constexpr_vector != 201907L |
188 | # error "__cpp_lib_constexpr_vector should have the value 201907L in c++23" |
189 | # endif |
190 | |
191 | # ifdef __cpp_lib_default_template_type_for_algorithm_values |
192 | # error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" |
193 | # endif |
194 | |
195 | # ifndef __cpp_lib_erase_if |
196 | # error "__cpp_lib_erase_if should be defined in c++23" |
197 | # endif |
198 | # if __cpp_lib_erase_if != 202002L |
199 | # error "__cpp_lib_erase_if should have the value 202002L in c++23" |
200 | # endif |
201 | |
202 | # ifndef __cpp_lib_incomplete_container_elements |
203 | # error "__cpp_lib_incomplete_container_elements should be defined in c++23" |
204 | # endif |
205 | # if __cpp_lib_incomplete_container_elements != 201505L |
206 | # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23" |
207 | # endif |
208 | |
209 | # ifndef __cpp_lib_nonmember_container_access |
210 | # error "__cpp_lib_nonmember_container_access should be defined in c++23" |
211 | # endif |
212 | # if __cpp_lib_nonmember_container_access != 201411L |
213 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" |
214 | # endif |
215 | |
216 | # ifndef __cpp_lib_ranges_to_container |
217 | # error "__cpp_lib_ranges_to_container should be defined in c++23" |
218 | # endif |
219 | # if __cpp_lib_ranges_to_container != 202202L |
220 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++23" |
221 | # endif |
222 | |
223 | #elif TEST_STD_VER > 23 |
224 | |
225 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
226 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" |
227 | # endif |
228 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
229 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" |
230 | # endif |
231 | |
232 | # ifndef __cpp_lib_constexpr_vector |
233 | # error "__cpp_lib_constexpr_vector should be defined in c++26" |
234 | # endif |
235 | # if __cpp_lib_constexpr_vector != 201907L |
236 | # error "__cpp_lib_constexpr_vector should have the value 201907L in c++26" |
237 | # endif |
238 | |
239 | # if !defined(_LIBCPP_VERSION) |
240 | # ifndef __cpp_lib_default_template_type_for_algorithm_values |
241 | # error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" |
242 | # endif |
243 | # if __cpp_lib_default_template_type_for_algorithm_values != 202403L |
244 | # error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" |
245 | # endif |
246 | # else // _LIBCPP_VERSION |
247 | # ifdef __cpp_lib_default_template_type_for_algorithm_values |
248 | # error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" |
249 | # endif |
250 | # endif |
251 | |
252 | # ifndef __cpp_lib_erase_if |
253 | # error "__cpp_lib_erase_if should be defined in c++26" |
254 | # endif |
255 | # if __cpp_lib_erase_if != 202002L |
256 | # error "__cpp_lib_erase_if should have the value 202002L in c++26" |
257 | # endif |
258 | |
259 | # ifndef __cpp_lib_incomplete_container_elements |
260 | # error "__cpp_lib_incomplete_container_elements should be defined in c++26" |
261 | # endif |
262 | # if __cpp_lib_incomplete_container_elements != 201505L |
263 | # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26" |
264 | # endif |
265 | |
266 | # ifndef __cpp_lib_nonmember_container_access |
267 | # error "__cpp_lib_nonmember_container_access should be defined in c++26" |
268 | # endif |
269 | # if __cpp_lib_nonmember_container_access != 201411L |
270 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" |
271 | # endif |
272 | |
273 | # ifndef __cpp_lib_ranges_to_container |
274 | # error "__cpp_lib_ranges_to_container should be defined in c++26" |
275 | # endif |
276 | # if __cpp_lib_ranges_to_container != 202202L |
277 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++26" |
278 | # endif |
279 | |
280 | #endif // TEST_STD_VER > 23 |
281 | |
282 | |