diff --git a/stl/inc/new b/stl/inc/new index e8104d16efa..0b9c5f01aee 100644 --- a/stl/inc/new +++ b/stl/inc/new @@ -19,6 +19,14 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN +#ifdef __cpp_lib_destroying_delete +// STRUCT destroying_delete_t +struct destroying_delete_t { + explicit destroying_delete_t() = default; +}; +inline constexpr destroying_delete_t destroying_delete{}; +#endif // __cpp_lib_destroying_delete + #if _HAS_CXX17 // FUNCTION TEMPLATE launder template diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index af8b115c858..43358f8e8b4 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1106,9 +1106,14 @@ #define __cpp_lib_concepts 201907L #endif // defined(__cpp_concepts) && __cpp_concepts > 201507L -#define __cpp_lib_constexpr_algorithms 201806L -#define __cpp_lib_constexpr_memory 201811L -#define __cpp_lib_constexpr_numeric 201911L +#define __cpp_lib_constexpr_algorithms 201806L +#define __cpp_lib_constexpr_memory 201811L +#define __cpp_lib_constexpr_numeric 201911L + +#ifdef __cpp_impl_destroying_delete +#define __cpp_lib_destroying_delete 201806L +#endif // __cpp_impl_destroying_delete + #define __cpp_lib_endian 201907L #define __cpp_lib_erase_if 202002L #define __cpp_lib_generic_unordered_lookup 201811L diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index a9b45e1a6a8..dce7868badb 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -497,9 +497,9 @@ std/thread/thread.semaphore/version.pass.cpp SKIP # *** MISSING COMPILER FEATURES *** -# C++20 P0722R3 "Efficient sized delete for variable sized classes" -std/language.support/support.dynamic/destroying_delete_t_declaration.pass.cpp SKIP -std/language.support/support.dynamic/destroying_delete_t.pass.cpp SKIP +# C++20 P0722R3 "Efficient sized delete for variable sized classes" // TRANSITION, VS2019 16.7p1 +std/language.support/support.dynamic/destroying_delete_t_declaration.pass.cpp:0 SKIP +std/language.support/support.dynamic/destroying_delete_t.pass.cpp:0 SKIP # *** MISSING LWG ISSUE RESOLUTIONS *** diff --git a/tests/libcxx/skipped_tests.txt b/tests/libcxx/skipped_tests.txt index 0b634f7fa8d..e70acb92448 100644 --- a/tests/libcxx/skipped_tests.txt +++ b/tests/libcxx/skipped_tests.txt @@ -497,7 +497,7 @@ thread\thread.semaphore\version.pass.cpp # *** MISSING COMPILER FEATURES *** -# C++20 P0722R3 "Efficient sized delete for variable sized classes" +# C++20 P0722R3 "Efficient sized delete for variable sized classes" // TRANSITION, VS2019 16.7p1 language.support\support.dynamic\destroying_delete_t_declaration.pass.cpp language.support\support.dynamic\destroying_delete_t.pass.cpp 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 2a7a4f5afc8..eb6bc62a8b4 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.cpp @@ -317,6 +317,22 @@ STATIC_ASSERT(__cpp_if_constexpr == 201606L); #endif #endif +#if defined(__clang__) || defined(__EDG__) // TRANSITION, VS 2019 16.7p1 +#if defined(__clang__) || _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG +#ifndef __cpp_impl_destroying_delete +#error __cpp_impl_destroying_delete is not defined +#elif __cpp_impl_destroying_delete != 201806L +#error __cpp_impl_destroying_delete is not 201806L +#else +STATIC_ASSERT(__cpp_impl_destroying_delete == 201806L); +#endif +#else +#ifdef __cpp_impl_destroying_delete +#error __cpp_impl_destroying_delete is defined +#endif +#endif +#endif + #if _HAS_CXX20 && (!defined(__clang__) || __clang_major__ >= 10) #ifndef __cpp_impl_three_way_comparison #error __cpp_impl_three_way_comparison is not defined @@ -992,6 +1008,20 @@ STATIC_ASSERT(__cpp_lib_constexpr_numeric == 201911L); #endif #endif +#if _HAS_CXX20 && defined(__cpp_impl_destroying_delete) // TRANSITION, EDG and VS 2019 16.7p1 +#ifndef __cpp_lib_destroying_delete +#error __cpp_lib_destroying_delete is not defined +#elif __cpp_lib_destroying_delete != 201806L +#error __cpp_lib_destroying_delete is not 201806L +#else +STATIC_ASSERT(__cpp_lib_destroying_delete == 201806L); +#endif +#else +#ifdef __cpp_lib_destroying_delete +#error __cpp_lib_destroying_delete is defined +#endif +#endif + #ifndef __cpp_lib_enable_shared_from_this #error __cpp_lib_enable_shared_from_this is not defined #elif __cpp_lib_enable_shared_from_this != 201603L