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

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