From 522149cff1132b1bf70bee38ca5edbe4d7ce11a5 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 21 Apr 2023 04:50:17 +0800 Subject: [PATCH 1/4] Implement P2614R2 Deprecating `float_denorm_style`, `numeric_limits::has_denorm`, `numeric_limits::has_denorm_loss` (#3482) --- stl/inc/limits | 15 +++++++++++---- stl/inc/yvals_core.h | 14 +++++++++++++- tests/std/tests/Dev11_1074023_constexpr/test.cpp | 1 + tests/tr1/tests/limits/test.cpp | 2 ++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/stl/inc/limits b/stl/inc/limits index cd4bbf056f9..b957442428a 100644 --- a/stl/inc/limits +++ b/stl/inc/limits @@ -36,7 +36,8 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -_EXPORT_STD enum float_denorm_style { // constants for different IEEE float denormalization styles +// constants for different IEEE float denormalization styles +_EXPORT_STD enum _CXX23_DEPRECATE_DENORM float_denorm_style { denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 @@ -51,8 +52,11 @@ _EXPORT_STD enum float_round_style { // constants for different IEEE rounding st }; struct _Num_base { // base for all types, with common defaults - static constexpr float_denorm_style has_denorm = denorm_absent; - static constexpr bool has_denorm_loss = false; + _STL_DISABLE_DEPRECATED_WARNING + _CXX23_DEPRECATE_DENORM static constexpr float_denorm_style has_denorm = denorm_absent; + _CXX23_DEPRECATE_DENORM static constexpr bool has_denorm_loss = false; + _STL_RESTORE_DEPRECATED_WARNING + static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; @@ -134,7 +138,10 @@ struct _Num_int_base : _Num_base { // base for integer types }; struct _Num_float_base : _Num_base { // base for floating-point types - static constexpr float_denorm_style has_denorm = denorm_present; + _STL_DISABLE_DEPRECATED_WARNING + _CXX23_DEPRECATE_DENORM static constexpr float_denorm_style has_denorm = denorm_present; + _STL_RESTORE_DEPRECATED_WARNING + static constexpr bool has_infinity = true; static constexpr bool has_quiet_NaN = true; static constexpr bool has_signaling_NaN = true; diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index b1fc9a6c944..02308dbbfab 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -365,6 +365,7 @@ // _HAS_CXX23 and _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS control: // P1413R3 Deprecate aligned_storage And aligned_union +// P2614R2 Deprecating float_denorm_style, numeric_limits::has_denorm, numeric_limits::has_denorm_loss // Other C++23 deprecation warnings // Parallel Algorithms Notes @@ -1431,7 +1432,18 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #define _CXX23_DEPRECATE_UNIX_STREAMS #endif // ^^^ warning disabled ^^^ -// next warning number: STL4042 +#if _HAS_CXX23 && !defined(_SILENCE_CXX23_DENORM_DEPRECATION_WARNING) \ + && !defined(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS) +#define _CXX23_DEPRECATE_DENORM \ + [[deprecated("warning STL4042: " \ + "std::float_denorm_style, std::numeric_limits::has_denorm, and std::numeric_limits::has_denorm_loss " \ + "are deprecated in C++23. You can define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING or " \ + "_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to suppress this warning.")]] +#else // ^^^ warning enabled / warning disabled vvv +#define _CXX23_DEPRECATE_DENORM +#endif // ^^^ warning disabled ^^^ + +// next warning number: STL4043 // next error number: STL1006 diff --git a/tests/std/tests/Dev11_1074023_constexpr/test.cpp b/tests/std/tests/Dev11_1074023_constexpr/test.cpp index cdd745fd63c..58c32ebc3e2 100644 --- a/tests/std/tests/Dev11_1074023_constexpr/test.cpp +++ b/tests/std/tests/Dev11_1074023_constexpr/test.cpp @@ -6,6 +6,7 @@ #define _SILENCE_CXX17_IS_LITERAL_TYPE_DEPRECATION_WARNING #define _SILENCE_CXX17_NEGATORS_DEPRECATION_WARNING #define _SILENCE_CXX20_IS_POD_DEPRECATION_WARNING +#define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING #include #include diff --git a/tests/tr1/tests/limits/test.cpp b/tests/tr1/tests/limits/test.cpp index 96bdfa08d86..08e98d73468 100644 --- a/tests/tr1/tests/limits/test.cpp +++ b/tests/tr1/tests/limits/test.cpp @@ -4,6 +4,8 @@ // test #define TEST_NAME "" +#define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING + #include "tdefs.h" #include #include From 9bb3566f7f2d0c25cdb27efa235a1f54be44e55a Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 21 Apr 2023 04:54:20 +0800 Subject: [PATCH 2/4] Fuse `` into `` (#3654) --- stl/CMakeLists.txt | 1 - stl/inc/header-units.json | 1 - stl/inc/type_traits | 7 +++- stl/inc/xstddef | 32 ------------------- .../std/tests/GH_001411_core_headers/test.cpp | 1 - .../test.compile.pass.cpp | 2 +- .../test.compile.pass.cpp | 2 +- 7 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 stl/inc/xstddef diff --git a/stl/CMakeLists.txt b/stl/CMakeLists.txt index 64ee93e9055..6c2e456eedf 100644 --- a/stl/CMakeLists.txt +++ b/stl/CMakeLists.txt @@ -247,7 +247,6 @@ set(HEADERS ${CMAKE_CURRENT_LIST_DIR}/inc/xnode_handle.h ${CMAKE_CURRENT_LIST_DIR}/inc/xpolymorphic_allocator.h ${CMAKE_CURRENT_LIST_DIR}/inc/xsmf_control.h - ${CMAKE_CURRENT_LIST_DIR}/inc/xstddef ${CMAKE_CURRENT_LIST_DIR}/inc/xstring ${CMAKE_CURRENT_LIST_DIR}/inc/xthreads.h ${CMAKE_CURRENT_LIST_DIR}/inc/xtimec.h diff --git a/stl/inc/header-units.json b/stl/inc/header-units.json index 0d21964d524..345af8adf51 100644 --- a/stl/inc/header-units.json +++ b/stl/inc/header-units.json @@ -153,7 +153,6 @@ "xnode_handle.h", "xpolymorphic_allocator.h", "xsmf_control.h", - "xstddef", "xstring", "xthreads.h", "xtimec.h", diff --git a/stl/inc/type_traits b/stl/inc/type_traits index c51ef667b26..3d26f56f401 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -8,8 +8,9 @@ #define _TYPE_TRAITS_ #include #if _STL_COMPILER_PREPROCESSOR +#include #include -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -19,6 +20,10 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN +template +// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert) +_INLINE_VAR constexpr bool _Always_false = false; + _EXPORT_STD template struct integer_sequence { // sequence of integer parameters static_assert(is_integral_v<_Ty>, "integer_sequence requires T to be an integral type."); diff --git a/stl/inc/xstddef b/stl/inc/xstddef deleted file mode 100644 index ffa37dfcc08..00000000000 --- a/stl/inc/xstddef +++ /dev/null @@ -1,32 +0,0 @@ -// xstddef internal header (core) - -// Copyright (c) Microsoft Corporation. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#pragma once -#ifndef _XSTDDEF_ -#define _XSTDDEF_ -#include -#if _STL_COMPILER_PREPROCESSOR -#include -#include - -#pragma pack(push, _CRT_PACKING) -#pragma warning(push, _STL_WARNING_LEVEL) -#pragma warning(disable : _STL_DISABLED_WARNINGS) -_STL_DISABLE_CLANG_WARNINGS -#pragma push_macro("new") -#undef new - -_STD_BEGIN -template -// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert) -_INLINE_VAR constexpr bool _Always_false = false; -_STD_END - -#pragma pop_macro("new") -_STL_RESTORE_CLANG_WARNINGS -#pragma warning(pop) -#pragma pack(pop) -#endif // _STL_COMPILER_PREPROCESSOR -#endif // _XSTDDEF_ diff --git a/tests/std/tests/GH_001411_core_headers/test.cpp b/tests/std/tests/GH_001411_core_headers/test.cpp index 0d5907989c5..ced205530ce 100644 --- a/tests/std/tests/GH_001411_core_headers/test.cpp +++ b/tests/std/tests/GH_001411_core_headers/test.cpp @@ -21,7 +21,6 @@ // <__msvc_iter_core.hpp> is included by // should not be included outside of -// is included by // is included by // is included by every public core header diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index e48746e4e1d..39008f01464 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -1624,7 +1624,7 @@ void typeindex_test() { template void functors_test_impl(Arg val) { - // Following from : + // Following from and : (void) plus()(val, val); (void) minus()(val, val); (void) multiplies()(val, val); 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 722f6ff98a4..7d2d946555f 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 @@ -124,7 +124,7 @@ void type_traits_test_impl() { TRAIT_V(is_null_pointer, T); TRAIT_V(is_union, T); TRAIT_V(is_class, T); - TRAIT_V(is_function, T); // from xstddef + TRAIT_V(is_function, T); TRAIT_V(is_fundamental, T); TRAIT_V(is_arithmetic, T); // from xtr1common TRAIT_V(is_object, T); From 06c0408874578d7c9ece3eed5dcf04aded741b15 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 21 Apr 2023 03:56:40 +0700 Subject: [PATCH 3/4] Update boost-math to 1.82 (#3657) --- boost-math | 2 +- docs/cgmanifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boost-math b/boost-math index f395de082ec..c56f334348d 160000 --- a/boost-math +++ b/boost-math @@ -1 +1 @@ -Subproject commit f395de082eca6ee993a15f2bdb90277eda518295 +Subproject commit c56f334348d5476783fba996d604fc5c6ae980c3 diff --git a/docs/cgmanifest.json b/docs/cgmanifest.json index a7d932b2729..d6f5dd7612f 100644 --- a/docs/cgmanifest.json +++ b/docs/cgmanifest.json @@ -6,7 +6,7 @@ "type": "git", "git": { "repositoryUrl": "https://github.com/boostorg/math", - "commitHash": "f395de082eca6ee993a15f2bdb90277eda518295" + "commitHash": "c56f334348d5476783fba996d604fc5c6ae980c3" } } }, From 0a2d59ed7bfe099199237090998b758c9b0b7403 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Apr 2023 13:58:50 -0700 Subject: [PATCH 4/4] ``, ``: Allow `MapLike` again (#3660) --- stl/inc/map | 4 ---- stl/inc/unordered_map | 4 ---- .../test.compile.pass.cpp | 16 ++++++++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/stl/inc/map b/stl/inc/map index eaca60e2932..b7e1cb601c8 100644 --- a/stl/inc/map +++ b/stl/inc/map @@ -77,8 +77,6 @@ public: _MISMATCHED_ALLOCATOR_MESSAGE("map", "pair")); static_assert(is_object_v<_Kty>, "The C++ Standard forbids containers of non-object types " "because of [container.requirements]."); - static_assert(is_object_v<_Ty>, "The C++ Standard forbids containers of non-object types " - "because of [container.requirements]."); using _Mybase = _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, false>>; using _Nodeptr = typename _Mybase::_Nodeptr; @@ -463,8 +461,6 @@ public: _MISMATCHED_ALLOCATOR_MESSAGE("multimap", "pair")); static_assert(is_object_v<_Kty>, "The C++ Standard forbids containers of non-object types " "because of [container.requirements]."); - static_assert(is_object_v<_Ty>, "The C++ Standard forbids containers of non-object types " - "because of [container.requirements]."); using _Mybase = _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, true>>; using key_type = _Kty; diff --git a/stl/inc/unordered_map b/stl/inc/unordered_map index 40561f6eb79..dee66749bfc 100644 --- a/stl/inc/unordered_map +++ b/stl/inc/unordered_map @@ -71,8 +71,6 @@ public: _MISMATCHED_ALLOCATOR_MESSAGE("unordered_map", "pair")); static_assert(is_object_v<_Kty>, "The C++ Standard forbids containers of non-object types " "because of [container.requirements]."); - static_assert(is_object_v<_Ty>, "The C++ Standard forbids containers of non-object types " - "because of [container.requirements]."); private: using _Mytraits = _Uhash_compare<_Kty, _Hasher, _Keyeq>; @@ -563,8 +561,6 @@ public: "unordered_multimap", "pair")); static_assert(is_object_v<_Kty>, "The C++ Standard forbids containers of non-object types " "because of [container.requirements]."); - static_assert(is_object_v<_Ty>, "The C++ Standard forbids containers of non-object types " - "because of [container.requirements]."); private: using _Mytraits = _Uhash_compare<_Kty, _Hasher, _Keyeq>; diff --git a/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp b/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp index 466a658ba69..296ca936c4a 100644 --- a/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp +++ b/tests/std/tests/Dev11_0437519_container_requirements/test.compile.pass.cpp @@ -3048,6 +3048,17 @@ void assert_container() { check_all_specific_requirements(); } +// MapLike is squirrelly, but appears to be permitted. +template