diff options
| author | Eric Fiselier <eric@efcs.ca> | 2017-06-08 00:38:56 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2017-06-08 00:38:56 +0000 |
| commit | 955290d21fdc8f34db877edc8b085b8e8ae42524 (patch) | |
| tree | 366f087dc49cdbd970e809477fdbfde0005c8a68 /libcxx/include | |
| parent | 6ac7a348167af7687454a7ee00506a0120df79c9 (diff) | |
| download | bcm5719-llvm-955290d21fdc8f34db877edc8b085b8e8ae42524.tar.gz bcm5719-llvm-955290d21fdc8f34db877edc8b085b8e8ae42524.zip | |
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
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/mutex | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libcxx/include/mutex b/libcxx/include/mutex index 55380882044..1062f2b443e 100644 --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -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 |

