diff --git a/stl/inc/ranges b/stl/inc/ranges index 30d22d9c4f..c138ccf0df 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -4702,12 +4702,13 @@ namespace ranges { private: /* [[no_unique_address]] */ _Outer_iter _First{}; - public: - value_type() = default; constexpr explicit value_type(_Outer_iter _First_) noexcept( - is_nothrow_move_constructible_v<_Outer_iter>) // strengthened + is_nothrow_move_constructible_v<_Outer_iter>) : _First{_STD move(_First_)} {} + friend _Outer_iter; + + public: _NODISCARD constexpr auto begin() const { return _Inner_iter<_Const>{_First}; } diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 69cabaff36..ba26ae5bc1 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -165,6 +165,10 @@ std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitia std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move.pass.cpp FAIL std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp FAIL +# libc++ doesn't implement LWG-4013 +std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/ctor.default.pass.cpp FAIL +std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/ctor.iter.pass.cpp FAIL + # If any feature-test macro test is failing, this consolidated test will also fail. std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp FAIL diff --git a/tests/std/tests/P0896R4_views_lazy_split/test.cpp b/tests/std/tests/P0896R4_views_lazy_split/test.cpp index 8a688e0da3..1400ffe8a1 100644 --- a/tests/std/tests/P0896R4_views_lazy_split/test.cpp +++ b/tests/std/tests/P0896R4_views_lazy_split/test.cpp @@ -63,6 +63,10 @@ constexpr void test_one(Base&& base, Delimiter&& delimiter, Expected&& expected) STATIC_ASSERT(same_as); STATIC_ASSERT(noexcept(base | closure) == is_noexcept); + + using outer_iterator = decltype(views::lazy_split(base, delimiter).begin()); + STATIC_ASSERT(!is_default_constructible_v>); // LWG-4013 + STATIC_ASSERT(!is_constructible_v, outer_iterator>); // LWG-4013 } // ... with const lvalue argument @@ -77,6 +81,10 @@ constexpr void test_one(Base&& base, Delimiter&& delimiter, Expected&& expected) STATIC_ASSERT(same_as); STATIC_ASSERT(noexcept(as_const(base) | closure) == is_noexcept); + + using outer_iterator = decltype(views::lazy_split(as_const(base), delimiter).begin()); + STATIC_ASSERT(!is_default_constructible_v>); // LWG-4013 + STATIC_ASSERT(!is_constructible_v, outer_iterator>); // LWG-4013 } else if constexpr (!is_view) { using LSV = ranges::lazy_split_view>, DV>; constexpr bool is_noexcept = is_nothrow_constructible_v&, Delimiter&>; @@ -99,6 +107,10 @@ constexpr void test_one(Base&& base, Delimiter&& delimiter, Expected&& expected) STATIC_ASSERT(same_as); STATIC_ASSERT(noexcept(move(base) | closure) == is_noexcept); + + using outer_iterator = decltype(views::lazy_split(move(base), delimiter).begin()); + STATIC_ASSERT(!is_default_constructible_v>); // LWG-4013 + STATIC_ASSERT(!is_constructible_v, outer_iterator>); // LWG-4013 } else if constexpr (movable>) { using RS = ranges::lazy_split_view>, DV>; constexpr bool is_noexcept = @@ -123,6 +135,10 @@ constexpr void test_one(Base&& base, Delimiter&& delimiter, Expected&& expected) STATIC_ASSERT(same_as); STATIC_ASSERT(noexcept(move(as_const(base)) | closure) == is_noexcept); + + using outer_iterator = decltype(views::lazy_split(move(as_const(base)), delimiter).begin()); + STATIC_ASSERT(!is_default_constructible_v>); // LWG-4013 + STATIC_ASSERT(!is_constructible_v, outer_iterator>); // LWG-4013 } // Validate deduction guide