Suppress -Wctad-maybe-unsupported on types w/o deduction guides.

There are a handful of standard library types that are intended
to support CTAD but don't need any explicit deduction guides to
do so.

This patch adds a dummy deduction guide to those types to suppress
-Wctad-maybe-unsupported (which gets emitted in user code).

llvm-svn: 367770
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: fcd549a7d8284a8e7c763fee3da2206acd8cdc4f
diff --git a/include/__config b/include/__config
index e49adb4..a8991c3 100644
--- a/include/__config
+++ b/include/__config
@@ -1429,6 +1429,15 @@
 
 #define _LIBCPP_UNUSED_VAR(x) ((void)(x))
 
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
+  template <class _Tag = void> \
+  _ClassName(typename _Tag::__allow_ctad) -> _ClassName<void>
+#else
+#define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
+   static_assert(true, "")
+#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+
 #endif // __cplusplus
 
 #endif // _LIBCPP_CONFIG
diff --git a/include/__mutex_base b/include/__mutex_base
index f828bea..6361c20 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -107,6 +107,8 @@
     lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE;
     lock_guard& operator=(lock_guard const&) _LIBCPP_EQUAL_DELETE;
 };
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(lock_guard);
+
 
 template <class _Mutex>
 class _LIBCPP_TEMPLATE_VIS unique_lock
@@ -205,6 +207,7 @@
     _LIBCPP_INLINE_VISIBILITY
     mutex_type* mutex() const _NOEXCEPT {return __m_;}
 };
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(unique_lock);
 
 template <class _Mutex>
 void
diff --git a/include/functional b/include/functional
index 865a281..dd65f1b 100644
--- a/include/functional
+++ b/include/functional
@@ -3067,7 +3067,8 @@
     _ForwardIterator __first_;
     _ForwardIterator __last_;
     _BinaryPredicate __pred_;
-    };
+};
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(default_searcher);
 
 #endif // _LIBCPP_STD_VER > 14
 
diff --git a/include/iterator b/include/iterator
index 30801ea..b503f15 100644
--- a/include/iterator
+++ b/include/iterator
@@ -841,6 +841,7 @@
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++()    {return *this;}
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator  operator++(int) {return *this;}
 };
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(back_insert_iterator);
 
 template <class _Container>
 inline _LIBCPP_INLINE_VISIBILITY
diff --git a/include/mutex b/include/mutex
index 20c3ffc..a7d6232 100644
--- a/include/mutex
+++ b/include/mutex
@@ -546,6 +546,7 @@
 
     _MutexTuple __t_;
 };
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(scoped_lock);
 
 #endif // _LIBCPP_STD_VER > 14
 #endif // !_LIBCPP_HAS_NO_THREADS
diff --git a/include/shared_mutex b/include/shared_mutex
index fcafd8c..c991134 100644
--- a/include/shared_mutex
+++ b/include/shared_mutex
@@ -430,6 +430,7 @@
     _LIBCPP_INLINE_VISIBILITY
     mutex_type* mutex() const _NOEXCEPT {return __m_;}
 };
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(shared_lock);
 
 template <class _Mutex>
 void
diff --git a/include/string_view b/include/string_view
index 0444831..39ebc66 100644
--- a/include/string_view
+++ b/include/string_view
@@ -604,6 +604,7 @@
     const   value_type* __data;
     size_type           __size;
 };
+_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_string_view);
 
 
 // [string.view.comparison]