diff --git a/libcxx/include/__cxx03/__mutex/once_flag.h b/libcxx/include/__cxx03/__mutex/once_flag.h index eaeaa6121bff8..529aa77071776 100644 --- a/libcxx/include/__cxx03/__mutex/once_flag.h +++ b/libcxx/include/__cxx03/__mutex/once_flag.h @@ -10,6 +10,7 @@ #define _LIBCPP___CXX03___MUTEX_ONCE_FLAG_H #include <__cxx03/__config> +#include <__cxx03/__memory/addressof.h> #include <__cxx03/__memory/shared_ptr.h> // __libcpp_acquire_load #include <__cxx03/__tuple/tuple_indices.h> #include <__cxx03/__tuple/tuple_size.h> @@ -82,7 +83,7 @@ template inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, _Callable& __func) { if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) { __call_once_param<_Callable> __p(__func); - std::__call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>); + std::__call_once(__flag.__state_, std::addressof(__p), std::addressof(__call_once_proxy<_Callable>)); } } @@ -90,7 +91,7 @@ template inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, const _Callable& __func) { if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) { __call_once_param __p(__func); - std::__call_once(__flag.__state_, &__p, &__call_once_proxy); + std::__call_once(__flag.__state_, std::addressof(__p), std::addressof(__call_once_proxy)); } } diff --git a/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp index ea5b63d2804a1..121705f2e3a99 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: no-threads -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - // // struct once_flag;