mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-16 23:31:05 +08:00
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:
parent
d7aa21a3c7
commit
a55cda891d
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user