diff --git a/stl/inc/ranges b/stl/inc/ranges index 155a483726..0c95d375c5 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -3050,7 +3050,8 @@ namespace ranges { private: struct _Cache_wrapper { template - constexpr _Cache_wrapper(_Not_quite_object::_Construct_tag, const _Iter& _It) noexcept(noexcept(*_It)) + constexpr _Cache_wrapper(_Not_quite_object::_Construct_tag, const _Iter& _It) noexcept( + noexcept(static_cast(*_It))) : _Val(*_It) {} remove_cv_t> _Val; @@ -4774,7 +4775,8 @@ namespace ranges { private: struct _Cache_wrapper { template - constexpr _Cache_wrapper(_Not_quite_object::_Construct_tag, const _Iter& _It) noexcept(noexcept(*_It)) + constexpr _Cache_wrapper(_Not_quite_object::_Construct_tag, const _Iter& _It) noexcept( + noexcept(static_cast(*_It))) : _Val(*_It) {} remove_cv_t> _Val; @@ -4891,7 +4893,7 @@ namespace ranges { } constexpr void _Satisfy() { - while (true) { + for (;;) { if (_Inner_it._Contains == _Variantish_state::_Holds_first) { if (_Inner_it._First != _RANGES end(_Parent->_Pattern)) { break; @@ -4991,7 +4993,7 @@ namespace ranges { _Inner_it._Emplace_second(_RANGES end(_Inner)); } - while (true) { + for (;;) { if (_Inner_it._Contains == _Variantish_state::_Holds_first) { auto& _It = _Inner_it._First; if (_It == _RANGES begin(_Parent->_Pattern)) { @@ -5034,7 +5036,8 @@ namespace ranges { return _Tmp; } - friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) requires _Deref_is_glvalue + _NODISCARD_FRIEND constexpr bool operator==( + const _Iterator& _Left, const _Iterator& _Right) requires _Deref_is_glvalue && equality_comparable<_OuterIter> && equality_comparable<_InnerIter> { if (_Left._Outer_it != _Right._Outer_it) { return false; @@ -5056,7 +5059,7 @@ namespace ranges { _STL_UNREACHABLE; } - friend constexpr decltype(auto) iter_move(const _Iterator& _It) { + _NODISCARD_FRIEND constexpr decltype(auto) iter_move(const _Iterator& _It) { using _Rvalue_ref = common_reference_t, iter_rvalue_reference_t<_PatternIter>>; return _It._Visit_inner_it<_Rvalue_ref>(_RANGES iter_move); @@ -5126,7 +5129,7 @@ namespace ranges { template requires sentinel_for, iterator_t<_Maybe_const<_OtherConst, _Vw>>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, + _NODISCARD_FRIEND constexpr bool operator==(const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) noexcept(noexcept(_Right._Equal(_Left))) /* strengthened */ { return _Right._Equal(_Left); } diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 08fd100799..04f9eb7aee 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -302,6 +302,7 @@ // P2166R1 Prohibiting basic_string And basic_string_view Construction From nullptr // P2186R2 Removing Garbage Collection Support // P2273R3 constexpr unique_ptr +// P2441R2 views::join_with // P2443R1 views::chunk_by // Parallel Algorithms Notes @@ -1379,6 +1380,7 @@ #ifdef __cpp_lib_concepts #define __cpp_lib_out_ptr 202106L #define __cpp_lib_ranges_chunk_by 202202L +#define __cpp_lib_ranges_join_with 202202L #define __cpp_lib_ranges_starts_ends_with 202106L #endif // __cpp_lib_concepts diff --git a/tests/std/tests/P2441R2_views_join_with/test.cpp b/tests/std/tests/P2441R2_views_join_with/test.cpp index 2cd2b796b4..b935e3b14a 100644 --- a/tests/std/tests/P2441R2_views_join_with/test.cpp +++ b/tests/std/tests/P2441R2_views_join_with/test.cpp @@ -484,22 +484,22 @@ void test_valueless_iterator() { try { (void) *it2; assert(false); - } catch (std::bad_variant_access&) { + } catch (bad_variant_access&) { } try { (void) ++it2; assert(false); - } catch (std::bad_variant_access&) { + } catch (bad_variant_access&) { } try { (void) --it2; assert(false); - } catch (std::bad_variant_access&) { + } catch (bad_variant_access&) { } try { (void) ranges::iter_move(it2); assert(false); - } catch (std::bad_variant_access&) { + } catch (bad_variant_access&) { } } diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index 96bf42755d..da7265cf72 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -1366,6 +1366,20 @@ STATIC_ASSERT(__cpp_lib_ranges_chunk_by == 202202L); #endif #endif +#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support +#ifndef __cpp_lib_ranges_join_with +#error __cpp_lib_ranges_join_with is not defined +#elif __cpp_lib_ranges_join_with != 202202L +#error __cpp_lib_ranges_join_with is not 202202L +#else +STATIC_ASSERT(__cpp_lib_ranges_join_with == 202202L); +#endif +#else +#ifdef __cpp_lib_ranges_join_with +#error __cpp_lib_ranges_join_with is defined +#endif +#endif + #if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support #ifndef __cpp_lib_ranges_starts_ends_with #error __cpp_lib_ranges_starts_ends_with is not defined