From 8c9742051d8a12df72798deeaa0475431b10dd3e Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 8 Aug 2013 18:38:55 +0000 Subject: My previous reorganization of addressof broke -std=c++03. Thanks much to Arnold Schwaighofer for catching this. This patch also catches a few more missing addressof in , thanks go to Zhihao Yuan for catching these. llvm-svn: 187997 --- libcxx/include/future | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libcxx/include/future') diff --git a/libcxx/include/future b/libcxx/include/future index dae1a4b805e..00c99bc0906 100644 --- a/libcxx/include/future +++ b/libcxx/include/future @@ -727,7 +727,7 @@ __assoc_state<_Rp&>::set_value(_Rp& __arg) if (this->__has_value()) throw future_error(make_error_code(future_errc::promise_already_satisfied)); #endif - __value_ = &__arg; + __value_ = _VSTD::addressof(__arg); this->__state_ |= base::__constructed | base::ready; __lk.unlock(); __cv_.notify_all(); @@ -742,7 +742,7 @@ __assoc_state<_Rp&>::set_value_at_thread_exit(_Rp& __arg) if (this->__has_value()) throw future_error(make_error_code(future_errc::promise_already_satisfied)); #endif - __value_ = &__arg; + __value_ = _VSTD::addressof(__arg); this->__state_ |= base::__constructed; __thread_local_data()->__make_ready_at_thread_exit(this); __lk.unlock(); @@ -778,7 +778,7 @@ void __assoc_state_alloc<_Rp, _Alloc>::__on_zero_shared() _NOEXCEPT { if (this->__state_ & base::__constructed) - reinterpret_cast<_Rp*>(&this->__value_)->~_Rp(); + reinterpret_cast<_Rp*>(_VSTD::addressof(this->__value_))->~_Rp(); typename _Alloc::template rebind<__assoc_state_alloc>::other __a(__alloc_); this->~__assoc_state_alloc(); __a.deallocate(this, 1); -- cgit v1.2.3