126 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// <expected>13 14// Test the feature test macros defined by <expected>15 16// clang-format off17 18#include <expected>19#include "test_macros.h"20 21#if TEST_STD_VER < 1422 23# ifdef __cpp_lib_constrained_equality24# error "__cpp_lib_constrained_equality should not be defined before c++26"25# endif26 27# ifdef __cpp_lib_expected28# error "__cpp_lib_expected should not be defined before c++23"29# endif30 31# ifdef __cpp_lib_freestanding_expected32# error "__cpp_lib_freestanding_expected should not be defined before c++26"33# endif34 35#elif TEST_STD_VER == 1436 37# ifdef __cpp_lib_constrained_equality38# error "__cpp_lib_constrained_equality should not be defined before c++26"39# endif40 41# ifdef __cpp_lib_expected42# error "__cpp_lib_expected should not be defined before c++23"43# endif44 45# ifdef __cpp_lib_freestanding_expected46# error "__cpp_lib_freestanding_expected should not be defined before c++26"47# endif48 49#elif TEST_STD_VER == 1750 51# ifdef __cpp_lib_constrained_equality52# error "__cpp_lib_constrained_equality should not be defined before c++26"53# endif54 55# ifdef __cpp_lib_expected56# error "__cpp_lib_expected should not be defined before c++23"57# endif58 59# ifdef __cpp_lib_freestanding_expected60# error "__cpp_lib_freestanding_expected should not be defined before c++26"61# endif62 63#elif TEST_STD_VER == 2064 65# ifdef __cpp_lib_constrained_equality66# error "__cpp_lib_constrained_equality should not be defined before c++26"67# endif68 69# ifdef __cpp_lib_expected70# error "__cpp_lib_expected should not be defined before c++23"71# endif72 73# ifdef __cpp_lib_freestanding_expected74# error "__cpp_lib_freestanding_expected should not be defined before c++26"75# endif76 77#elif TEST_STD_VER == 2378 79# ifdef __cpp_lib_constrained_equality80# error "__cpp_lib_constrained_equality should not be defined before c++26"81# endif82 83# ifndef __cpp_lib_expected84# error "__cpp_lib_expected should be defined in c++23"85# endif86# if __cpp_lib_expected != 202211L87# error "__cpp_lib_expected should have the value 202211L in c++23"88# endif89 90# ifdef __cpp_lib_freestanding_expected91# error "__cpp_lib_freestanding_expected should not be defined before c++26"92# endif93 94#elif TEST_STD_VER > 2395 96# ifndef __cpp_lib_constrained_equality97# error "__cpp_lib_constrained_equality should be defined in c++26"98# endif99# if __cpp_lib_constrained_equality != 202411L100# error "__cpp_lib_constrained_equality should have the value 202411L in c++26"101# endif102 103# ifndef __cpp_lib_expected104# error "__cpp_lib_expected should be defined in c++26"105# endif106# if __cpp_lib_expected != 202211L107# error "__cpp_lib_expected should have the value 202211L in c++26"108# endif109 110# if !defined(_LIBCPP_VERSION)111# ifndef __cpp_lib_freestanding_expected112# error "__cpp_lib_freestanding_expected should be defined in c++26"113# endif114# if __cpp_lib_freestanding_expected != 202311L115# error "__cpp_lib_freestanding_expected should have the value 202311L in c++26"116# endif117# else118# ifdef __cpp_lib_freestanding_expected119# error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!"120# endif121# endif122 123#endif // TEST_STD_VER > 23124 125// clang-format on126