projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7aa21a
)
libstdc++: Avoid narrowing conversion in subrange constructor
author
Jonathan Wakely
<jwakely@redhat.com>
Thu, 29 Oct 2020 22:47:22 +0000
(22:47 +0000)
committer
Jonathan Wakely
<jwakely@redhat.com>
Thu, 29 Oct 2020 22:47:22 +0000
(22:47 +0000)
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
patch
|
blob
|
history
diff --git
a/libstdc++-v3/include/bits/ranges_util.h
b/libstdc++-v3/include/bits/ranges_util.h
index cc50e2ad4e42311d451490aa7ae9a7a0e3c0fcb9..416c334625412a542098639f3635fab34bd1cfe2 100644
(file)
--- 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>