aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-10-29 22:47:22 +0000
committerJonathan Wakely <jwakely@redhat.com>2020-10-29 22:47:22 +0000
commita55cda891d69b5a238d2e237903829995ca7249c (patch)
tree26f8f34916a37137f8f8476ee2b088fcfc3c33af
parentd7aa21a3c78874743a42ffc1af3493ecb665496f (diff)
downloadgcc-a55cda891d69b5a238d2e237903829995ca7249c.zip
gcc-a55cda891d69b5a238d2e237903829995ca7249c.tar.gz
gcc-a55cda891d69b5a238d2e237903829995ca7249c.tar.bz2
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.
-rw-r--r--libstdc++-v3/include/bits/ranges_util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/ranges_util.h b/libstdc++-v3/include/bits/ranges_util.h
index cc50e2a..416c334 100644
--- a/libstdc++-v3/include/bits/ranges_util.h
+++ b/libstdc++-v3/include/bits/ranges_util.h
@@ -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>