489 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// WARNING: This test was generated by generate_feature_test_macro_components.py10// and should not be edited manually.11 12// <utility>13 14// Test the feature test macros defined by <utility>15 16// clang-format off17 18#include <utility>19#include "test_macros.h"20 21#if TEST_STD_VER < 1422 23# ifdef __cpp_lib_as_const24# error "__cpp_lib_as_const should not be defined before c++17"25# endif26 27# ifdef __cpp_lib_constexpr_algorithms28# error "__cpp_lib_constexpr_algorithms should not be defined before c++20"29# endif30 31# ifdef __cpp_lib_constexpr_utility32# error "__cpp_lib_constexpr_utility should not be defined before c++20"33# endif34 35# ifdef __cpp_lib_constrained_equality36# error "__cpp_lib_constrained_equality should not be defined before c++26"37# endif38 39# ifdef __cpp_lib_exchange_function40# error "__cpp_lib_exchange_function should not be defined before c++14"41# endif42 43# ifdef __cpp_lib_forward_like44# error "__cpp_lib_forward_like should not be defined before c++23"45# endif46 47# ifdef __cpp_lib_integer_comparison_functions48# error "__cpp_lib_integer_comparison_functions should not be defined before c++20"49# endif50 51# ifdef __cpp_lib_integer_sequence52# error "__cpp_lib_integer_sequence should not be defined before c++14"53# endif54 55# ifdef __cpp_lib_ranges_zip56# error "__cpp_lib_ranges_zip should not be defined before c++23"57# endif58 59# ifdef __cpp_lib_to_underlying60# error "__cpp_lib_to_underlying should not be defined before c++23"61# endif62 63# ifdef __cpp_lib_tuple_like64# error "__cpp_lib_tuple_like should not be defined before c++23"65# endif66 67# ifdef __cpp_lib_tuples_by_type68# error "__cpp_lib_tuples_by_type should not be defined before c++14"69# endif70 71# ifdef __cpp_lib_unreachable72# error "__cpp_lib_unreachable should not be defined before c++23"73# endif74 75#elif TEST_STD_VER == 1476 77# ifdef __cpp_lib_as_const78# error "__cpp_lib_as_const should not be defined before c++17"79# endif80 81# ifdef __cpp_lib_constexpr_algorithms82# error "__cpp_lib_constexpr_algorithms should not be defined before c++20"83# endif84 85# ifdef __cpp_lib_constexpr_utility86# error "__cpp_lib_constexpr_utility should not be defined before c++20"87# endif88 89# ifdef __cpp_lib_constrained_equality90# error "__cpp_lib_constrained_equality should not be defined before c++26"91# endif92 93# ifndef __cpp_lib_exchange_function94# error "__cpp_lib_exchange_function should be defined in c++14"95# endif96# if __cpp_lib_exchange_function != 201304L97# error "__cpp_lib_exchange_function should have the value 201304L in c++14"98# endif99 100# ifdef __cpp_lib_forward_like101# error "__cpp_lib_forward_like should not be defined before c++23"102# endif103 104# ifdef __cpp_lib_integer_comparison_functions105# error "__cpp_lib_integer_comparison_functions should not be defined before c++20"106# endif107 108# ifndef __cpp_lib_integer_sequence109# error "__cpp_lib_integer_sequence should be defined in c++14"110# endif111# if __cpp_lib_integer_sequence != 201304L112# error "__cpp_lib_integer_sequence should have the value 201304L in c++14"113# endif114 115# ifdef __cpp_lib_ranges_zip116# error "__cpp_lib_ranges_zip should not be defined before c++23"117# endif118 119# ifdef __cpp_lib_to_underlying120# error "__cpp_lib_to_underlying should not be defined before c++23"121# endif122 123# ifdef __cpp_lib_tuple_like124# error "__cpp_lib_tuple_like should not be defined before c++23"125# endif126 127# ifndef __cpp_lib_tuples_by_type128# error "__cpp_lib_tuples_by_type should be defined in c++14"129# endif130# if __cpp_lib_tuples_by_type != 201304L131# error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"132# endif133 134# ifdef __cpp_lib_unreachable135# error "__cpp_lib_unreachable should not be defined before c++23"136# endif137 138#elif TEST_STD_VER == 17139 140# ifndef __cpp_lib_as_const141# error "__cpp_lib_as_const should be defined in c++17"142# endif143# if __cpp_lib_as_const != 201510L144# error "__cpp_lib_as_const should have the value 201510L in c++17"145# endif146 147# ifdef __cpp_lib_constexpr_algorithms148# error "__cpp_lib_constexpr_algorithms should not be defined before c++20"149# endif150 151# ifdef __cpp_lib_constexpr_utility152# error "__cpp_lib_constexpr_utility should not be defined before c++20"153# endif154 155# ifdef __cpp_lib_constrained_equality156# error "__cpp_lib_constrained_equality should not be defined before c++26"157# endif158 159# ifndef __cpp_lib_exchange_function160# error "__cpp_lib_exchange_function should be defined in c++17"161# endif162# if __cpp_lib_exchange_function != 201304L163# error "__cpp_lib_exchange_function should have the value 201304L in c++17"164# endif165 166# ifdef __cpp_lib_forward_like167# error "__cpp_lib_forward_like should not be defined before c++23"168# endif169 170# ifdef __cpp_lib_integer_comparison_functions171# error "__cpp_lib_integer_comparison_functions should not be defined before c++20"172# endif173 174# ifndef __cpp_lib_integer_sequence175# error "__cpp_lib_integer_sequence should be defined in c++17"176# endif177# if __cpp_lib_integer_sequence != 201304L178# error "__cpp_lib_integer_sequence should have the value 201304L in c++17"179# endif180 181# ifdef __cpp_lib_ranges_zip182# error "__cpp_lib_ranges_zip should not be defined before c++23"183# endif184 185# ifdef __cpp_lib_to_underlying186# error "__cpp_lib_to_underlying should not be defined before c++23"187# endif188 189# ifdef __cpp_lib_tuple_like190# error "__cpp_lib_tuple_like should not be defined before c++23"191# endif192 193# ifndef __cpp_lib_tuples_by_type194# error "__cpp_lib_tuples_by_type should be defined in c++17"195# endif196# if __cpp_lib_tuples_by_type != 201304L197# error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"198# endif199 200# ifdef __cpp_lib_unreachable201# error "__cpp_lib_unreachable should not be defined before c++23"202# endif203 204#elif TEST_STD_VER == 20205 206# ifndef __cpp_lib_as_const207# error "__cpp_lib_as_const should be defined in c++20"208# endif209# if __cpp_lib_as_const != 201510L210# error "__cpp_lib_as_const should have the value 201510L in c++20"211# endif212 213# ifndef __cpp_lib_constexpr_algorithms214# error "__cpp_lib_constexpr_algorithms should be defined in c++20"215# endif216# if __cpp_lib_constexpr_algorithms != 201806L217# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"218# endif219 220# ifndef __cpp_lib_constexpr_utility221# error "__cpp_lib_constexpr_utility should be defined in c++20"222# endif223# if __cpp_lib_constexpr_utility != 201811L224# error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"225# endif226 227# ifdef __cpp_lib_constrained_equality228# error "__cpp_lib_constrained_equality should not be defined before c++26"229# endif230 231# ifndef __cpp_lib_exchange_function232# error "__cpp_lib_exchange_function should be defined in c++20"233# endif234# if __cpp_lib_exchange_function != 201304L235# error "__cpp_lib_exchange_function should have the value 201304L in c++20"236# endif237 238# ifdef __cpp_lib_forward_like239# error "__cpp_lib_forward_like should not be defined before c++23"240# endif241 242# ifndef __cpp_lib_integer_comparison_functions243# error "__cpp_lib_integer_comparison_functions should be defined in c++20"244# endif245# if __cpp_lib_integer_comparison_functions != 202002L246# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20"247# endif248 249# ifndef __cpp_lib_integer_sequence250# error "__cpp_lib_integer_sequence should be defined in c++20"251# endif252# if __cpp_lib_integer_sequence != 201304L253# error "__cpp_lib_integer_sequence should have the value 201304L in c++20"254# endif255 256# ifdef __cpp_lib_ranges_zip257# error "__cpp_lib_ranges_zip should not be defined before c++23"258# endif259 260# ifdef __cpp_lib_to_underlying261# error "__cpp_lib_to_underlying should not be defined before c++23"262# endif263 264# ifdef __cpp_lib_tuple_like265# error "__cpp_lib_tuple_like should not be defined before c++23"266# endif267 268# ifndef __cpp_lib_tuples_by_type269# error "__cpp_lib_tuples_by_type should be defined in c++20"270# endif271# if __cpp_lib_tuples_by_type != 201304L272# error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"273# endif274 275# ifdef __cpp_lib_unreachable276# error "__cpp_lib_unreachable should not be defined before c++23"277# endif278 279#elif TEST_STD_VER == 23280 281# ifndef __cpp_lib_as_const282# error "__cpp_lib_as_const should be defined in c++23"283# endif284# if __cpp_lib_as_const != 201510L285# error "__cpp_lib_as_const should have the value 201510L in c++23"286# endif287 288# ifndef __cpp_lib_constexpr_algorithms289# error "__cpp_lib_constexpr_algorithms should be defined in c++23"290# endif291# if __cpp_lib_constexpr_algorithms != 201806L292# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"293# endif294 295# ifndef __cpp_lib_constexpr_utility296# error "__cpp_lib_constexpr_utility should be defined in c++23"297# endif298# if __cpp_lib_constexpr_utility != 201811L299# error "__cpp_lib_constexpr_utility should have the value 201811L in c++23"300# endif301 302# ifdef __cpp_lib_constrained_equality303# error "__cpp_lib_constrained_equality should not be defined before c++26"304# endif305 306# ifndef __cpp_lib_exchange_function307# error "__cpp_lib_exchange_function should be defined in c++23"308# endif309# if __cpp_lib_exchange_function != 201304L310# error "__cpp_lib_exchange_function should have the value 201304L in c++23"311# endif312 313# ifndef __cpp_lib_forward_like314# error "__cpp_lib_forward_like should be defined in c++23"315# endif316# if __cpp_lib_forward_like != 202207L317# error "__cpp_lib_forward_like should have the value 202207L in c++23"318# endif319 320# ifndef __cpp_lib_integer_comparison_functions321# error "__cpp_lib_integer_comparison_functions should be defined in c++23"322# endif323# if __cpp_lib_integer_comparison_functions != 202002L324# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++23"325# endif326 327# ifndef __cpp_lib_integer_sequence328# error "__cpp_lib_integer_sequence should be defined in c++23"329# endif330# if __cpp_lib_integer_sequence != 201304L331# error "__cpp_lib_integer_sequence should have the value 201304L in c++23"332# endif333 334# if !defined(_LIBCPP_VERSION)335# ifndef __cpp_lib_ranges_zip336# error "__cpp_lib_ranges_zip should be defined in c++23"337# endif338# if __cpp_lib_ranges_zip != 202110L339# error "__cpp_lib_ranges_zip should have the value 202110L in c++23"340# endif341# else342# ifdef __cpp_lib_ranges_zip343# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"344# endif345# endif346 347# ifndef __cpp_lib_to_underlying348# error "__cpp_lib_to_underlying should be defined in c++23"349# endif350# if __cpp_lib_to_underlying != 202102L351# error "__cpp_lib_to_underlying should have the value 202102L in c++23"352# endif353 354# if !defined(_LIBCPP_VERSION)355# ifndef __cpp_lib_tuple_like356# error "__cpp_lib_tuple_like should be defined in c++23"357# endif358# if __cpp_lib_tuple_like != 202207L359# error "__cpp_lib_tuple_like should have the value 202207L in c++23"360# endif361# else362# ifdef __cpp_lib_tuple_like363# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"364# endif365# endif366 367# ifndef __cpp_lib_tuples_by_type368# error "__cpp_lib_tuples_by_type should be defined in c++23"369# endif370# if __cpp_lib_tuples_by_type != 201304L371# error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"372# endif373 374# ifndef __cpp_lib_unreachable375# error "__cpp_lib_unreachable should be defined in c++23"376# endif377# if __cpp_lib_unreachable != 202202L378# error "__cpp_lib_unreachable should have the value 202202L in c++23"379# endif380 381#elif TEST_STD_VER > 23382 383# ifndef __cpp_lib_as_const384# error "__cpp_lib_as_const should be defined in c++26"385# endif386# if __cpp_lib_as_const != 201510L387# error "__cpp_lib_as_const should have the value 201510L in c++26"388# endif389 390# ifndef __cpp_lib_constexpr_algorithms391# error "__cpp_lib_constexpr_algorithms should be defined in c++26"392# endif393# if __cpp_lib_constexpr_algorithms != 202306L394# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"395# endif396 397# ifndef __cpp_lib_constexpr_utility398# error "__cpp_lib_constexpr_utility should be defined in c++26"399# endif400# if __cpp_lib_constexpr_utility != 201811L401# error "__cpp_lib_constexpr_utility should have the value 201811L in c++26"402# endif403 404# ifndef __cpp_lib_constrained_equality405# error "__cpp_lib_constrained_equality should be defined in c++26"406# endif407# if __cpp_lib_constrained_equality != 202411L408# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"409# endif410 411# ifndef __cpp_lib_exchange_function412# error "__cpp_lib_exchange_function should be defined in c++26"413# endif414# if __cpp_lib_exchange_function != 201304L415# error "__cpp_lib_exchange_function should have the value 201304L in c++26"416# endif417 418# ifndef __cpp_lib_forward_like419# error "__cpp_lib_forward_like should be defined in c++26"420# endif421# if __cpp_lib_forward_like != 202207L422# error "__cpp_lib_forward_like should have the value 202207L in c++26"423# endif424 425# ifndef __cpp_lib_integer_comparison_functions426# error "__cpp_lib_integer_comparison_functions should be defined in c++26"427# endif428# if __cpp_lib_integer_comparison_functions != 202002L429# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++26"430# endif431 432# ifndef __cpp_lib_integer_sequence433# error "__cpp_lib_integer_sequence should be defined in c++26"434# endif435# if __cpp_lib_integer_sequence != 201304L436# error "__cpp_lib_integer_sequence should have the value 201304L in c++26"437# endif438 439# if !defined(_LIBCPP_VERSION)440# ifndef __cpp_lib_ranges_zip441# error "__cpp_lib_ranges_zip should be defined in c++26"442# endif443# if __cpp_lib_ranges_zip != 202110L444# error "__cpp_lib_ranges_zip should have the value 202110L in c++26"445# endif446# else447# ifdef __cpp_lib_ranges_zip448# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"449# endif450# endif451 452# ifndef __cpp_lib_to_underlying453# error "__cpp_lib_to_underlying should be defined in c++26"454# endif455# if __cpp_lib_to_underlying != 202102L456# error "__cpp_lib_to_underlying should have the value 202102L in c++26"457# endif458 459# if !defined(_LIBCPP_VERSION)460# ifndef __cpp_lib_tuple_like461# error "__cpp_lib_tuple_like should be defined in c++26"462# endif463# if __cpp_lib_tuple_like != 202311L464# error "__cpp_lib_tuple_like should have the value 202311L in c++26"465# endif466# else467# ifdef __cpp_lib_tuple_like468# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"469# endif470# endif471 472# ifndef __cpp_lib_tuples_by_type473# error "__cpp_lib_tuples_by_type should be defined in c++26"474# endif475# if __cpp_lib_tuples_by_type != 201304L476# error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"477# endif478 479# ifndef __cpp_lib_unreachable480# error "__cpp_lib_unreachable should be defined in c++26"481# endif482# if __cpp_lib_unreachable != 202202L483# error "__cpp_lib_unreachable should have the value 202202L in c++26"484# endif485 486#endif // TEST_STD_VER > 23487 488// clang-format on489