diff --git a/stl/inc/ranges b/stl/inc/ranges index 37e9db92824..83fe6046bc3 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -10372,7 +10372,7 @@ namespace ranges { const auto _Xform = [](auto&& _Elem) _STATIC_CALL_OPERATOR { return _RANGES to>(_STD forward(_Elem)); }; - return _RANGES to<_Container>(views::transform(_Range, _Xform), _STD forward<_Types>(_Args)...); + return _RANGES to<_Container>(views::transform(ref_view{_Range}, _Xform), _STD forward<_Types>(_Args)...); } else { static_assert(_Always_false<_Container>, "the program is ill-formed per N4950 [range.utility.conv.to]/2.3"); } diff --git a/tests/std/tests/P1206R7_ranges_to_sequence/test.cpp b/tests/std/tests/P1206R7_ranges_to_sequence/test.cpp index e3032e3fe1b..9ee7894d9f7 100644 --- a/tests/std/tests/P1206R7_ranges_to_sequence/test.cpp +++ b/tests/std/tests/P1206R7_ranges_to_sequence/test.cpp @@ -57,6 +57,11 @@ struct sequence_instantiator { template