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