libstdc++: Avoid narrowing conversion in subrange constructor

libstdc++-v3/ChangeLog:

	* include/bits/ranges_util.h (subrange::subrange(R&&)): Use
	direct-initialization instead of list-initialization, so a
	potential narrowing conversion from ranges::size(r) to the
	stored size isn't ill-formed.
This commit is contained in:
Jonathan Wakely 2020-10-29 22:47:22 +00:00
parent d7aa21a3c7
commit a55cda891d

View File

@ -247,7 +247,7 @@ namespace ranges
&& convertible_to<sentinel_t<_Rng>, _Sent>
constexpr
subrange(_Rng&& __r) requires _S_store_size && sized_range<_Rng>
: subrange{__r, ranges::size(__r)}
: subrange(__r, ranges::size(__r))
{ }
template<__detail::__not_same_as<subrange> _Rng>