[Bug libstdc++/101571] DestroyGuard used by the ranges::uninitialized family should use addressof()

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 26 16:35:12 GMT 2021


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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0d480b8403f2541402adeed82deb7eb028330b87

commit r10-10310-g0d480b8403f2541402adeed82deb7eb028330b87
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jul 22 14:37:24 2021 +0100

    libstdc++: Use std::addressof in ranges::uninitialized_xxx [PR101571]

    Make the ranges::uninitialized_xxx algorithms use std::addressof to
    protect against iterator types that overload operator&.

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/101571
            * include/bits/ranges_uninitialized.h (_DestroyGuard): Change
            constructor parameter to reference and use addressof.
            * testsuite/util/testsuite_iterators.h: Define deleted operator&
            overloads for test iterators.

    (cherry picked from commit aca7a0253d6e3116f846ad530b19d89644a64267)


More information about the Gcc-bugs mailing list