From: redi Date: Tue, 16 Jun 2015 22:33:06 +0000 (+0000) Subject: * include/bits/allocated_ptr.h (__allocated_ptr): Use __addressof. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3f6aaeccd02e08ab8871f212d0edce4363b5e0d;p=thirdparty%2Fgcc.git * include/bits/allocated_ptr.h (__allocated_ptr): Use __addressof. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224540 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e6ed6ab16895..a9ed2064aeac 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,7 @@ 2015-06-16 Jonathan Wakely + * include/bits/allocated_ptr.h (__allocated_ptr): Use __addressof. + * include/bits/list.tcc (list::operator=(const list&), list::merge): Use __addressof instead of operator&. (list::sort): Use array-to-pointer decay instead of operator&. diff --git a/libstdc++-v3/include/bits/allocated_ptr.h b/libstdc++-v3/include/bits/allocated_ptr.h index 63088c22d80d..d7f00d706308 100644 --- a/libstdc++-v3/include/bits/allocated_ptr.h +++ b/libstdc++-v3/include/bits/allocated_ptr.h @@ -50,14 +50,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Take ownership of __ptr __allocated_ptr(_Alloc& __a, pointer __ptr) noexcept - : _M_alloc(&__a), _M_ptr(__ptr) + : _M_alloc(std::__addressof(__a)), _M_ptr(__ptr) { } /// Convert __ptr to allocator's pointer type and take ownership of it template>> __allocated_ptr(_Alloc& __a, _Ptr __ptr) - : _M_alloc(&__a), _M_ptr(pointer_traits::pointer_to(*__ptr)) + : _M_alloc(std::__addressof(__a)), + _M_ptr(pointer_traits::pointer_to(*__ptr)) { } /// Transfer ownership of the owned pointer