Skip to content

Commit d202114

Browse files
committed
[libc++][C++03] cherry-pick llvm#128054
1 parent 9f9b480 commit d202114

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

libcxx/include/__cxx03/__mutex/once_flag.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define _LIBCPP___CXX03___MUTEX_ONCE_FLAG_H
1111

1212
#include <__cxx03/__config>
13+
#include <__cxx03/__memory/addressof.h>
1314
#include <__cxx03/__memory/shared_ptr.h> // __libcpp_acquire_load
1415
#include <__cxx03/__tuple/tuple_indices.h>
1516
#include <__cxx03/__tuple/tuple_size.h>
@@ -82,15 +83,15 @@ template <class _Callable>
8283
inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, _Callable& __func) {
8384
if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) {
8485
__call_once_param<_Callable> __p(__func);
85-
std::__call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>);
86+
std::__call_once(__flag.__state_, std::addressof(__p), std::addressof(__call_once_proxy<_Callable>));
8687
}
8788
}
8889

8990
template <class _Callable>
9091
inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, const _Callable& __func) {
9192
if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) {
9293
__call_once_param<const _Callable> __p(__func);
93-
std::__call_once(__flag.__state_, &__p, &__call_once_proxy<const _Callable>);
94+
std::__call_once(__flag.__state_, std::addressof(__p), std::addressof(__call_once_proxy<const _Callable>));
9495
}
9596
}
9697

libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
// UNSUPPORTED: no-threads
1010

11-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
12-
1311
// <mutex>
1412

1513
// struct once_flag;

0 commit comments

Comments
 (0)