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_make_from_tuple    201606L [C++17]
22     __cpp_lib_ranges_zip         202110L [C++23]
23     __cpp_lib_tuple_element_t    201402L [C++14]
24     __cpp_lib_tuples_by_type     201304L [C++14]
25 */
26 
27 #include <tuple>
28 #include "test_macros.h"
29 
30 #if TEST_STD_VER < 14
31 
32 # ifdef __cpp_lib_apply
33 #   error "__cpp_lib_apply should not be defined before c++17"
34 # endif
35 
36 # ifdef __cpp_lib_constexpr_tuple
37 #   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
38 # endif
39 
40 # ifdef __cpp_lib_make_from_tuple
41 #   error "__cpp_lib_make_from_tuple should not be defined before c++17"
42 # endif
43 
44 # ifdef __cpp_lib_ranges_zip
45 #   error "__cpp_lib_ranges_zip should not be defined before c++23"
46 # endif
47 
48 # ifdef __cpp_lib_tuple_element_t
49 #   error "__cpp_lib_tuple_element_t should not be defined before c++14"
50 # endif
51 
52 # ifdef __cpp_lib_tuples_by_type
53 #   error "__cpp_lib_tuples_by_type should not be defined before c++14"
54 # endif
55 
56 #elif TEST_STD_VER == 14
57 
58 # ifdef __cpp_lib_apply
59 #   error "__cpp_lib_apply should not be defined before c++17"
60 # endif
61 
62 # ifdef __cpp_lib_constexpr_tuple
63 #   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
64 # endif
65 
66 # ifdef __cpp_lib_make_from_tuple
67 #   error "__cpp_lib_make_from_tuple should not be defined before c++17"
68 # endif
69 
70 # ifdef __cpp_lib_ranges_zip
71 #   error "__cpp_lib_ranges_zip should not be defined before c++23"
72 # endif
73 
74 # ifndef __cpp_lib_tuple_element_t
75 #   error "__cpp_lib_tuple_element_t should be defined in c++14"
76 # endif
77 # if __cpp_lib_tuple_element_t != 201402L
78 #   error "__cpp_lib_tuple_element_t should have the value 201402L in c++14"
79 # endif
80 
81 # ifndef __cpp_lib_tuples_by_type
82 #   error "__cpp_lib_tuples_by_type should be defined in c++14"
83 # endif
84 # if __cpp_lib_tuples_by_type != 201304L
85 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
86 # endif
87 
88 #elif TEST_STD_VER == 17
89 
90 # ifndef __cpp_lib_apply
91 #   error "__cpp_lib_apply should be defined in c++17"
92 # endif
93 # if __cpp_lib_apply != 201603L
94 #   error "__cpp_lib_apply should have the value 201603L in c++17"
95 # endif
96 
97 # ifdef __cpp_lib_constexpr_tuple
98 #   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
99 # endif
100 
101 # ifndef __cpp_lib_make_from_tuple
102 #   error "__cpp_lib_make_from_tuple should be defined in c++17"
103 # endif
104 # if __cpp_lib_make_from_tuple != 201606L
105 #   error "__cpp_lib_make_from_tuple should have the value 201606L in c++17"
106 # endif
107 
108 # ifdef __cpp_lib_ranges_zip
109 #   error "__cpp_lib_ranges_zip should not be defined before c++23"
110 # endif
111 
112 # ifndef __cpp_lib_tuple_element_t
113 #   error "__cpp_lib_tuple_element_t should be defined in c++17"
114 # endif
115 # if __cpp_lib_tuple_element_t != 201402L
116 #   error "__cpp_lib_tuple_element_t should have the value 201402L in c++17"
117 # endif
118 
119 # ifndef __cpp_lib_tuples_by_type
120 #   error "__cpp_lib_tuples_by_type should be defined in c++17"
121 # endif
122 # if __cpp_lib_tuples_by_type != 201304L
123 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
124 # endif
125 
126 #elif TEST_STD_VER == 20
127 
128 # ifndef __cpp_lib_apply
129 #   error "__cpp_lib_apply should be defined in c++20"
130 # endif
131 # if __cpp_lib_apply != 201603L
132 #   error "__cpp_lib_apply should have the value 201603L in c++20"
133 # endif
134 
135 # ifndef __cpp_lib_constexpr_tuple
136 #   error "__cpp_lib_constexpr_tuple should be defined in c++20"
137 # endif
138 # if __cpp_lib_constexpr_tuple != 201811L
139 #   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++20"
140 # endif
141 
142 # ifndef __cpp_lib_make_from_tuple
143 #   error "__cpp_lib_make_from_tuple should be defined in c++20"
144 # endif
145 # if __cpp_lib_make_from_tuple != 201606L
146 #   error "__cpp_lib_make_from_tuple should have the value 201606L in c++20"
147 # endif
148 
149 # ifdef __cpp_lib_ranges_zip
150 #   error "__cpp_lib_ranges_zip should not be defined before c++23"
151 # endif
152 
153 # ifndef __cpp_lib_tuple_element_t
154 #   error "__cpp_lib_tuple_element_t should be defined in c++20"
155 # endif
156 # if __cpp_lib_tuple_element_t != 201402L
157 #   error "__cpp_lib_tuple_element_t should have the value 201402L in c++20"
158 # endif
159 
160 # ifndef __cpp_lib_tuples_by_type
161 #   error "__cpp_lib_tuples_by_type should be defined in c++20"
162 # endif
163 # if __cpp_lib_tuples_by_type != 201304L
164 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
165 # endif
166 
167 #elif TEST_STD_VER > 20
168 
169 # ifndef __cpp_lib_apply
170 #   error "__cpp_lib_apply should be defined in c++23"
171 # endif
172 # if __cpp_lib_apply != 201603L
173 #   error "__cpp_lib_apply should have the value 201603L in c++23"
174 # endif
175 
176 # ifndef __cpp_lib_constexpr_tuple
177 #   error "__cpp_lib_constexpr_tuple should be defined in c++23"
178 # endif
179 # if __cpp_lib_constexpr_tuple != 201811L
180 #   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++23"
181 # endif
182 
183 # ifndef __cpp_lib_make_from_tuple
184 #   error "__cpp_lib_make_from_tuple should be defined in c++23"
185 # endif
186 # if __cpp_lib_make_from_tuple != 201606L
187 #   error "__cpp_lib_make_from_tuple should have the value 201606L in c++23"
188 # endif
189 
190 # if !defined(_LIBCPP_VERSION)
191 #   ifndef __cpp_lib_ranges_zip
192 #     error "__cpp_lib_ranges_zip should be defined in c++23"
193 #   endif
194 #   if __cpp_lib_ranges_zip != 202110L
195 #     error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
196 #   endif
197 # else // _LIBCPP_VERSION
198 #   ifdef __cpp_lib_ranges_zip
199 #     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
200 #   endif
201 # endif
202 
203 # ifndef __cpp_lib_tuple_element_t
204 #   error "__cpp_lib_tuple_element_t should be defined in c++23"
205 # endif
206 # if __cpp_lib_tuple_element_t != 201402L
207 #   error "__cpp_lib_tuple_element_t should have the value 201402L in c++23"
208 # endif
209 
210 # ifndef __cpp_lib_tuples_by_type
211 #   error "__cpp_lib_tuples_by_type should be defined in c++23"
212 # endif
213 # if __cpp_lib_tuples_by_type != 201304L
214 #   error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
215 # endif
216 
217 #endif // TEST_STD_VER > 20
218 
219