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_nonmember_container_access    201411L [C++17]
24     __cpp_lib_null_iterators                201304L [C++14]
25     __cpp_lib_ranges                        201811L [C++20]
26     __cpp_lib_ssize                         201902L [C++20]
27 */
28 
29 #include <iterator>
30 #include "test_macros.h"
31 
32 #if TEST_STD_VER < 14
33 
34 # ifdef __cpp_lib_array_constexpr
35 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
36 # endif
37 
38 # ifdef __cpp_lib_constexpr_iterator
39 #   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
40 # endif
41 
42 # ifdef __cpp_lib_make_reverse_iterator
43 #   error "__cpp_lib_make_reverse_iterator should not be defined before c++14"
44 # endif
45 
46 # ifdef __cpp_lib_nonmember_container_access
47 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
48 # endif
49 
50 # ifdef __cpp_lib_null_iterators
51 #   error "__cpp_lib_null_iterators should not be defined before c++14"
52 # endif
53 
54 # ifdef __cpp_lib_ranges
55 #   error "__cpp_lib_ranges should not be defined before c++20"
56 # endif
57 
58 # ifdef __cpp_lib_ssize
59 #   error "__cpp_lib_ssize should not be defined before c++20"
60 # endif
61 
62 #elif TEST_STD_VER == 14
63 
64 # ifdef __cpp_lib_array_constexpr
65 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
66 # endif
67 
68 # ifdef __cpp_lib_constexpr_iterator
69 #   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
70 # endif
71 
72 # ifndef __cpp_lib_make_reverse_iterator
73 #   error "__cpp_lib_make_reverse_iterator should be defined in c++14"
74 # endif
75 # if __cpp_lib_make_reverse_iterator != 201402L
76 #   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14"
77 # endif
78 
79 # ifdef __cpp_lib_nonmember_container_access
80 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
81 # endif
82 
83 # ifndef __cpp_lib_null_iterators
84 #   error "__cpp_lib_null_iterators should be defined in c++14"
85 # endif
86 # if __cpp_lib_null_iterators != 201304L
87 #   error "__cpp_lib_null_iterators should have the value 201304L in c++14"
88 # endif
89 
90 # ifdef __cpp_lib_ranges
91 #   error "__cpp_lib_ranges should not be defined before c++20"
92 # endif
93 
94 # ifdef __cpp_lib_ssize
95 #   error "__cpp_lib_ssize should not be defined before c++20"
96 # endif
97 
98 #elif TEST_STD_VER == 17
99 
100 # ifndef __cpp_lib_array_constexpr
101 #   error "__cpp_lib_array_constexpr should be defined in c++17"
102 # endif
103 # if __cpp_lib_array_constexpr != 201603L
104 #   error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
105 # endif
106 
107 # ifdef __cpp_lib_constexpr_iterator
108 #   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
109 # endif
110 
111 # ifndef __cpp_lib_make_reverse_iterator
112 #   error "__cpp_lib_make_reverse_iterator should be defined in c++17"
113 # endif
114 # if __cpp_lib_make_reverse_iterator != 201402L
115 #   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17"
116 # endif
117 
118 # ifndef __cpp_lib_nonmember_container_access
119 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
120 # endif
121 # if __cpp_lib_nonmember_container_access != 201411L
122 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
123 # endif
124 
125 # ifndef __cpp_lib_null_iterators
126 #   error "__cpp_lib_null_iterators should be defined in c++17"
127 # endif
128 # if __cpp_lib_null_iterators != 201304L
129 #   error "__cpp_lib_null_iterators should have the value 201304L in c++17"
130 # endif
131 
132 # ifdef __cpp_lib_ranges
133 #   error "__cpp_lib_ranges should not be defined before c++20"
134 # endif
135 
136 # ifdef __cpp_lib_ssize
137 #   error "__cpp_lib_ssize should not be defined before c++20"
138 # endif
139 
140 #elif TEST_STD_VER == 20
141 
142 # ifndef __cpp_lib_array_constexpr
143 #   error "__cpp_lib_array_constexpr should be defined in c++20"
144 # endif
145 # if __cpp_lib_array_constexpr != 201811L
146 #   error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
147 # endif
148 
149 # ifndef __cpp_lib_constexpr_iterator
150 #   error "__cpp_lib_constexpr_iterator should be defined in c++20"
151 # endif
152 # if __cpp_lib_constexpr_iterator != 201811L
153 #   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++20"
154 # endif
155 
156 # ifndef __cpp_lib_make_reverse_iterator
157 #   error "__cpp_lib_make_reverse_iterator should be defined in c++20"
158 # endif
159 # if __cpp_lib_make_reverse_iterator != 201402L
160 #   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++20"
161 # endif
162 
163 # ifndef __cpp_lib_nonmember_container_access
164 #   error "__cpp_lib_nonmember_container_access should be defined in c++20"
165 # endif
166 # if __cpp_lib_nonmember_container_access != 201411L
167 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
168 # endif
169 
170 # ifndef __cpp_lib_null_iterators
171 #   error "__cpp_lib_null_iterators should be defined in c++20"
172 # endif
173 # if __cpp_lib_null_iterators != 201304L
174 #   error "__cpp_lib_null_iterators should have the value 201304L in c++20"
175 # endif
176 
177 # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
178 #   ifndef __cpp_lib_ranges
179 #     error "__cpp_lib_ranges should be defined in c++20"
180 #   endif
181 #   if __cpp_lib_ranges != 201811L
182 #     error "__cpp_lib_ranges should have the value 201811L in c++20"
183 #   endif
184 # else
185 #   ifdef __cpp_lib_ranges
186 #     error "__cpp_lib_ranges should not be defined when !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) is not defined!"
187 #   endif
188 # endif
189 
190 # ifndef __cpp_lib_ssize
191 #   error "__cpp_lib_ssize should be defined in c++20"
192 # endif
193 # if __cpp_lib_ssize != 201902L
194 #   error "__cpp_lib_ssize should have the value 201902L in c++20"
195 # endif
196 
197 #elif TEST_STD_VER > 20
198 
199 # ifndef __cpp_lib_array_constexpr
200 #   error "__cpp_lib_array_constexpr should be defined in c++2b"
201 # endif
202 # if __cpp_lib_array_constexpr != 201811L
203 #   error "__cpp_lib_array_constexpr should have the value 201811L in c++2b"
204 # endif
205 
206 # ifndef __cpp_lib_constexpr_iterator
207 #   error "__cpp_lib_constexpr_iterator should be defined in c++2b"
208 # endif
209 # if __cpp_lib_constexpr_iterator != 201811L
210 #   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++2b"
211 # endif
212 
213 # ifndef __cpp_lib_make_reverse_iterator
214 #   error "__cpp_lib_make_reverse_iterator should be defined in c++2b"
215 # endif
216 # if __cpp_lib_make_reverse_iterator != 201402L
217 #   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++2b"
218 # endif
219 
220 # ifndef __cpp_lib_nonmember_container_access
221 #   error "__cpp_lib_nonmember_container_access should be defined in c++2b"
222 # endif
223 # if __cpp_lib_nonmember_container_access != 201411L
224 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2b"
225 # endif
226 
227 # ifndef __cpp_lib_null_iterators
228 #   error "__cpp_lib_null_iterators should be defined in c++2b"
229 # endif
230 # if __cpp_lib_null_iterators != 201304L
231 #   error "__cpp_lib_null_iterators should have the value 201304L in c++2b"
232 # endif
233 
234 # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
235 #   ifndef __cpp_lib_ranges
236 #     error "__cpp_lib_ranges should be defined in c++2b"
237 #   endif
238 #   if __cpp_lib_ranges != 201811L
239 #     error "__cpp_lib_ranges should have the value 201811L in c++2b"
240 #   endif
241 # else
242 #   ifdef __cpp_lib_ranges
243 #     error "__cpp_lib_ranges should not be defined when !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) is not defined!"
244 #   endif
245 # endif
246 
247 # ifndef __cpp_lib_ssize
248 #   error "__cpp_lib_ssize should be defined in c++2b"
249 # endif
250 # if __cpp_lib_ssize != 201902L
251 #   error "__cpp_lib_ssize should have the value 201902L in c++2b"
252 # endif
253 
254 #endif // TEST_STD_VER > 20
255 
256