From 8e4e04b77176903e601af6e894f1a81907f0cd0b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 17 Aug 2020 19:10:08 -0700 Subject: [PATCH] Update __cpp_lib_coroutine. --- stl/inc/yvals_core.h | 9 ++++++--- .../VSO_0157762_feature_test_macros/test.cpp | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 9fa892ff5e..3043b0eec6 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -172,7 +172,6 @@ // (partially implemented) // P0898R3 Standard Library Concepts // P0912R5 Library Support For Coroutines -// (partially implemented, missing noop coroutines) // P0919R3 Heterogeneous Lookup For Unordered Containers // P0966R1 string::reserve() Should Not Shrink // P1001R2 execution::unseq @@ -1169,8 +1168,12 @@ #define __cpp_lib_constexpr_tuple 201811L #define __cpp_lib_constexpr_utility 201811L -#ifdef __cpp_impl_coroutine // TRANSITION, VS 2019 16.8 Preview 3 -#define __cpp_lib_coroutine 197000L +#ifdef __cpp_impl_coroutine // TRANSITION, Clang and EDG coroutine support +#if __cpp_impl_coroutine >= 201902L +#define __cpp_lib_coroutine 201902L +#else // ^^^ __cpp_impl_coroutine >= 201902L ^^^ / vvv __cpp_impl_coroutine < 201902L vvv +#define __cpp_lib_coroutine 197000L // TRANSITION, VS 2019 16.8 Preview 4 +#endif // ^^^ __cpp_impl_coroutine < 201902L ^^^ #endif // __cpp_impl_coroutine #define __cpp_lib_destroying_delete 201806L diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.cpp index 9bad3e0c1d..c3eaa1b577 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.cpp @@ -481,6 +481,25 @@ STATIC_ASSERT(__cpp_lib_constexpr_utility == 201811L); #endif #endif +#if _HAS_CXX20 && defined(__cpp_impl_coroutine) // TRANSITION, Clang and EDG coroutine support +#if __cpp_impl_coroutine >= 201902L +#define ExpectedCppLibCoroutine 201902L +#else +#define ExpectedCppLibCoroutine 197000L // TRANSITION, VS 2019 16.8 Preview 4 +#endif +#ifndef __cpp_lib_coroutine +#error __cpp_lib_coroutine is not defined +#elif __cpp_lib_coroutine != ExpectedCppLibCoroutine +#error __cpp_lib_coroutine is not ExpectedCppLibCoroutine +#else +STATIC_ASSERT(__cpp_lib_coroutine == ExpectedCppLibCoroutine); +#endif +#else +#ifdef __cpp_lib_coroutine +#error __cpp_lib_coroutine is defined +#endif +#endif + #if _HAS_CXX20 #ifndef __cpp_lib_destroying_delete #error __cpp_lib_destroying_delete is not defined