diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2016-03-14 23:07:32 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2016-03-14 23:07:32 +0000 |
commit | 0b54e792b7b31e44a58b53938bc73b87bbcd897f (patch) | |
tree | 01475dea71d971ae5db75a06430fcbbbc9a0dc40 /libcxx/include/__mutex_base | |
parent | 423ec18cc2c626bcbdc22d9417c1c337abe7e035 (diff) | |
download | bcm5719-llvm-0b54e792b7b31e44a58b53938bc73b87bbcd897f.tar.gz bcm5719-llvm-0b54e792b7b31e44a58b53938bc73b87bbcd897f.zip |
Implement LWG2577: {shared,unique}_lock</tt> should use std::addressof
llvm-svn: 263506
Diffstat (limited to 'libcxx/include/__mutex_base')
-rw-r--r-- | libcxx/include/__mutex_base | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libcxx/include/__mutex_base b/libcxx/include/__mutex_base index b019b4760d1..6165023d296 100644 --- a/libcxx/include/__mutex_base +++ b/libcxx/include/__mutex_base @@ -109,24 +109,24 @@ public: unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY explicit unique_lock(mutex_type& __m) - : __m_(&__m), __owns_(true) {__m_->lock();} + : __m_(addressof(__m)), __owns_(true) {__m_->lock();} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT - : __m_(&__m), __owns_(false) {} + : __m_(addressof(__m)), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, try_to_lock_t) - : __m_(&__m), __owns_(__m.try_lock()) {} + : __m_(addressof(__m)), __owns_(__m.try_lock()) {} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, adopt_lock_t) - : __m_(&__m), __owns_(true) {} + : __m_(addressof(__m)), __owns_(true) {} template <class _Clock, class _Duration> _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t) - : __m_(&__m), __owns_(__m.try_lock_until(__t)) {} + : __m_(addressof(__m)), __owns_(__m.try_lock_until(__t)) {} template <class _Rep, class _Period> _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d) - : __m_(&__m), __owns_(__m.try_lock_for(__d)) {} + : __m_(addressof(__m)), __owns_(__m.try_lock_for(__d)) {} _LIBCPP_INLINE_VISIBILITY ~unique_lock() { |