diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-08-28 13:29:30 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-08-28 13:29:30 +0000 |
| commit | fa8ce34534886bb47eb82e2c4ad372c16a0787b9 (patch) | |
| tree | 229baa652224ee4e5e3edd798e92fbfa34df8992 /libcxx/include/memory | |
| parent | 4e4e5a4e8ab7d93c9df999ffa17e04bfcd0b103f (diff) | |
| download | bcm5719-llvm-fa8ce34534886bb47eb82e2c4ad372c16a0787b9.tar.gz bcm5719-llvm-fa8ce34534886bb47eb82e2c4ad372c16a0787b9.zip | |
Use addressof instead of operator& in make_shared. Fixes PR38729. As a drive-by, make the same change in raw_storage_iterator (twice).
llvm-svn: 340823
Diffstat (limited to 'libcxx/include/memory')
| -rw-r--r-- | libcxx/include/memory | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/include/memory b/libcxx/include/memory index 4b7a26c5e76..de3f52d6ae4 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -1989,10 +1989,10 @@ public: _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {} _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;} _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element) - {::new(&*__x_) _Tp(__element); return *this;} + {::new(_VSTD::addressof(*__x_)) _Tp(__element); return *this;} #if _LIBCPP_STD_VER >= 14 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element) - {::new(&*__x_) _Tp(_VSTD::move(__element)); return *this;} + {::new(_VSTD::addressof(*__x_)) _Tp(_VSTD::move(__element)); return *this;} #endif _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;} _LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int) @@ -3682,7 +3682,7 @@ private: virtual void __on_zero_shared_weak() _NOEXCEPT; public: _LIBCPP_INLINE_VISIBILITY - _Tp* get() _NOEXCEPT {return &__data_.second();} + _Tp* get() _NOEXCEPT {return _VSTD::addressof(__data_.second());} }; template <class _Tp, class _Alloc> |

