From 7a69988f2d84f4d6acdd2e4a1ac60ac2871038e8 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Mon, 31 Jan 2022 22:02:08 +0800 Subject: [PATCH] LWG-3621 Remove feature-test macro __cpp_lib_monadic_optional --- stl/inc/yvals_core.h | 11 ++++----- .../test.compile.pass.cpp | 24 +++++++------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index e8e26e853f..e211335451 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1365,12 +1365,7 @@ #define __cpp_lib_byteswap 202110L #define __cpp_lib_invoke_r 202106L #define __cpp_lib_is_scoped_enum 202011L - -#ifdef __cpp_lib_concepts -#define __cpp_lib_monadic_optional 202110L -#endif // __cpp_lib_concepts - -#define __cpp_lib_move_only_function 202110L +#define __cpp_lib_move_only_function 202110L #ifdef __cpp_lib_concepts #define __cpp_lib_out_ptr 202106L @@ -1407,7 +1402,9 @@ #endif // language mode #endif // _M_CEE -#if _HAS_CXX20 +#if _HAS_CXX23 && defined(__cpp_lib_concepts) +#define __cpp_lib_optional 202110L // P0798R8 Monadic Operations For optional +#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv #define __cpp_lib_optional 202106L // P2231R1 Completing constexpr In optional And variant #elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv #define __cpp_lib_optional 201606L // P0307R2 Making Optional Greater Equal Again diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index 63ce14634b..2a83ad6174 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -1192,20 +1192,6 @@ STATIC_ASSERT(__cpp_lib_memory_resource == 201603L); #endif #endif -#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support -#ifndef __cpp_lib_monadic_optional -#error __cpp_lib_monadic_optional is not defined -#elif __cpp_lib_monadic_optional != 202110L -#error __cpp_lib_monadic_optional is not 202110L -#else -STATIC_ASSERT(__cpp_lib_monadic_optional == 202110L); -#endif -#else -#ifdef __cpp_lib_monadic_optional -#error __cpp_lib_monadic_optional is defined -#endif -#endif - #if _HAS_CXX23 #ifndef __cpp_lib_move_only_function #error __cpp_lib_move_only_function is not defined @@ -1264,7 +1250,15 @@ STATIC_ASSERT(__cpp_lib_not_fn == 201603L); STATIC_ASSERT(__cpp_lib_null_iterators == 201304L); #endif -#if _HAS_CXX20 +#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support +#ifndef __cpp_lib_optional +#error __cpp_lib_optional is not defined +#elif __cpp_lib_optional != 202110L +#error __cpp_lib_optional is not 202110L +#else +STATIC_ASSERT(__cpp_lib_optional == 202110L); +#endif +#elif _HAS_CXX20 #ifndef __cpp_lib_optional #error __cpp_lib_optional is not defined #elif __cpp_lib_optional != 202106L