libstdc++: Avoid narrowing conversion in subrange constructor
authorJonathan Wakely <jwakely@redhat.com>
Thu, 29 Oct 2020 22:47:22 +0000 (22:47 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 29 Oct 2020 22:47:22 +0000 (22:47 +0000)
commita55cda891d69b5a238d2e237903829995ca7249c
tree26f8f34916a37137f8f8476ee2b088fcfc3c33af
parentd7aa21a3c78874743a42ffc1af3493ecb665496f
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.
libstdc++-v3/include/bits/ranges_util.h