File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
tests/std/tests/P2474R2_views_repeat Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1708,8 +1708,8 @@ namespace ranges {
17081708 }
17091709 };
17101710
1711- template <class _Ty, class _Bo>
1712- repeat_view(_Ty, _Bo) -> repeat_view<_Ty, _Bo>;
1711+ template <class _Ty, class _Bo = unreachable_sentinel_t >
1712+ repeat_view(_Ty, _Bo = _Bo() ) -> repeat_view<_Ty, _Bo>;
17131713
17141714 namespace views {
17151715 struct _Repeat_fn {
Original file line number Diff line number Diff line change @@ -360,6 +360,16 @@ constexpr bool test() {
360360 test_iterator_arithmetic<wchar_t >();
361361 test_iterator_arithmetic<_Signed128>();
362362
363+ // GH-4507: LWG-4053 Unary call to std::views::repeat does not decay the argument
364+ {
365+ using RPV = ranges::repeat_view<const char *>;
366+
367+ static_assert (same_as<decltype (views::repeat (" foo" , unreachable_sentinel)), RPV>);
368+ static_assert (same_as<decltype (views::repeat (+" foo" , unreachable_sentinel)), RPV>);
369+ static_assert (same_as<decltype (views::repeat (" foo" )), RPV>);
370+ static_assert (same_as<decltype (views::repeat (+" foo" )), RPV>);
371+ }
372+
363373 return true ;
364374}
365375
You can’t perform that action at this time.
0 commit comments