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

source code of libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp