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

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