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

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