Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions stl/inc/new
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class _Ty>
Expand Down
11 changes: 8 additions & 3 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***
Expand Down
2 changes: 1 addition & 1 deletion tests/libcxx/skipped_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 30 additions & 0 deletions tests/std/tests/VSO_0157762_feature_test_macros/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down