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