diff --git a/stl/inc/xutility b/stl/inc/xutility index 2f276896073..70b8e8e60e1 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -3353,7 +3353,7 @@ namespace ranges { class _Ssize_fn { public: template - _NODISCARD constexpr auto operator()(_Rng&& _Range) const + _NODISCARD constexpr auto operator()(_Rng&& _Range) const noexcept(noexcept(_RANGES size(_Range))) requires requires { _RANGES size(_Range); } { using _Sty = _Make_signed_like_t; diff --git a/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp index 176e93fae42..86b2371cec1 100644 --- a/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_range_machinery/test.cpp @@ -1529,6 +1529,7 @@ namespace nothrow_testing { STATIC_ASSERT(noexcept(ranges::crend(t)) == Nothrow); STATIC_ASSERT(noexcept(ranges::empty(t)) == Nothrow); STATIC_ASSERT(noexcept(ranges::size(t)) == Nothrow); + STATIC_ASSERT(noexcept(ranges::ssize(t)) == Nothrow); STATIC_ASSERT(noexcept(ranges::data(t)) == Nothrow); STATIC_ASSERT(noexcept(ranges::cdata(t)) == Nothrow);