Skip to content

Commit

Permalink
Merge pull request #3665 from microsoft/main
Browse files Browse the repository at this point in the history
Merge `main` to `feature/mdspan2`
  • Loading branch information
StephanTLavavej authored Apr 20, 2023
2 parents c9b661c + 0a2d59e commit dc177d7
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion boost-math
Submodule boost-math updated 707 files
2 changes: 1 addition & 1 deletion docs/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "git",
"git": {
"repositoryUrl": "https://github.com/boostorg/math",
"commitHash": "f395de082eca6ee993a15f2bdb90277eda518295"
"commitHash": "c56f334348d5476783fba996d604fc5c6ae980c3"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,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
Expand Down
1 change: 0 additions & 1 deletion stl/inc/header-units.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
"xnode_handle.h",
"xpolymorphic_allocator.h",
"xsmf_control.h",
"xstddef",
"xstring",
"xthreads.h",
"xtimec.h",
Expand Down
15 changes: 11 additions & 4 deletions stl/inc/limits
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions stl/inc/map
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ public:
_MISMATCHED_ALLOCATOR_MESSAGE("map<Key, Value, Compare, Allocator>", "pair<const Key, Value>"));
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;
Expand Down Expand Up @@ -463,8 +461,6 @@ public:
_MISMATCHED_ALLOCATOR_MESSAGE("multimap<Key, Value, Compare, Allocator>", "pair<const Key, Value>"));
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;
Expand Down
7 changes: 6 additions & 1 deletion stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#define _TYPE_TRAITS_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstddef>
#include <cstdint>
#include <xstddef>
#include <xtr1common>

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
Expand All @@ -19,6 +20,10 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new

_STD_BEGIN
template <class>
// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert)
_INLINE_VAR constexpr bool _Always_false = false;

_EXPORT_STD template <class _Ty, _Ty... _Vals>
struct integer_sequence { // sequence of integer parameters
static_assert(is_integral_v<_Ty>, "integer_sequence<T, I...> requires T to be an integral type.");
Expand Down
4 changes: 0 additions & 4 deletions stl/inc/unordered_map
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public:
_MISMATCHED_ALLOCATOR_MESSAGE("unordered_map<Key, Value, Hasher, Eq, Allocator>", "pair<const Key, Value>"));
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>;
Expand Down Expand Up @@ -563,8 +561,6 @@ public:
"unordered_multimap<Key, Value, Hasher, Eq, Allocator>", "pair<const Key, Value>"));
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>;
Expand Down
32 changes: 0 additions & 32 deletions stl/inc/xstddef

This file was deleted.

14 changes: 13 additions & 1 deletion stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,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
Expand Down Expand Up @@ -1436,7 +1437,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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3048,6 +3048,17 @@ void assert_container() {
check_all_specific_requirements<Tag>();
}

// MapLike<K, V&> is squirrelly, but appears to be permitted.
template <template <class...> class MapLike>
void check_reference_as_mapped_type() {
double dbl = 3.14;

MapLike<int, double&> ml;
ml.emplace(10, dbl);

STATIC_ASSERT(std::is_same_v<decltype(ml.find(10)->second), double&>);
}

void assert_all() {
assert_container<tag_deque>();
assert_container<tag_forward_list>();
Expand All @@ -3063,4 +3074,9 @@ void assert_all() {
assert_container<tag_unordered_multimap>();
assert_container<tag_unordered_multiset>();
assert_container<tag_unordered_set>();

check_reference_as_mapped_type<std::map>();
check_reference_as_mapped_type<std::multimap>();
check_reference_as_mapped_type<std::unordered_map>();
check_reference_as_mapped_type<std::unordered_multimap>();
}
1 change: 1 addition & 0 deletions tests/std/tests/Dev11_1074023_constexpr/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm>
#include <array>
Expand Down
1 change: 0 additions & 1 deletion tests/std/tests/GH_001411_core_headers/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

// <__msvc_iter_core.hpp> is included by <tuple>
// <xkeycheck.h> should not be included outside of <yvals_core.h>
// <xstddef> is included by <type_traits>
// <xtr1common> is included by <cstddef>
// <yvals_core.h> is included by every public core header

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ void typeindex_test() {

template <typename FunctorArg, typename Arg>
void functors_test_impl(Arg val) {
// Following from <xstddef>:
// Following from <type_traits> and <xutility>:
(void) plus<FunctorArg>()(val, val);
(void) minus<FunctorArg>()(val, val);
(void) multiplies<FunctorArg>()(val, val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions tests/tr1/tests/limits/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// test <limits>
#define TEST_NAME "<limits>"

#define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING

#include "tdefs.h"
#include <float.h>
#include <limits.h>
Expand Down

0 comments on commit dc177d7

Please sign in to comment.