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 | # ifndef __cpp_lib_ranges_to_container |
253 | # error "__cpp_lib_ranges_to_container should be defined in c++23" |
254 | # endif |
255 | # if __cpp_lib_ranges_to_container != 202202L |
256 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++23" |
257 | # endif |
258 | |
259 | #elif TEST_STD_VER > 23 |
260 | |
261 | # ifndef __cpp_lib_allocator_traits_is_always_equal |
262 | # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" |
263 | # endif |
264 | # if __cpp_lib_allocator_traits_is_always_equal != 201411L |
265 | # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" |
266 | # endif |
267 | |
268 | # if !defined(_LIBCPP_VERSION) |
269 | # ifndef __cpp_lib_associative_heterogeneous_erasure |
270 | # error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26" |
271 | # endif |
272 | # if __cpp_lib_associative_heterogeneous_erasure != 202110L |
273 | # error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26" |
274 | # endif |
275 | # else // _LIBCPP_VERSION |
276 | # ifdef __cpp_lib_associative_heterogeneous_erasure |
277 | # error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" |
278 | # endif |
279 | # endif |
280 | |
281 | # if !defined(_LIBCPP_VERSION) |
282 | # ifndef __cpp_lib_associative_heterogeneous_insertion |
283 | # error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26" |
284 | # endif |
285 | # if __cpp_lib_associative_heterogeneous_insertion != 202306L |
286 | # error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26" |
287 | # endif |
288 | # else // _LIBCPP_VERSION |
289 | # ifdef __cpp_lib_associative_heterogeneous_insertion |
290 | # error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!" |
291 | # endif |
292 | # endif |
293 | |
294 | # ifndef __cpp_lib_erase_if |
295 | # error "__cpp_lib_erase_if should be defined in c++26" |
296 | # endif |
297 | # if __cpp_lib_erase_if != 202002L |
298 | # error "__cpp_lib_erase_if should have the value 202002L in c++26" |
299 | # endif |
300 | |
301 | # ifndef __cpp_lib_generic_associative_lookup |
302 | # error "__cpp_lib_generic_associative_lookup should be defined in c++26" |
303 | # endif |
304 | # if __cpp_lib_generic_associative_lookup != 201304L |
305 | # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26" |
306 | # endif |
307 | |
308 | # ifndef __cpp_lib_node_extract |
309 | # error "__cpp_lib_node_extract should be defined in c++26" |
310 | # endif |
311 | # if __cpp_lib_node_extract != 201606L |
312 | # error "__cpp_lib_node_extract should have the value 201606L in c++26" |
313 | # endif |
314 | |
315 | # ifndef __cpp_lib_nonmember_container_access |
316 | # error "__cpp_lib_nonmember_container_access should be defined in c++26" |
317 | # endif |
318 | # if __cpp_lib_nonmember_container_access != 201411L |
319 | # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" |
320 | # endif |
321 | |
322 | # ifndef __cpp_lib_ranges_to_container |
323 | # error "__cpp_lib_ranges_to_container should be defined in c++26" |
324 | # endif |
325 | # if __cpp_lib_ranges_to_container != 202202L |
326 | # error "__cpp_lib_ranges_to_container should have the value 202202L in c++26" |
327 | # endif |
328 | |
329 | #endif // TEST_STD_VER > 23 |
330 | |
331 | |