Fix class template deduction for scoped_lock.
r304862 changed how CTD handles deducing a non-primary class template using a non-dependent constructor of the primary template. This change requires libc++ to provide explicit deduction guides to make scoped_lock work again. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304955 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -503,7 +503,6 @@ public:
|
|||||||
explicit scoped_lock(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
|
explicit scoped_lock(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
|
||||||
: __m_(__m) {}
|
: __m_(__m) {}
|
||||||
|
|
||||||
|
|
||||||
scoped_lock(scoped_lock const&) = delete;
|
scoped_lock(scoped_lock const&) = delete;
|
||||||
scoped_lock& operator=(scoped_lock const&) = delete;
|
scoped_lock& operator=(scoped_lock const&) = delete;
|
||||||
};
|
};
|
||||||
@@ -547,6 +546,11 @@ private:
|
|||||||
_MutexTuple __t_;
|
_MutexTuple __t_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __cpp_deduction_guides
|
||||||
|
template <class _Mutex> explicit scoped_lock(_Mutex&) -> scoped_lock<_Mutex>;
|
||||||
|
explicit scoped_lock() -> scoped_lock<>;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _LIBCPP_STD_VER > 14
|
#endif // _LIBCPP_STD_VER > 14
|
||||||
#endif // !_LIBCPP_HAS_NO_THREADS
|
#endif // !_LIBCPP_HAS_NO_THREADS
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user