Skip to content

Commit 7bc7381

Browse files
committed
[libcxx] Address comments to fix build failures
1 parent 99c0295 commit 7bc7381

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libcxx/include/__mutex/unique_lock.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
#include <__memory/addressof.h>
1616
#include <__mutex/tag_types.h>
1717
#include <__system_error/throw_system_error.h>
18+
#include <__utility/move.h>
1819
#include <__utility/swap.h>
1920
#include <cerrno>
2021

2122
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2223
# pragma GCC system_header
2324
#endif
2425

26+
_LIBCPP_PUSH_MACROS
27+
#include <__undef_macros>
2528
_LIBCPP_BEGIN_NAMESPACE_STD
2629

2730
template <class _Mutex>
@@ -74,7 +77,7 @@ class unique_lock {
7477
}
7578

7679
_LIBCPP_HIDE_FROM_ABI unique_lock& operator=(unique_lock&& __u) _NOEXCEPT {
77-
unique_lock{std::move(__u)}.swap(*this);
80+
unique_lock(std::move(__u)).swap(*this);
7881
return *this;
7982
}
8083

@@ -163,5 +166,6 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(unique_lock<_Mutex>& __x, unique_lock<_Mu
163166
}
164167

165168
_LIBCPP_END_NAMESPACE_STD
169+
_LIBCPP_POP_MACROS
166170

167171
#endif // _LIBCPP___MUTEX_UNIQUE_LOCK_H

libcxx/include/shared_mutex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ template <class Mutex>
138138
# include <__mutex/tag_types.h>
139139
# include <__mutex/unique_lock.h>
140140
# include <__system_error/throw_system_error.h>
141+
# include <__utility/move.h>
141142
# include <__utility/swap.h>
142143
# include <cerrno>
143144
# include <version>
@@ -340,7 +341,7 @@ public:
340341
}
341342

342343
_LIBCPP_HIDE_FROM_ABI shared_lock& operator=(shared_lock&& __u) _NOEXCEPT {
343-
shared_lock{std::move(__u)}.swap(*this);
344+
shared_lock(std::move(__u)).swap(*this);
344345
return *this;
345346
}
346347

0 commit comments

Comments
 (0)