From cfc6f172eb5c9d5f6da719939005d1dd4bcf684d Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 22:16:21 +0200 Subject: [PATCH 01/15] P1413R3 Deprecate aligned_storage & aligned_union Resolves #2533 --- stl/inc/mutex | 2 + stl/inc/type_traits | 5 ++- stl/inc/yvals_core.h | 39 ++++++++++++++++++- stl/src/cond.cpp | 1 + stl/src/mutex.cpp | 1 + .../test.cpp | 1 + .../test.cpp | 1 + .../test.cpp | 2 + .../P0035R4_over_aligned_allocation/test.cpp | 1 + tests/std/tests/P0088R3_variant/test.cpp | 1 + .../test.cpp | 1 + .../test.compile.pass.cpp | 1 + tests/tr1/tests/type_traits1/test.cpp | 3 ++ tests/tr1/tests/type_traits5/test.cpp | 3 ++ 14 files changed, 59 insertions(+), 3 deletions(-) diff --git a/stl/inc/mutex b/stl/inc/mutex index 2bd292f81c..5a578bfb5f 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -76,6 +76,7 @@ private: friend condition_variable; friend condition_variable_any; +#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 aligned_storage_t<_Mtx_internal_imp_size, _Mtx_internal_imp_alignment> _Mtx_storage; _Mtx_t _Mymtx() noexcept { // get pointer to _Mtx_internal_imp_t inside _Mtx_storage @@ -698,6 +699,7 @@ public: } private: +#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 aligned_storage_t<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment> _Cnd_storage; _Cnd_t _Mycnd() noexcept { // get pointer to _Cnd_internal_imp_t inside _Cnd_storage diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 2aa95b03e4..55b4572200 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1022,7 +1022,7 @@ struct _Aligned<_Len, _Align, char, false> { }; template -struct aligned_storage { // define type with size _Len and alignment _Align +struct _CXX23_DEPRECATE_ALIGNED_STORAGE aligned_storage { // define type with size _Len and alignment _Align using _Next = char; static constexpr bool _Fits = _Align <= alignof(_Next); using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; @@ -1046,7 +1046,8 @@ struct _Maximum<_First, _Second, _Rest...> : _Maximum<(_First < _Second ? _Secon }; template -struct aligned_union { // define type with size at least _Len, for storing anything in _Types +struct _CXX23_DEPRECATE_ALIGNED_UNION aligned_union { // define type with size at least _Len, for storing anything in + // _Types static constexpr size_t _Max_len = _Maximum<_Len, sizeof(_Types)...>::value; // NOT sizeof...(_Types) static constexpr size_t alignment_value = _Maximum::value; diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index f46feecd0c..4e7497f1ab 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -291,6 +291,7 @@ // P1132R7 out_ptr(), inout_ptr() // P1147R1 Printing volatile Pointers // P1272R4 byteswap() +// P1413R3 Deprecate aligned_storage And aligned_union // P1425R4 Iterator Pair Constructors For stack And queue // P1659R3 ranges::starts_with, ranges::ends_with // P1679R3 contains() For basic_string/basic_string_view @@ -1105,7 +1106,43 @@ #define _CXX20_DEPRECATE_IS_ALWAYS_EQUAL #endif // ^^^ warning disabled ^^^ -// next warning number: STL4034 +#if _HAS_CXX20 && !defined(_SILENCE_CXX20_IS_ALWAYS_EQUAL_DEPRECATION_WARNING) \ + && !defined(_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS) +#define _CXX20_DEPRECATE_IS_ALWAYS_EQUAL \ + [[deprecated("warning STL4033: " \ + "std::allocator::is_always_equal is deprecated in C++20 by LWG-3170. " \ + "Prefer std::allocator_traits>::is_always_equal. " \ + "You can define _SILENCE_CXX20_IS_ALWAYS_EQUAL_DEPRECATION_WARNING " \ + "or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] +#else // ^^^ warning enabled / warning disabled vvv +#define _CXX20_DEPRECATE_IS_ALWAYS_EQUAL +#endif // ^^^ warning disabled ^^^ + +#if _HAS_CXX23 && !defined(_SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING) \ + && !defined(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS) +#define _CXX23_DEPRECATE_ALIGNED_STORAGE \ + [[deprecated("warning STL4034: " \ + "std::aligned_storage is deprecated in C++23 by P1413R3. " \ + "Prefer alignas(T) std::byte t_buff[sizeof(T)]." \ + "You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING " \ + "or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] +#else // ^^^ warning enabled / warning disabled vvv +#define _CXX23_DEPRECATE_ALIGNED_STORAGE +#endif // ^^^ warning disabled ^^^ + +#if _HAS_CXX23 && !defined(_SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING) \ + && !defined(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS) +#define _CXX23_DEPRECATE_ALIGNED_UNION \ + [[deprecated("warning STL4035: " \ + "std::aligned_union is deprecated in C++23 by P1413R3. " \ + "Prefer alignas(T) std::byte t_buff[sizeof(T)]." \ + "You can define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING " \ + "or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] +#else // ^^^ warning enabled / warning disabled vvv +#define _CXX23_DEPRECATE_ALIGNED_UNION +#endif // ^^^ warning disabled ^^^ + +// next warning number: STL4036 // P0619R4 Removing C++17-Deprecated Features #ifndef _HAS_FEATURES_REMOVED_IN_CXX20 diff --git a/stl/src/cond.cpp b/stl/src/cond.cpp index 350bb5c60e..10ee633a5b 100644 --- a/stl/src/cond.cpp +++ b/stl/src/cond.cpp @@ -12,6 +12,7 @@ #include "primitives.hpp" struct _Cnd_internal_imp_t { // condition variable implementation for ConcRT +#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 std::aligned_storage_t cv; diff --git a/stl/src/mutex.cpp b/stl/src/mutex.cpp index 5db8385bec..bee101f9da 100644 --- a/stl/src/mutex.cpp +++ b/stl/src/mutex.cpp @@ -40,6 +40,7 @@ extern "C" _CRTIMP2 void __cdecl __set_stl_sync_api_mode(__stl_sync_api_modes_en struct _Mtx_internal_imp_t { // ConcRT mutex int type; +#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 std::aligned_storage_t cs; diff --git a/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp b/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp index b4765400c7..35346dc1b6 100644 --- a/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp +++ b/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #include diff --git a/tests/std/tests/Dev11_0000000_user_defined_literals/test.cpp b/tests/std/tests/Dev11_0000000_user_defined_literals/test.cpp index 35a271def5..545da00ef0 100644 --- a/tests/std/tests/Dev11_0000000_user_defined_literals/test.cpp +++ b/tests/std/tests/Dev11_0000000_user_defined_literals/test.cpp @@ -3,6 +3,7 @@ #define _HAS_DEPRECATED_RAW_STORAGE_ITERATOR 1 #define _SILENCE_CXX17_RAW_STORAGE_ITERATOR_DEPRECATION_WARNING +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING #define _SILENCE_EXPERIMENTAL_ERASE_DEPRECATION_WARNING #include diff --git a/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp b/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp index 6a33ce1099..268721302d 100644 --- a/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp +++ b/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING + #include #include #include diff --git a/tests/std/tests/P0035R4_over_aligned_allocation/test.cpp b/tests/std/tests/P0035R4_over_aligned_allocation/test.cpp index 5af1ff3335..7a21362fb2 100644 --- a/tests/std/tests/P0035R4_over_aligned_allocation/test.cpp +++ b/tests/std/tests/P0035R4_over_aligned_allocation/test.cpp @@ -4,6 +4,7 @@ #define _ENABLE_EXTENDED_ALIGNED_STORAGE #define _HAS_DEPRECATED_TEMPORARY_BUFFER 1 #define _SILENCE_CXX17_TEMPORARY_BUFFER_DEPRECATION_WARNING +#define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING #include #include diff --git a/tests/std/tests/P0088R3_variant/test.cpp b/tests/std/tests/P0088R3_variant/test.cpp index 1212126d9a..f23e06db76 100644 --- a/tests/std/tests/P0088R3_variant/test.cpp +++ b/tests/std/tests/P0088R3_variant/test.cpp @@ -38,6 +38,7 @@ #define _HAS_DEPRECATED_RESULT_OF 1 #define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING #define _SILENCE_CXX20_VOLATILE_DEPRECATION_WARNING +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING #define _LIBCXX_IN_DEVCRT #include // Must precede any other libc++ headers diff --git a/tests/std/tests/P0220R1_polymorphic_memory_resources/test.cpp b/tests/std/tests/P0220R1_polymorphic_memory_resources/test.cpp index 2f07716f71..b7c64d3a1a 100644 --- a/tests/std/tests/P0220R1_polymorphic_memory_resources/test.cpp +++ b/tests/std/tests/P0220R1_polymorphic_memory_resources/test.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #define _SILENCE_CXX17_POLYMORPHIC_ALLOCATOR_DESTROY_DEPRECATION_WARNING +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING #include #include diff --git a/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp index 657446e624..6609f1e34c 100644 --- a/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp @@ -6,6 +6,7 @@ #define _SILENCE_CXX17_IS_LITERAL_TYPE_DEPRECATION_WARNING #define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING #define _SILENCE_CXX20_IS_POD_DEPRECATION_WARNING +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING #define _USE_NAMED_IDL_NAMESPACE 1 #include diff --git a/tests/tr1/tests/type_traits1/test.cpp b/tests/tr1/tests/type_traits1/test.cpp index 0f2e378fa0..d07015289b 100644 --- a/tests/tr1/tests/type_traits1/test.cpp +++ b/tests/tr1/tests/type_traits1/test.cpp @@ -4,6 +4,9 @@ // test header, part 1 #define TEST_NAME ", part 1" +#define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING + #include "tdefs.h" #include "typetr.h" #include diff --git a/tests/tr1/tests/type_traits5/test.cpp b/tests/tr1/tests/type_traits5/test.cpp index 87c05096a2..9cdf000555 100644 --- a/tests/tr1/tests/type_traits5/test.cpp +++ b/tests/tr1/tests/type_traits5/test.cpp @@ -5,6 +5,9 @@ #define TEST_NAME ", part 5" #define _DISABLE_EXTENDED_ALIGNED_STORAGE 1 +#define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING +#define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING + #include "tdefs.h" #include "typetr.h" #include From 1ac53db5c709e220639c26a8add2ccf4ff696304 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 22:22:38 +0200 Subject: [PATCH 02/15] extra copy --- stl/inc/yvals_core.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 4e7497f1ab..68a67a966d 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1106,18 +1106,6 @@ #define _CXX20_DEPRECATE_IS_ALWAYS_EQUAL #endif // ^^^ warning disabled ^^^ -#if _HAS_CXX20 && !defined(_SILENCE_CXX20_IS_ALWAYS_EQUAL_DEPRECATION_WARNING) \ - && !defined(_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS) -#define _CXX20_DEPRECATE_IS_ALWAYS_EQUAL \ - [[deprecated("warning STL4033: " \ - "std::allocator::is_always_equal is deprecated in C++20 by LWG-3170. " \ - "Prefer std::allocator_traits>::is_always_equal. " \ - "You can define _SILENCE_CXX20_IS_ALWAYS_EQUAL_DEPRECATION_WARNING " \ - "or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] -#else // ^^^ warning enabled / warning disabled vvv -#define _CXX20_DEPRECATE_IS_ALWAYS_EQUAL -#endif // ^^^ warning disabled ^^^ - #if _HAS_CXX23 && !defined(_SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING) \ && !defined(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS) #define _CXX23_DEPRECATE_ALIGNED_STORAGE \ From d036c51d9c9beaa92624dcf6ad1aba8ecc9e5ae6 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 22:26:20 +0200 Subject: [PATCH 03/15] preference --- stl/inc/yvals_core.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 68a67a966d..49eb9d9baa 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1120,11 +1120,11 @@ #if _HAS_CXX23 && !defined(_SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING) \ && !defined(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS) -#define _CXX23_DEPRECATE_ALIGNED_UNION \ - [[deprecated("warning STL4035: " \ - "std::aligned_union is deprecated in C++23 by P1413R3. " \ - "Prefer alignas(T) std::byte t_buff[sizeof(T)]." \ - "You can define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING " \ +#define _CXX23_DEPRECATE_ALIGNED_UNION \ + [[deprecated("warning STL4035: " \ + "std::aligned_union is deprecated in C++23 by P1413R3. " \ + "Prefer alignas(Ts...) std::byte t_buff[std::max({sizeof(Ts)...})]." \ + "You can define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING " \ "or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] #else // ^^^ warning enabled / warning disabled vvv #define _CXX23_DEPRECATE_ALIGNED_UNION From 673180982702833b8944b77e504e43fdaf8d6446 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 22:40:31 +0200 Subject: [PATCH 04/15] node --- stl/inc/xnode_handle.h | 1 + 1 file changed, 1 insertion(+) diff --git a/stl/inc/xnode_handle.h b/stl/inc/xnode_handle.h index 077aa77d7e..49bc586f29 100644 --- a/stl/inc/xnode_handle.h +++ b/stl/inc/xnode_handle.h @@ -75,6 +75,7 @@ class _Node_handle : public _Base<_Node_handle<_Node, _Alloc, _Base, _Types...>, using _Nodeptr = typename _Alnode_traits::pointer; _Nodeptr _Ptr{}; +#pragma warning(suppress : 4996) // warning STL4035: std::aligned_union is deprecated in C++23 by P1413R3 aligned_union_t<0, _Alloc> _Alloc_storage; // Invariant: contains a live _Alloc iff _Ptr != nullptr void _Clear() noexcept { // destroy any contained node and return to the empty state From 08f9360edfd2a2280659e04ab0f696f20e1bfd1c Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 23:26:55 +0200 Subject: [PATCH 05/15] internal copy --- stl/inc/mutex | 6 ++---- stl/inc/type_traits | 8 ++++++++ stl/inc/xnode_handle.h | 11 +++++++++-- stl/src/cond.cpp | 6 ++---- stl/src/mutex.cpp | 3 +-- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/stl/inc/mutex b/stl/inc/mutex index 5a578bfb5f..79287559d0 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -76,8 +76,7 @@ private: friend condition_variable; friend condition_variable_any; -#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 - aligned_storage_t<_Mtx_internal_imp_size, _Mtx_internal_imp_alignment> _Mtx_storage; + typename _Aligned_storage<_Mtx_internal_imp_size, _Mtx_internal_imp_alignment>::type _Mtx_storage; _Mtx_t _Mymtx() noexcept { // get pointer to _Mtx_internal_imp_t inside _Mtx_storage return reinterpret_cast<_Mtx_t>(&_Mtx_storage); @@ -699,8 +698,7 @@ public: } private: -#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 - aligned_storage_t<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment> _Cnd_storage; + typename _Aligned_storage<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment>::type _Cnd_storage; _Cnd_t _Mycnd() noexcept { // get pointer to _Cnd_internal_imp_t inside _Cnd_storage return reinterpret_cast<_Cnd_t>(&_Cnd_storage); diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 55b4572200..bb408e36b7 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1028,6 +1028,14 @@ struct _CXX23_DEPRECATE_ALIGNED_STORAGE aligned_storage { // define type with si using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; }; +// TRANSITION, ABI: Internal non-deprecated version to avoid ABI changes due to deprecation +template +struct _Aligned_storage { // define type with size _Len and alignment _Align + using _Next = char; + static constexpr bool _Fits = _Align <= alignof(_Next); + using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; +}; + template using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; diff --git a/stl/inc/xnode_handle.h b/stl/inc/xnode_handle.h index 49bc586f29..2ff9186a09 100644 --- a/stl/inc/xnode_handle.h +++ b/stl/inc/xnode_handle.h @@ -62,6 +62,10 @@ struct _Node_handle_set_base { // set-specific node handle behavior } }; +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif // __clang__ template class _Base, class... _Types> class _Node_handle : public _Base<_Node_handle<_Node, _Alloc, _Base, _Types...>, _Types...> { // storage for a node from one of the node-based standard containers @@ -75,8 +79,8 @@ class _Node_handle : public _Base<_Node_handle<_Node, _Alloc, _Base, _Types...>, using _Nodeptr = typename _Alnode_traits::pointer; _Nodeptr _Ptr{}; -#pragma warning(suppress : 4996) // warning STL4035: std::aligned_union is deprecated in C++23 by P1413R3 - aligned_union_t<0, _Alloc> _Alloc_storage; // Invariant: contains a live _Alloc iff _Ptr != nullptr + typename _Aligned_storage::type + _Alloc_storage; // Invariant: contains a live _Alloc iff _Ptr != nullptr void _Clear() noexcept { // destroy any contained node and return to the empty state if (_Ptr != nullptr) { @@ -205,6 +209,9 @@ class _Node_handle : public _Base<_Node_handle<_Node, _Alloc, _Base, _Types...>, return _Node_handle{_Ptr, _Al}; } }; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ _STD_END #pragma pop_macro("new") diff --git a/stl/src/cond.cpp b/stl/src/cond.cpp index 10ee633a5b..46d82ae113 100644 --- a/stl/src/cond.cpp +++ b/stl/src/cond.cpp @@ -12,10 +12,8 @@ #include "primitives.hpp" struct _Cnd_internal_imp_t { // condition variable implementation for ConcRT -#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 - std::aligned_storage_t - cv; + typename std::_Aligned_storage::type cv; [[nodiscard]] Concurrency::details::stl_condition_variable_interface* _get_cv() noexcept { // get pointer to implementation diff --git a/stl/src/mutex.cpp b/stl/src/mutex.cpp index bee101f9da..0b34b6dee9 100644 --- a/stl/src/mutex.cpp +++ b/stl/src/mutex.cpp @@ -40,8 +40,7 @@ extern "C" _CRTIMP2 void __cdecl __set_stl_sync_api_mode(__stl_sync_api_modes_en struct _Mtx_internal_imp_t { // ConcRT mutex int type; -#pragma warning(suppress : 4996) // warning STL4034: std::aligned_storage is deprecated in C++23 by P1413R3 - std::aligned_storage_t cs; long thread_id; From 1e4a210a8dca57e1f5f03165e7f36018e347e83c Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 23:31:58 +0200 Subject: [PATCH 06/15] internal copy --- stl/inc/condition_variable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/condition_variable b/stl/inc/condition_variable index 6244b69434..89fa7fe690 100644 --- a/stl/inc/condition_variable +++ b/stl/inc/condition_variable @@ -248,7 +248,7 @@ public: private: shared_ptr _Myptr; - aligned_storage_t<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment> _Cnd_storage; + typename _Aligned_storage<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment>::type _Cnd_storage; _NODISCARD _Cnd_t _Mycnd() noexcept { // get pointer to _Cnd_internal_imp_t inside _Cnd_storage return reinterpret_cast<_Cnd_t>(&_Cnd_storage); From 996e2515c8d0c857fa1d4c5e796e6318da8c0a81 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 23:34:33 +0200 Subject: [PATCH 07/15] -clang suppression --- stl/inc/xnode_handle.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/stl/inc/xnode_handle.h b/stl/inc/xnode_handle.h index 2ff9186a09..ca31360683 100644 --- a/stl/inc/xnode_handle.h +++ b/stl/inc/xnode_handle.h @@ -62,10 +62,6 @@ struct _Node_handle_set_base { // set-specific node handle behavior } }; -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif // __clang__ template class _Base, class... _Types> class _Node_handle : public _Base<_Node_handle<_Node, _Alloc, _Base, _Types...>, _Types...> { // storage for a node from one of the node-based standard containers @@ -209,9 +205,6 @@ class _Node_handle : public _Base<_Node_handle<_Node, _Alloc, _Base, _Types...>, return _Node_handle{_Ptr, _Al}; } }; -#ifdef __clang__ -#pragma clang diagnostic pop -#endif // __clang__ _STD_END #pragma pop_macro("new") From 68df7e0383ce61647de5bed2746403a36bd336cc Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 19 Feb 2022 23:48:00 +0200 Subject: [PATCH 08/15] one more occurrence --- stl/inc/algorithm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 686a476b2a..1f94a896db 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -90,7 +90,7 @@ struct _Optimistic_temporary_buffer { // temporary storage with _alloca-like att _Ty* _Data; // points to heap memory iff _Capacity > _Optimistic_count ptrdiff_t _Capacity; - aligned_union_t<0, _Ty> _Stack_space[_Optimistic_count]; + typename _Aligned_storage::type _Stack_space[_Optimistic_count]; }; #ifdef __cpp_lib_concepts From 280aee97c4f585dd61a8ff92d361784276d17bf6 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sun, 20 Feb 2022 08:57:36 +0200 Subject: [PATCH 09/15] transitive --- stl/inc/type_traits | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index bb408e36b7..7f2e8668ef 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1059,7 +1059,7 @@ struct _CXX23_DEPRECATE_ALIGNED_UNION aligned_union { // define type with size a static constexpr size_t _Max_len = _Maximum<_Len, sizeof(_Types)...>::value; // NOT sizeof...(_Types) static constexpr size_t alignment_value = _Maximum::value; - using type = aligned_storage_t<_Max_len, alignment_value>; + using type = typename _Aligned_storage<_Max_len, alignment_value>::type; }; template From 0ed7e28504b219ec9cb65e179ffd2659a613100f Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sun, 20 Feb 2022 09:13:06 +0200 Subject: [PATCH 10/15] inner type --- stl/src/mutex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/src/mutex.cpp b/stl/src/mutex.cpp index 0b34b6dee9..e6dd94d1b1 100644 --- a/stl/src/mutex.cpp +++ b/stl/src/mutex.cpp @@ -41,7 +41,7 @@ extern "C" _CRTIMP2 void __cdecl __set_stl_sync_api_mode(__stl_sync_api_modes_en struct _Mtx_internal_imp_t { // ConcRT mutex int type; typename std::_Aligned_storage + Concurrency::details::stl_critical_section_max_alignment>::type cs; long thread_id; int count; From 20e74b9ad43e8b7e31445e9639a49a4c5a4a16a0 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sun, 20 Feb 2022 09:14:33 +0200 Subject: [PATCH 11/15] clang format --- stl/src/mutex.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stl/src/mutex.cpp b/stl/src/mutex.cpp index e6dd94d1b1..fcf0efcd19 100644 --- a/stl/src/mutex.cpp +++ b/stl/src/mutex.cpp @@ -41,8 +41,7 @@ extern "C" _CRTIMP2 void __cdecl __set_stl_sync_api_mode(__stl_sync_api_modes_en struct _Mtx_internal_imp_t { // ConcRT mutex int type; typename std::_Aligned_storage::type - cs; + Concurrency::details::stl_critical_section_max_alignment>::type cs; long thread_id; int count; Concurrency::details::stl_critical_section_interface* _get_cs() { // get pointer to implementation From e3b3bf728487faee2bf6555d65617135b03bc0a1 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sun, 20 Feb 2022 09:35:02 +0200 Subject: [PATCH 12/15] disable libc++ test deprecation --- tests/libcxx/usual_matrix.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libcxx/usual_matrix.lst b/tests/libcxx/usual_matrix.lst index e225d973b0..c070be73e4 100644 --- a/tests/libcxx/usual_matrix.lst +++ b/tests/libcxx/usual_matrix.lst @@ -3,7 +3,7 @@ RUNALL_INCLUDE ..\universal_prefix.lst RUNALL_CROSSLIST -PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643" +PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643 /D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS" RUNALL_CROSSLIST PM_CL="/analyze:autolog- /Zc:preprocessor" PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /D_HAS_CXX23" From 18f629c756b702df053767173a4b3f2f5e5ab253 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sun, 20 Feb 2022 10:00:43 +0200 Subject: [PATCH 13/15] TRANSITION --- tests/libcxx/expected_results.txt | 10 +++++----- tests/libcxx/skipped_tests.txt | 10 +++++----- tests/libcxx/usual_matrix.lst | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 8685203339..1b27cb022a 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -212,11 +212,11 @@ std/containers/unord/unord.set/max_size.pass.cpp FAIL std/utilities/tuple/tuple.tuple/tuple.apply/apply_large_arity.pass.cpp SKIPPED std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp SKIPPED -# Deprecation is a mess. We disable all deprecations in msvc_stdlib_force_include.hpp to allow libc++ tests for -# deprecated features to pass, which breaks when libc++ deprecates the feature and adds two tests that (1) pass -# with deprecation suppressed, and (2) fail without deprecation suppression. We should instead translate libc++ -# un-deprecation macros to STL un-deprecation macros in the force-include header, and just skip tests when we -# deprecate before they do. +# Deprecation is a mess. We disable all deprecations in llvm-project/libcxx/test/support/msvc_stdlib_force_include.h +# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates +# the feature and adds two tests that (1) pass with deprecation suppressed, and (2) fail without deprecation suppression. +# We should instead translate libc++ un-deprecation macros to STL un-deprecation macros in the force-include header, +# and just skip tests when we deprecate before they do. std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.deprecated.fail.cpp FAIL diff --git a/tests/libcxx/skipped_tests.txt b/tests/libcxx/skipped_tests.txt index 06fcd2cfd1..f096757dbf 100644 --- a/tests/libcxx/skipped_tests.txt +++ b/tests/libcxx/skipped_tests.txt @@ -212,11 +212,11 @@ containers\unord\unord.set\max_size.pass.cpp utilities\tuple\tuple.tuple\tuple.apply\apply_large_arity.pass.cpp utilities\tuple\tuple.tuple\tuple.cnstr\recursion_depth.pass.cpp -# Deprecation is a mess. We disable all deprecations in msvc_stdlib_force_include.hpp to allow libc++ tests for -# deprecated features to pass, which breaks when libc++ deprecates the feature and adds two tests that (1) pass -# with deprecation suppressed, and (2) fail without deprecation suppression. We should instead translate libc++ -# un-deprecation macros to STL un-deprecation macros in the force-include header, and just skip tests when we -# deprecate before they do. +# Deprecation is a mess. We disable all deprecations in llvm-project/libcxx/test/support/msvc_stdlib_force_include.h +# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates +# the feature and adds two tests that (1) pass with deprecation suppressed, and (2) fail without deprecation suppression. +# We should instead translate libc++ un-deprecation macros to STL un-deprecation macros in the force-include header, +# and just skip tests when we deprecate before they do. utilities\meta\meta.unary\meta.unary.prop\is_literal_type.deprecated.fail.cpp diff --git a/tests/libcxx/usual_matrix.lst b/tests/libcxx/usual_matrix.lst index c070be73e4..473d7c1647 100644 --- a/tests/libcxx/usual_matrix.lst +++ b/tests/libcxx/usual_matrix.lst @@ -3,6 +3,7 @@ RUNALL_INCLUDE ..\universal_prefix.lst RUNALL_CROSSLIST +# TRANSITION, LLVM-53957: _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS belongs to llvm-project/libcxx/test/support/msvc_stdlib_force_include.h PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643 /D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS" RUNALL_CROSSLIST PM_CL="/analyze:autolog- /Zc:preprocessor" From debee59913c84e478bbd4f66869ffcea3179893b Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sun, 20 Feb 2022 10:02:31 +0200 Subject: [PATCH 14/15] -white --- tests/libcxx/expected_results.txt | 2 +- tests/libcxx/skipped_tests.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 1b27cb022a..eedc95e376 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -213,7 +213,7 @@ std/utilities/tuple/tuple.tuple/tuple.apply/apply_large_arity.pass.cpp SKIPPED std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp SKIPPED # Deprecation is a mess. We disable all deprecations in llvm-project/libcxx/test/support/msvc_stdlib_force_include.h -# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates +# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates # the feature and adds two tests that (1) pass with deprecation suppressed, and (2) fail without deprecation suppression. # We should instead translate libc++ un-deprecation macros to STL un-deprecation macros in the force-include header, # and just skip tests when we deprecate before they do. diff --git a/tests/libcxx/skipped_tests.txt b/tests/libcxx/skipped_tests.txt index f096757dbf..d7fd2ac2cf 100644 --- a/tests/libcxx/skipped_tests.txt +++ b/tests/libcxx/skipped_tests.txt @@ -213,7 +213,7 @@ utilities\tuple\tuple.tuple\tuple.apply\apply_large_arity.pass.cpp utilities\tuple\tuple.tuple\tuple.cnstr\recursion_depth.pass.cpp # Deprecation is a mess. We disable all deprecations in llvm-project/libcxx/test/support/msvc_stdlib_force_include.h -# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates +# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates # the feature and adds two tests that (1) pass with deprecation suppressed, and (2) fail without deprecation suppression. # We should instead translate libc++ un-deprecation macros to STL un-deprecation macros in the force-include header, # and just skip tests when we deprecate before they do. From 78950dc897e73541babd7ab44184c1a1e7751ad2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 11 May 2022 21:48:20 -0700 Subject: [PATCH 15/15] Code review feedback. --- stl/inc/algorithm | 2 +- stl/inc/condition_variable | 2 +- stl/inc/mutex | 4 ++-- stl/inc/type_traits | 25 ++++++++++++++----------- stl/inc/xnode_handle.h | 2 +- stl/inc/yvals_core.h | 20 ++++++++++---------- tests/libcxx/expected_results.txt | 2 +- tests/libcxx/skipped_tests.txt | 2 +- tests/libcxx/usual_matrix.lst | 2 +- 9 files changed, 32 insertions(+), 29 deletions(-) diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 2c771c4d32..ee01e63b13 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -90,7 +90,7 @@ struct _Optimistic_temporary_buffer { // temporary storage with _alloca-like att _Ty* _Data; // points to heap memory iff _Capacity > _Optimistic_count ptrdiff_t _Capacity; - typename _Aligned_storage::type _Stack_space[_Optimistic_count]; + _Aligned_storage_t _Stack_space[_Optimistic_count]; }; #ifdef __cpp_lib_concepts diff --git a/stl/inc/condition_variable b/stl/inc/condition_variable index 938e7fc7e1..10c0088aa8 100644 --- a/stl/inc/condition_variable +++ b/stl/inc/condition_variable @@ -248,7 +248,7 @@ public: private: shared_ptr _Myptr; - typename _Aligned_storage<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment>::type _Cnd_storage; + _Aligned_storage_t<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment> _Cnd_storage; _NODISCARD _Cnd_t _Mycnd() noexcept { // get pointer to _Cnd_internal_imp_t inside _Cnd_storage return reinterpret_cast<_Cnd_t>(&_Cnd_storage); diff --git a/stl/inc/mutex b/stl/inc/mutex index 2fc89442f7..be82a1fbaa 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -76,7 +76,7 @@ private: friend condition_variable; friend condition_variable_any; - typename _Aligned_storage<_Mtx_internal_imp_size, _Mtx_internal_imp_alignment>::type _Mtx_storage; + _Aligned_storage_t<_Mtx_internal_imp_size, _Mtx_internal_imp_alignment> _Mtx_storage; _Mtx_t _Mymtx() noexcept { // get pointer to _Mtx_internal_imp_t inside _Mtx_storage return reinterpret_cast<_Mtx_t>(&_Mtx_storage); @@ -698,7 +698,7 @@ public: } private: - typename _Aligned_storage<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment>::type _Cnd_storage; + _Aligned_storage_t<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment> _Cnd_storage; _Cnd_t _Mycnd() noexcept { // get pointer to _Cnd_internal_imp_t inside _Cnd_storage return reinterpret_cast<_Cnd_t>(&_Cnd_storage); diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 8424658c71..8ac768676b 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1055,23 +1055,24 @@ struct _Aligned<_Len, _Align, char, false> { using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; }; +// TRANSITION, ABI: Internal non-deprecated version to avoid ABI changes due to deprecation template -struct _CXX23_DEPRECATE_ALIGNED_STORAGE aligned_storage { // define type with size _Len and alignment _Align +struct _Aligned_storage { // define type with size _Len and alignment _Align using _Next = char; static constexpr bool _Fits = _Align <= alignof(_Next); using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; }; -// TRANSITION, ABI: Internal non-deprecated version to avoid ABI changes due to deprecation template -struct _Aligned_storage { // define type with size _Len and alignment _Align - using _Next = char; - static constexpr bool _Fits = _Align <= alignof(_Next); - using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; +using _Aligned_storage_t = typename _Aligned_storage<_Len, _Align>::type; + +template +struct _CXX23_DEPRECATE_ALIGNED_STORAGE aligned_storage { // define type with size _Len and alignment _Align + using type = _Aligned_storage_t<_Len, _Align>; }; template -using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; +using aligned_storage_t _CXX23_DEPRECATE_ALIGNED_STORAGE = _Aligned_storage_t<_Len, _Align>; template struct _Maximum; @@ -1088,16 +1089,18 @@ struct _Maximum<_First, _Second, _Rest...> : _Maximum<(_First < _Second ? _Secon }; template -struct _CXX23_DEPRECATE_ALIGNED_UNION aligned_union { // define type with size at least _Len, for storing anything in - // _Types +struct _CXX23_DEPRECATE_ALIGNED_UNION aligned_union { + // define type with size at least _Len, for storing anything in _Types static constexpr size_t _Max_len = _Maximum<_Len, sizeof(_Types)...>::value; // NOT sizeof...(_Types) static constexpr size_t alignment_value = _Maximum::value; - using type = typename _Aligned_storage<_Max_len, alignment_value>::type; + using type = _Aligned_storage_t<_Max_len, alignment_value>; }; +_STL_DISABLE_DEPRECATED_WARNING template -using aligned_union_t = typename aligned_union<_Len, _Types...>::type; +using aligned_union_t _CXX23_DEPRECATE_ALIGNED_UNION = typename aligned_union<_Len, _Types...>::type; +_STL_RESTORE_DEPRECATED_WARNING template > struct _Underlying_type { diff --git a/stl/inc/xnode_handle.h b/stl/inc/xnode_handle.h index ca31360683..e6e7627bbe 100644 --- a/stl/inc/xnode_handle.h +++ b/stl/inc/xnode_handle.h @@ -75,7 +75,7 @@ class _Node_handle : public _Base<_Node_handle<_Node, _Alloc, _Base, _Types...>, using _Nodeptr = typename _Alnode_traits::pointer; _Nodeptr _Ptr{}; - typename _Aligned_storage::type + _Aligned_storage_t _Alloc_storage; // Invariant: contains a live _Alloc iff _Ptr != nullptr void _Clear() noexcept { // destroy any contained node and return to the empty state diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 6be79653fc..f74b8f43e4 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1143,11 +1143,11 @@ #if _HAS_CXX23 && !defined(_SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING) \ && !defined(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS) -#define _CXX23_DEPRECATE_ALIGNED_STORAGE \ - [[deprecated("warning STL4034: " \ - "std::aligned_storage is deprecated in C++23 by P1413R3. " \ - "Prefer alignas(T) std::byte t_buff[sizeof(T)]." \ - "You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING " \ +#define _CXX23_DEPRECATE_ALIGNED_STORAGE \ + [[deprecated("warning STL4034: " \ + "std::aligned_storage and std::aligned_storage_t are deprecated in C++23. " \ + "Prefer alignas(T) std::byte t_buff[sizeof(T)]. " \ + "You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING " \ "or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] #else // ^^^ warning enabled / warning disabled vvv #define _CXX23_DEPRECATE_ALIGNED_STORAGE @@ -1155,11 +1155,11 @@ #if _HAS_CXX23 && !defined(_SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING) \ && !defined(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS) -#define _CXX23_DEPRECATE_ALIGNED_UNION \ - [[deprecated("warning STL4035: " \ - "std::aligned_union is deprecated in C++23 by P1413R3. " \ - "Prefer alignas(Ts...) std::byte t_buff[std::max({sizeof(Ts)...})]." \ - "You can define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING " \ +#define _CXX23_DEPRECATE_ALIGNED_UNION \ + [[deprecated("warning STL4035: " \ + "std::aligned_union and std::aligned_union_t are deprecated in C++23. " \ + "Prefer alignas(Ts...) std::byte t_buff[std::max({sizeof(Ts)...})]. " \ + "You can define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING " \ "or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] #else // ^^^ warning enabled / warning disabled vvv #define _CXX23_DEPRECATE_ALIGNED_UNION diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 8b34bb839d..60a5168d86 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -222,7 +222,7 @@ std/utilities/tuple/tuple.tuple/tuple.apply/apply_large_arity.pass.cpp SKIPPED std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp SKIPPED # Deprecation is a mess. We disable all deprecations in llvm-project/libcxx/test/support/msvc_stdlib_force_include.h -# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates +# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates # the feature and adds two tests that (1) pass with deprecation suppressed, and (2) fail without deprecation suppression. # We should instead translate libc++ un-deprecation macros to STL un-deprecation macros in the force-include header, # and just skip tests when we deprecate before they do. diff --git a/tests/libcxx/skipped_tests.txt b/tests/libcxx/skipped_tests.txt index d293609d80..5b05324abc 100644 --- a/tests/libcxx/skipped_tests.txt +++ b/tests/libcxx/skipped_tests.txt @@ -222,7 +222,7 @@ utilities\tuple\tuple.tuple\tuple.apply\apply_large_arity.pass.cpp utilities\tuple\tuple.tuple\tuple.cnstr\recursion_depth.pass.cpp # Deprecation is a mess. We disable all deprecations in llvm-project/libcxx/test/support/msvc_stdlib_force_include.h -# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates +# (external to this repo) to allow libc++ tests for deprecated features to pass, which breaks when libc++ deprecates # the feature and adds two tests that (1) pass with deprecation suppressed, and (2) fail without deprecation suppression. # We should instead translate libc++ un-deprecation macros to STL un-deprecation macros in the force-include header, # and just skip tests when we deprecate before they do. diff --git a/tests/libcxx/usual_matrix.lst b/tests/libcxx/usual_matrix.lst index 3cc7b62df5..193320fdd4 100644 --- a/tests/libcxx/usual_matrix.lst +++ b/tests/libcxx/usual_matrix.lst @@ -4,7 +4,7 @@ RUNALL_INCLUDE ..\universal_prefix.lst RUNALL_CROSSLIST # TRANSITION, LLVM-53957: _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS belongs to llvm-project/libcxx/test/support/msvc_stdlib_force_include.h -PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER /D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS" +PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER /D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS" RUNALL_CROSSLIST PM_CL="/analyze:autolog- /Zc:preprocessor" PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing"