Debian Codegraph @

libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp

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