Debian Codegraph @

libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp

raw
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_containers_ranges 202202L [C++23]
23 __cpp_lib_erase_if 202002L [C++20]
24 __cpp_lib_generic_associative_lookup 201304L [C++14]
25 __cpp_lib_map_try_emplace 201411L [C++17]
26 __cpp_lib_node_extract 201606L [C++17]
27 __cpp_lib_nonmember_container_access 201411L [C++17]
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_containers_ranges
50 # error "__cpp_lib_containers_ranges should not be defined before c++23"
51 # endif
52
53 # ifdef __cpp_lib_erase_if
54 # error "__cpp_lib_erase_if should not be defined before c++20"
55 # endif
56
57 # ifdef __cpp_lib_generic_associative_lookup
58 # error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
59 # endif
60
61 # ifdef __cpp_lib_map_try_emplace
62 # error "__cpp_lib_map_try_emplace should not be defined before c++17"
63 # endif
64
65 # ifdef __cpp_lib_node_extract
66 # error "__cpp_lib_node_extract should not be defined before c++17"
67 # endif
68
69 # ifdef __cpp_lib_nonmember_container_access
70 # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
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_containers_ranges
92 # error "__cpp_lib_containers_ranges should not be defined before c++23"
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_generic_associative_lookup
100 # error "__cpp_lib_generic_associative_lookup should be defined in c++14"
101 # endif
102 # if __cpp_lib_generic_associative_lookup != 201304L
103 # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
104 # endif
105
106 # ifdef __cpp_lib_map_try_emplace
107 # error "__cpp_lib_map_try_emplace should not be defined before c++17"
108 # endif
109
110 # ifdef __cpp_lib_node_extract
111 # error "__cpp_lib_node_extract should not be defined before c++17"
112 # endif
113
114 # ifdef __cpp_lib_nonmember_container_access
115 # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
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_containers_ranges
140 # error "__cpp_lib_containers_ranges should not be defined before c++23"
141 # endif
142
143 # ifdef __cpp_lib_erase_if
144 # error "__cpp_lib_erase_if should not be defined before c++20"
145 # endif
146
147 # ifndef __cpp_lib_generic_associative_lookup
148 # error "__cpp_lib_generic_associative_lookup should be defined in c++17"
149 # endif
150 # if __cpp_lib_generic_associative_lookup != 201304L
151 # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
152 # endif
153
154 # ifndef __cpp_lib_map_try_emplace
155 # error "__cpp_lib_map_try_emplace should be defined in c++17"
156 # endif
157 # if __cpp_lib_map_try_emplace != 201411L
158 # error "__cpp_lib_map_try_emplace should have the value 201411L in c++17"
159 # endif
160
161 # ifndef __cpp_lib_node_extract
162 # error "__cpp_lib_node_extract should be defined in c++17"
163 # endif
164 # if __cpp_lib_node_extract != 201606L
165 # error "__cpp_lib_node_extract should have the value 201606L in c++17"
166 # endif
167
168 # ifndef __cpp_lib_nonmember_container_access
169 # error "__cpp_lib_nonmember_container_access should be defined in c++17"
170 # endif
171 # if __cpp_lib_nonmember_container_access != 201411L
172 # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
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 # ifdef __cpp_lib_containers_ranges
197 # error "__cpp_lib_containers_ranges should not be defined before c++23"
198 # endif
199
200 # ifndef __cpp_lib_erase_if
201 # error "__cpp_lib_erase_if should be defined in c++20"
202 # endif
203 # if __cpp_lib_erase_if != 202002L
204 # error "__cpp_lib_erase_if should have the value 202002L in c++20"
205 # endif
206
207 # ifndef __cpp_lib_generic_associative_lookup
208 # error "__cpp_lib_generic_associative_lookup should be defined in c++20"
209 # endif
210 # if __cpp_lib_generic_associative_lookup != 201304L
211 # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
212 # endif
213
214 # ifndef __cpp_lib_map_try_emplace
215 # error "__cpp_lib_map_try_emplace should be defined in c++20"
216 # endif
217 # if __cpp_lib_map_try_emplace != 201411L
218 # error "__cpp_lib_map_try_emplace should have the value 201411L in c++20"
219 # endif
220
221 # ifndef __cpp_lib_node_extract
222 # error "__cpp_lib_node_extract should be defined in c++20"
223 # endif
224 # if __cpp_lib_node_extract != 201606L
225 # error "__cpp_lib_node_extract should have the value 201606L in c++20"
226 # endif
227
228 # ifndef __cpp_lib_nonmember_container_access
229 # error "__cpp_lib_nonmember_container_access should be defined in c++20"
230 # endif
231 # if __cpp_lib_nonmember_container_access != 201411L
232 # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
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_containers_ranges
266 # error "__cpp_lib_containers_ranges should be defined in c++23"
267 # endif
268 # if __cpp_lib_containers_ranges != 202202L
269 # error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
270 # endif
271
272 # ifndef __cpp_lib_erase_if
273 # error "__cpp_lib_erase_if should be defined in c++23"
274 # endif
275 # if __cpp_lib_erase_if != 202002L
276 # error "__cpp_lib_erase_if should have the value 202002L in c++23"
277 # endif
278
279 # ifndef __cpp_lib_generic_associative_lookup
280 # error "__cpp_lib_generic_associative_lookup should be defined in c++23"
281 # endif
282 # if __cpp_lib_generic_associative_lookup != 201304L
283 # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
284 # endif
285
286 # ifndef __cpp_lib_map_try_emplace
287 # error "__cpp_lib_map_try_emplace should be defined in c++23"
288 # endif
289 # if __cpp_lib_map_try_emplace != 201411L
290 # error "__cpp_lib_map_try_emplace should have the value 201411L in c++23"
291 # endif
292
293 # ifndef __cpp_lib_node_extract
294 # error "__cpp_lib_node_extract should be defined in c++23"
295 # endif
296 # if __cpp_lib_node_extract != 201606L
297 # error "__cpp_lib_node_extract should have the value 201606L in c++23"
298 # endif
299
300 # ifndef __cpp_lib_nonmember_container_access
301 # error "__cpp_lib_nonmember_container_access should be defined in c++23"
302 # endif
303 # if __cpp_lib_nonmember_container_access != 201411L
304 # error "__cpp_lib_nonmember_container_access should have the value 201411L 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_containers_ranges
356 # error "__cpp_lib_containers_ranges should be defined in c++26"
357 # endif
358 # if __cpp_lib_containers_ranges != 202202L
359 # error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
360 # endif
361
362 # ifndef __cpp_lib_erase_if
363 # error "__cpp_lib_erase_if should be defined in c++26"
364 # endif
365 # if __cpp_lib_erase_if != 202002L
366 # error "__cpp_lib_erase_if should have the value 202002L in c++26"
367 # endif
368
369 # ifndef __cpp_lib_generic_associative_lookup
370 # error "__cpp_lib_generic_associative_lookup should be defined in c++26"
371 # endif
372 # if __cpp_lib_generic_associative_lookup != 201304L
373 # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
374 # endif
375
376 # ifndef __cpp_lib_map_try_emplace
377 # error "__cpp_lib_map_try_emplace should be defined in c++26"
378 # endif
379 # if __cpp_lib_map_try_emplace != 201411L
380 # error "__cpp_lib_map_try_emplace should have the value 201411L in c++26"
381 # endif
382
383 # ifndef __cpp_lib_node_extract
384 # error "__cpp_lib_node_extract should be defined in c++26"
385 # endif
386 # if __cpp_lib_node_extract != 201606L
387 # error "__cpp_lib_node_extract should have the value 201606L in c++26"
388 # endif
389
390 # ifndef __cpp_lib_nonmember_container_access
391 # error "__cpp_lib_nonmember_container_access should be defined in c++26"
392 # endif
393 # if __cpp_lib_nonmember_container_access != 201411L
394 # error "__cpp_lib_nonmember_container_access should have the value 201411L 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