]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix zip_view's operator- for integer-class difference type [PR106766]
authorPatrick Palka <ppalka@redhat.com>
Fri, 9 Sep 2022 18:56:32 +0000 (14:56 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 9 Sep 2022 18:56:32 +0000 (14:56 -0400)
commit718a6d475b3d17759618c68331c85f55c58ec9a3
tree47bc41e6852c0c2d2920bad705819c4aa4e9b6ca
parent50be486dff4ea2676ed022e9524ef190b92ae2b1
libstdc++: Fix zip_view's operator- for integer-class difference type [PR106766]

The difference type of an underlying iterator could be an integer-class
type, which make_unsigned_t doesn't handle, so we need to use the more
general __make_unsigned_like_t / __to_unsigned_like here instead.

PR libstdc++/106766

libstdc++-v3/ChangeLog:

* include/std/ranges (zip_view::_Iterator::operator-): Use
__to_unsigned_like instead of make_unsigned_t.
(zip_view::_Sentinel::operator-): Likewise.
* testsuite/std/ranges/zip/1.cc (test04): New test.
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/zip/1.cc