libstdc++: Use std::addressof in ranges::uninitialized_xxx [PR101571]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 22 Jul 2021 13:37:24 +0000 (14:37 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 22 Jul 2021 13:37:24 +0000 (14:37 +0100)
commitaca7a0253d6e3116f846ad530b19d89644a64267
tree2e2e332d47bdb07ccd85e8b339c1652122086e3c
parentc22bcfd2f7dc9bb5ad394720f4a612327dc898ba
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.
libstdc++-v3/include/bits/ranges_uninitialized.h
libstdc++-v3/testsuite/util/testsuite_iterators.h