diff --git a/stl/inc/ranges b/stl/inc/ranges index f1a0e640d6..b7c506fd88 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -3042,10 +3042,11 @@ namespace ranges { /* [[no_unique_address]] */ _Non_propagating_cache<_Cache_wrapper, false> _Inner{}; }; - // clang-format off + template // TRANSITION, LLVM-47414 - concept _Can_const_join = input_range && is_reference_v>>; + concept _Can_const_join = input_range && is_reference_v>; + // clang-format off template requires is_reference_v> class _Join_view_base<_Vw> : public view_interface> {}; diff --git a/tests/std/tests/P0896R4_views_join/test.cpp b/tests/std/tests/P0896R4_views_join/test.cpp index db2e346dcf..73dbb5a18f 100644 --- a/tests/std/tests/P0896R4_views_join/test.cpp +++ b/tests/std/tests/P0896R4_views_join/test.cpp @@ -561,6 +561,14 @@ int main() { static_assert(ranges::distance(views::iota(0, 2) | views::transform(ToArrayOfImmovable) | views::join) == 6); } + { // Joining a non-const view without const qualified begin and end methods + vector> nested_vectors = {{0}, {1, 2, 3}, {99}, {4, 5, 6, 7}, {}, {8, 9, 10}}; + auto RemoveSmallVectors = [](const vector& inner_vector) { return inner_vector.size() > 2; }; + auto filted_and_joined = nested_vectors | views::filter(RemoveSmallVectors) | views::join; + static constexpr int result[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + assert(ranges::equal(filted_and_joined, result)); + } + STATIC_ASSERT(instantiation_test()); instantiation_test(); }