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 <future>, thanks go to Zhihao Yuan for catching these.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187997 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/future b/include/future
index dae1a4b..00c99bc 100644
--- a/include/future
+++ b/include/future
@@ -727,7 +727,7 @@
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 @@
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 @@
__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);