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 | // <map> |
15 | |
16 | // Test the feature test macros defined by <map> |
17 | |
18 | /* Constant Value |
19 | __cpp_lib_allocator_traits_is_always_equal 201411L [C++17] |
20 | __cpp_lib_associative_heterogeneous_erasure 202110L [C++23] |
21 | __cpp_lib_associative_heterogeneous_insertion 202306L [C++26] |
22 | __cpp_lib_erase_if 202002L [C++20] |
23 | __cpp_lib_generic_associative_lookup 201304L [C++14] |
24 | __cpp_lib_map_try_emplace 201411L [C++17] |
25 | __cpp_lib_node_extract 201606L [C++17] |
26 | __cpp_lib_nonmember_container_access 201411L [C++17] |
27 | __cpp_lib_ranges_to_container 202202L [C++23] |
28 | __cpp_lib_tuple_like 202207L [C++23] |
29 | 202311L [C++26] |
30 | */ |
31 | |
32 | #include <map> |
33 | #include "test_macros.h" |
34 | |
35 | #if TEST_STD_VER < 14 |
36 | |
37 | # ifdef __cpp_lib_allocator_traits_is_always_equal |
38 | # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" |
39 | # endif |
40 | |
41 | # ifdef __cpp_lib_associative_heterogeneous_erasure |
42 | # error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" |
43 | # endif |
44 | |
45 | # ifdef __cpp_lib_associative_heterogeneous_insertion |
46 | # error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" |
47 | # endif |
48 | |
49 | # ifdef __cpp_lib_erase_if |
50 | # error "__cpp_lib_erase_if should not be defined before c++20" |
51 | # endif |
52 | |
53 | # ifdef __cpp_lib_generic_associative_lookup |
54 | # error "__cpp_lib_generic_associative_lookup should not be defined before c++14" |
55 | # endif |
56 | |
57 | # ifdef __cpp_lib_map_try_emplace |
58 | # error "__cpp_lib_map_try_emplace should not be defined before c++17" |
59 | # endif |
60 | |
61 | # ifdef __cpp_lib_node_extract |
62 | # error "__cpp_lib_node_extract should not be defined before c++17" |
63 | # endif |
64 | |
65 | # ifdef __cpp_lib_nonmember_container_access |
66 | # error "__cpp_lib_nonmember_container_access should not be defined before c++17" |
67 | # endif |
68 | |
69 | # ifdef __cpp_lib_ranges_to_container |
70 | # error "__cpp_lib_ranges_to_container should not be defined before c++23" |
71 | # endif |
72 | |
73 | # ifdef __cpp_lib_tuple_like |
74 | # error "__cpp_lib_tuple_like should not be defined before c++23" |
75 | # endif |
76 | |
77 | #elif TEST_STD_VER == 14 |
78 | |
79 | # ifdef __cpp_lib_allocator_traits_is_always_equal |
80 | # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" |
81 | # endif |
82 | |
83 | # ifdef __cpp_lib_associative_heterogeneous_erasure |
84 | # error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" |
85 | # endif |
86 | |
87 | # ifdef __cpp_lib_associative_heterogeneous_insertion |
88 | # error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" |
89 | # endif |
90 | |
91 | # ifdef __cpp_lib_erase_if |
92 | # error "__cpp_lib_erase_if should not be defined before c++20" |
93 | # endif |
94 | |
95 | # ifndef __cpp_lib_generic_associative_lookup |
96 | # error "__cpp_lib_generic_associative_lookup should be defined in c++14" |
97 | # endif |
98 | # if __cpp_lib_generic_associative_lookup != 201304L |
99 | # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14" |
100 | # endif |
101 | |
102 | # ifdef __cpp_lib_map_try_emplace |
103 | # error "__cpp_lib_map_try_emplace should not be defined before c++17" |
104 | # endif |
105 | |
106 | # ifdef __cpp_lib_node_extract |
107 | # error "__cpp_lib_node_extract should not be defined before c++17" |
108 | # endif |
109 | |
110 | # ifdef __cpp_lib_nonmember_container_access |
111 | # error "__cpp_lib_nonmember_container_access should not be defined before c++17" |
112 | # endif |
113 | |
114 | # ifdef __cpp_lib_ranges_to_container |
115 | # error "__cpp_lib_ranges_to_container should not be defined before c++23" |
116 | # endif |
117 | |
118 | # ifdef __cpp_lib_tuple_like |
119 | # error "__cpp_lib_tuple_like should not be defined before c++23" |
120 | # endif |
121 | |
122 | #elif TEST_STD_VER == 17 |
123 | |
124 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
125 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" |
126 | # endif |
127 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
128 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" |
129 | # endif |
130 | |
131 | # ifdef __cpp_lib_associative_heterogeneous_erasure |
132 | # error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" |
133 | # endif |
134 | |
135 | # ifdef __cpp_lib_associative_heterogeneous_insertion |
136 | # error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" |
137 | # endif |
138 | |
139 | # ifdef __cpp_lib_erase_if |
140 | # error "__cpp_lib_erase_if should not be defined before c++20" |
141 | # endif |
142 | |
143 | # ifndef __cpp_lib_generic_associative_lookup |
144 | # error "__cpp_lib_generic_associative_lookup should be defined in c++17" |
145 | # endif |
146 | # if __cpp_lib_generic_associative_lookup != 201304L |
147 | # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17" |
148 | # endif |
149 | |
150 | # ifndef __cpp_lib_map_try_emplace |
151 | # error "__cpp_lib_map_try_emplace should be defined in c++17" |
152 | # endif |
153 | # if __cpp_lib_map_try_emplace != 201411L |
154 | # error "__cpp_lib_map_try_emplace should have the value 201411L in c++17" |
155 | # endif |
156 | |
157 | # ifndef __cpp_lib_node_extract |
158 | # error "__cpp_lib_node_extract should be defined in c++17" |
159 | # endif |
160 | # if __cpp_lib_node_extract != 201606L |
161 | # error "__cpp_lib_node_extract should have the value 201606L in c++17" |
162 | # endif |
163 | |
164 | # ifndef __cpp_lib_nonmember_container_access |
165 | # error "__cpp_lib_nonmember_container_access should be defined in c++17" |
166 | # endif |
167 | # if __cpp_lib_nonmember_container_access != 201411L |
168 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" |
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 | # ifdef __cpp_lib_tuple_like |
176 | # error "__cpp_lib_tuple_like should not be defined before c++23" |
177 | # endif |
178 | |
179 | #elif TEST_STD_VER == 20 |
180 | |
181 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
182 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" |
183 | # endif |
184 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
185 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" |
186 | # endif |
187 | |
188 | # ifdef __cpp_lib_associative_heterogeneous_erasure |
189 | # error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" |
190 | # endif |
191 | |
192 | # ifdef __cpp_lib_associative_heterogeneous_insertion |
193 | # error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" |
194 | # endif |
195 | |
196 | # ifndef __cpp_lib_erase_if |
197 | # error "__cpp_lib_erase_if should be defined in c++20" |
198 | # endif |
199 | # if __cpp_lib_erase_if != 202002L |
200 | # error "__cpp_lib_erase_if should have the value 202002L in c++20" |
201 | # endif |
202 | |
203 | # ifndef __cpp_lib_generic_associative_lookup |
204 | # error "__cpp_lib_generic_associative_lookup should be defined in c++20" |
205 | # endif |
206 | # if __cpp_lib_generic_associative_lookup != 201304L |
207 | # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20" |
208 | # endif |
209 | |
210 | # ifndef __cpp_lib_map_try_emplace |
211 | # error "__cpp_lib_map_try_emplace should be defined in c++20" |
212 | # endif |
213 | # if __cpp_lib_map_try_emplace != 201411L |
214 | # error "__cpp_lib_map_try_emplace should have the value 201411L in c++20" |
215 | # endif |
216 | |
217 | # ifndef __cpp_lib_node_extract |
218 | # error "__cpp_lib_node_extract should be defined in c++20" |
219 | # endif |
220 | # if __cpp_lib_node_extract != 201606L |
221 | # error "__cpp_lib_node_extract should have the value 201606L in c++20" |
222 | # endif |
223 | |
224 | # ifndef __cpp_lib_nonmember_container_access |
225 | # error "__cpp_lib_nonmember_container_access should be defined in c++20" |
226 | # endif |
227 | # if __cpp_lib_nonmember_container_access != 201411L |
228 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" |
229 | # endif |
230 | |
231 | # ifdef __cpp_lib_ranges_to_container |
232 | # error "__cpp_lib_ranges_to_container should not be defined before c++23" |
233 | # endif |
234 | |
235 | # ifdef __cpp_lib_tuple_like |
236 | # error "__cpp_lib_tuple_like should not be defined before c++23" |
237 | # endif |
238 | |
239 | #elif TEST_STD_VER == 23 |
240 | |
241 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
242 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" |
243 | # endif |
244 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
245 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" |
246 | # endif |
247 | |
248 | # if !defined(_LIBCPP_VERSION) |
249 | # ifndef __cpp_lib_associative_heterogeneous_erasure |
250 | # error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23" |
251 | # endif |
252 | # if __cpp_lib_associative_heterogeneous_erasure != 202110L |
253 | # error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23" |
254 | # endif |
255 | # else // _LIBCPP_VERSION |
256 | # ifdef __cpp_lib_associative_heterogeneous_erasure |
257 | # error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" |
258 | # endif |
259 | # endif |
260 | |
261 | # ifdef __cpp_lib_associative_heterogeneous_insertion |
262 | # error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" |
263 | # endif |
264 | |
265 | # ifndef __cpp_lib_erase_if |
266 | # error "__cpp_lib_erase_if should be defined in c++23" |
267 | # endif |
268 | # if __cpp_lib_erase_if != 202002L |
269 | # error "__cpp_lib_erase_if should have the value 202002L in c++23" |
270 | # endif |
271 | |
272 | # ifndef __cpp_lib_generic_associative_lookup |
273 | # error "__cpp_lib_generic_associative_lookup should be defined in c++23" |
274 | # endif |
275 | # if __cpp_lib_generic_associative_lookup != 201304L |
276 | # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23" |
277 | # endif |
278 | |
279 | # ifndef __cpp_lib_map_try_emplace |
280 | # error "__cpp_lib_map_try_emplace should be defined in c++23" |
281 | # endif |
282 | # if __cpp_lib_map_try_emplace != 201411L |
283 | # error "__cpp_lib_map_try_emplace should have the value 201411L in c++23" |
284 | # endif |
285 | |
286 | # ifndef __cpp_lib_node_extract |
287 | # error "__cpp_lib_node_extract should be defined in c++23" |
288 | # endif |
289 | # if __cpp_lib_node_extract != 201606L |
290 | # error "__cpp_lib_node_extract should have the value 201606L in c++23" |
291 | # endif |
292 | |
293 | # ifndef __cpp_lib_nonmember_container_access |
294 | # error "__cpp_lib_nonmember_container_access should be defined in c++23" |
295 | # endif |
296 | # if __cpp_lib_nonmember_container_access != 201411L |
297 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" |
298 | # endif |
299 | |
300 | # ifndef __cpp_lib_ranges_to_container |
301 | # error "__cpp_lib_ranges_to_container should be defined in c++23" |
302 | # endif |
303 | # if __cpp_lib_ranges_to_container != 202202L |
304 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++23" |
305 | # endif |
306 | |
307 | # if !defined(_LIBCPP_VERSION) |
308 | # ifndef __cpp_lib_tuple_like |
309 | # error "__cpp_lib_tuple_like should be defined in c++23" |
310 | # endif |
311 | # if __cpp_lib_tuple_like != 202207L |
312 | # error "__cpp_lib_tuple_like should have the value 202207L in c++23" |
313 | # endif |
314 | # else // _LIBCPP_VERSION |
315 | # ifdef __cpp_lib_tuple_like |
316 | # error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" |
317 | # endif |
318 | # endif |
319 | |
320 | #elif TEST_STD_VER > 23 |
321 | |
322 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
323 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" |
324 | # endif |
325 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
326 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" |
327 | # endif |
328 | |
329 | # if !defined(_LIBCPP_VERSION) |
330 | # ifndef __cpp_lib_associative_heterogeneous_erasure |
331 | # error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26" |
332 | # endif |
333 | # if __cpp_lib_associative_heterogeneous_erasure != 202110L |
334 | # error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26" |
335 | # endif |
336 | # else // _LIBCPP_VERSION |
337 | # ifdef __cpp_lib_associative_heterogeneous_erasure |
338 | # error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" |
339 | # endif |
340 | # endif |
341 | |
342 | # if !defined(_LIBCPP_VERSION) |
343 | # ifndef __cpp_lib_associative_heterogeneous_insertion |
344 | # error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26" |
345 | # endif |
346 | # if __cpp_lib_associative_heterogeneous_insertion != 202306L |
347 | # error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26" |
348 | # endif |
349 | # else // _LIBCPP_VERSION |
350 | # ifdef __cpp_lib_associative_heterogeneous_insertion |
351 | # error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!" |
352 | # endif |
353 | # endif |
354 | |
355 | # ifndef __cpp_lib_erase_if |
356 | # error "__cpp_lib_erase_if should be defined in c++26" |
357 | # endif |
358 | # if __cpp_lib_erase_if != 202002L |
359 | # error "__cpp_lib_erase_if should have the value 202002L in c++26" |
360 | # endif |
361 | |
362 | # ifndef __cpp_lib_generic_associative_lookup |
363 | # error "__cpp_lib_generic_associative_lookup should be defined in c++26" |
364 | # endif |
365 | # if __cpp_lib_generic_associative_lookup != 201304L |
366 | # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26" |
367 | # endif |
368 | |
369 | # ifndef __cpp_lib_map_try_emplace |
370 | # error "__cpp_lib_map_try_emplace should be defined in c++26" |
371 | # endif |
372 | # if __cpp_lib_map_try_emplace != 201411L |
373 | # error "__cpp_lib_map_try_emplace should have the value 201411L in c++26" |
374 | # endif |
375 | |
376 | # ifndef __cpp_lib_node_extract |
377 | # error "__cpp_lib_node_extract should be defined in c++26" |
378 | # endif |
379 | # if __cpp_lib_node_extract != 201606L |
380 | # error "__cpp_lib_node_extract should have the value 201606L in c++26" |
381 | # endif |
382 | |
383 | # ifndef __cpp_lib_nonmember_container_access |
384 | # error "__cpp_lib_nonmember_container_access should be defined in c++26" |
385 | # endif |
386 | # if __cpp_lib_nonmember_container_access != 201411L |
387 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" |
388 | # endif |
389 | |
390 | # ifndef __cpp_lib_ranges_to_container |
391 | # error "__cpp_lib_ranges_to_container should be defined in c++26" |
392 | # endif |
393 | # if __cpp_lib_ranges_to_container != 202202L |
394 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++26" |
395 | # endif |
396 | |
397 | # if !defined(_LIBCPP_VERSION) |
398 | # ifndef __cpp_lib_tuple_like |
399 | # error "__cpp_lib_tuple_like should be defined in c++26" |
400 | # endif |
401 | # if __cpp_lib_tuple_like != 202311L |
402 | # error "__cpp_lib_tuple_like should have the value 202311L in c++26" |
403 | # endif |
404 | # else // _LIBCPP_VERSION |
405 | # ifdef __cpp_lib_tuple_like |
406 | # error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" |
407 | # endif |
408 | # endif |
409 | |
410 | #endif // TEST_STD_VER > 23 |
411 | |
412 | |