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 // <set>
15 
16 // Test the feature test macros defined by <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_associative_lookup             201304L [C++14]
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 <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_associative_lookup
51 #   error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
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 # ifndef __cpp_lib_generic_associative_lookup
85 #   error "__cpp_lib_generic_associative_lookup should be defined in c++14"
86 # endif
87 # if __cpp_lib_generic_associative_lookup != 201304L
88 #   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
89 # endif
90 
91 # ifdef __cpp_lib_node_extract
92 #   error "__cpp_lib_node_extract should not be defined before c++17"
93 # endif
94 
95 # ifdef __cpp_lib_nonmember_container_access
96 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
97 # endif
98 
99 # ifdef __cpp_lib_ranges_to_container
100 #   error "__cpp_lib_ranges_to_container should not be defined before c++23"
101 # endif
102 
103 #elif TEST_STD_VER == 17
104 
105 # ifndef __cpp_lib_allocator_traits_is_always_equal
106 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
107 # endif
108 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
109 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
110 # endif
111 
112 # ifdef __cpp_lib_associative_heterogeneous_erasure
113 #   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
114 # endif
115 
116 # ifdef __cpp_lib_associative_heterogeneous_insertion
117 #   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
118 # endif
119 
120 # ifdef __cpp_lib_erase_if
121 #   error "__cpp_lib_erase_if should not be defined before c++20"
122 # endif
123 
124 # ifndef __cpp_lib_generic_associative_lookup
125 #   error "__cpp_lib_generic_associative_lookup should be defined in c++17"
126 # endif
127 # if __cpp_lib_generic_associative_lookup != 201304L
128 #   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
129 # endif
130 
131 # ifndef __cpp_lib_node_extract
132 #   error "__cpp_lib_node_extract should be defined in c++17"
133 # endif
134 # if __cpp_lib_node_extract != 201606L
135 #   error "__cpp_lib_node_extract should have the value 201606L in c++17"
136 # endif
137 
138 # ifndef __cpp_lib_nonmember_container_access
139 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
140 # endif
141 # if __cpp_lib_nonmember_container_access != 201411L
142 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
143 # endif
144 
145 # ifdef __cpp_lib_ranges_to_container
146 #   error "__cpp_lib_ranges_to_container should not be defined before c++23"
147 # endif
148 
149 #elif TEST_STD_VER == 20
150 
151 # ifndef __cpp_lib_allocator_traits_is_always_equal
152 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
153 # endif
154 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
155 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
156 # endif
157 
158 # ifdef __cpp_lib_associative_heterogeneous_erasure
159 #   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
160 # endif
161 
162 # ifdef __cpp_lib_associative_heterogeneous_insertion
163 #   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
164 # endif
165 
166 # ifndef __cpp_lib_erase_if
167 #   error "__cpp_lib_erase_if should be defined in c++20"
168 # endif
169 # if __cpp_lib_erase_if != 202002L
170 #   error "__cpp_lib_erase_if should have the value 202002L in c++20"
171 # endif
172 
173 # ifndef __cpp_lib_generic_associative_lookup
174 #   error "__cpp_lib_generic_associative_lookup should be defined in c++20"
175 # endif
176 # if __cpp_lib_generic_associative_lookup != 201304L
177 #   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
178 # endif
179 
180 # ifndef __cpp_lib_node_extract
181 #   error "__cpp_lib_node_extract should be defined in c++20"
182 # endif
183 # if __cpp_lib_node_extract != 201606L
184 #   error "__cpp_lib_node_extract should have the value 201606L in c++20"
185 # endif
186 
187 # ifndef __cpp_lib_nonmember_container_access
188 #   error "__cpp_lib_nonmember_container_access should be defined in c++20"
189 # endif
190 # if __cpp_lib_nonmember_container_access != 201411L
191 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
192 # endif
193 
194 # ifdef __cpp_lib_ranges_to_container
195 #   error "__cpp_lib_ranges_to_container should not be defined before c++23"
196 # endif
197 
198 #elif TEST_STD_VER == 23
199 
200 # ifndef __cpp_lib_allocator_traits_is_always_equal
201 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
202 # endif
203 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
204 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
205 # endif
206 
207 # if !defined(_LIBCPP_VERSION)
208 #   ifndef __cpp_lib_associative_heterogeneous_erasure
209 #     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
210 #   endif
211 #   if __cpp_lib_associative_heterogeneous_erasure != 202110L
212 #     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
213 #   endif
214 # else // _LIBCPP_VERSION
215 #   ifdef __cpp_lib_associative_heterogeneous_erasure
216 #     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
217 #   endif
218 # endif
219 
220 # ifdef __cpp_lib_associative_heterogeneous_insertion
221 #   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
222 # endif
223 
224 # ifndef __cpp_lib_erase_if
225 #   error "__cpp_lib_erase_if should be defined in c++23"
226 # endif
227 # if __cpp_lib_erase_if != 202002L
228 #   error "__cpp_lib_erase_if should have the value 202002L in c++23"
229 # endif
230 
231 # ifndef __cpp_lib_generic_associative_lookup
232 #   error "__cpp_lib_generic_associative_lookup should be defined in c++23"
233 # endif
234 # if __cpp_lib_generic_associative_lookup != 201304L
235 #   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
236 # endif
237 
238 # ifndef __cpp_lib_node_extract
239 #   error "__cpp_lib_node_extract should be defined in c++23"
240 # endif
241 # if __cpp_lib_node_extract != 201606L
242 #   error "__cpp_lib_node_extract should have the value 201606L in c++23"
243 # endif
244 
245 # ifndef __cpp_lib_nonmember_container_access
246 #   error "__cpp_lib_nonmember_container_access should be defined in c++23"
247 # endif
248 # if __cpp_lib_nonmember_container_access != 201411L
249 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
250 # endif
251 
252 # if !defined(_LIBCPP_VERSION)
253 #   ifndef __cpp_lib_ranges_to_container
254 #     error "__cpp_lib_ranges_to_container should be defined in c++23"
255 #   endif
256 #   if __cpp_lib_ranges_to_container != 202202L
257 #     error "__cpp_lib_ranges_to_container should have the value 202202L in c++23"
258 #   endif
259 # else // _LIBCPP_VERSION
260 #   ifdef __cpp_lib_ranges_to_container
261 #     error "__cpp_lib_ranges_to_container should not be defined because it is unimplemented in libc++!"
262 #   endif
263 # endif
264 
265 #elif TEST_STD_VER > 23
266 
267 # ifndef __cpp_lib_allocator_traits_is_always_equal
268 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
269 # endif
270 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
271 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
272 # endif
273 
274 # if !defined(_LIBCPP_VERSION)
275 #   ifndef __cpp_lib_associative_heterogeneous_erasure
276 #     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
277 #   endif
278 #   if __cpp_lib_associative_heterogeneous_erasure != 202110L
279 #     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
280 #   endif
281 # else // _LIBCPP_VERSION
282 #   ifdef __cpp_lib_associative_heterogeneous_erasure
283 #     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
284 #   endif
285 # endif
286 
287 # if !defined(_LIBCPP_VERSION)
288 #   ifndef __cpp_lib_associative_heterogeneous_insertion
289 #     error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
290 #   endif
291 #   if __cpp_lib_associative_heterogeneous_insertion != 202306L
292 #     error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
293 #   endif
294 # else // _LIBCPP_VERSION
295 #   ifdef __cpp_lib_associative_heterogeneous_insertion
296 #     error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
297 #   endif
298 # endif
299 
300 # ifndef __cpp_lib_erase_if
301 #   error "__cpp_lib_erase_if should be defined in c++26"
302 # endif
303 # if __cpp_lib_erase_if != 202002L
304 #   error "__cpp_lib_erase_if should have the value 202002L in c++26"
305 # endif
306 
307 # ifndef __cpp_lib_generic_associative_lookup
308 #   error "__cpp_lib_generic_associative_lookup should be defined in c++26"
309 # endif
310 # if __cpp_lib_generic_associative_lookup != 201304L
311 #   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
312 # endif
313 
314 # ifndef __cpp_lib_node_extract
315 #   error "__cpp_lib_node_extract should be defined in c++26"
316 # endif
317 # if __cpp_lib_node_extract != 201606L
318 #   error "__cpp_lib_node_extract should have the value 201606L in c++26"
319 # endif
320 
321 # ifndef __cpp_lib_nonmember_container_access
322 #   error "__cpp_lib_nonmember_container_access should be defined in c++26"
323 # endif
324 # if __cpp_lib_nonmember_container_access != 201411L
325 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
326 # endif
327 
328 # if !defined(_LIBCPP_VERSION)
329 #   ifndef __cpp_lib_ranges_to_container
330 #     error "__cpp_lib_ranges_to_container should be defined in c++26"
331 #   endif
332 #   if __cpp_lib_ranges_to_container != 202202L
333 #     error "__cpp_lib_ranges_to_container should have the value 202202L in c++26"
334 #   endif
335 # else // _LIBCPP_VERSION
336 #   ifdef __cpp_lib_ranges_to_container
337 #     error "__cpp_lib_ranges_to_container should not be defined because it is unimplemented in libc++!"
338 #   endif
339 # endif
340 
341 #endif // TEST_STD_VER > 23
342 
343