[Bug libstdc++/106766] zip_view::_Iterator/_Sentinel's operator- use make_unsigned_t

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 9 19:04:59 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106766

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:718a6d475b3d17759618c68331c85f55c58ec9a3

commit r13-2567-g718a6d475b3d17759618c68331c85f55c58ec9a3
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Sep 9 14:56:32 2022 -0400

    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.


More information about the Gcc-bugs mailing list