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