forked from OSchip/llvm-project
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. llvm-svn: 304955
This commit is contained in:
parent
6ac7a34816
commit
955290d21f
|
@ -502,7 +502,6 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit scoped_lock(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
|
||||
: __m_(__m) {}
|
||||
|
||||
|
||||
scoped_lock(scoped_lock const&) = delete;
|
||||
scoped_lock& operator=(scoped_lock const&) = delete;
|
||||
|
@ -547,6 +546,11 @@ private:
|
|||
_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_HAS_NO_THREADS
|
||||
|
||||
|
|
Loading…
Reference in New Issue