[libc++] Remove workarounds for the lack of deduction guides in C++17
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 17 Aug 2021 15:59:07 +0000 (11:59 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Wed, 18 Aug 2021 12:57:25 +0000 (08:57 -0400)
All supported compilers have supported deduction guides in C++17 for a
while, so this isn't necessary anymore.

Differential Revision: https://reviews.llvm.org/D108213

82 files changed:
libcxx/include/__config
libcxx/include/__functional/function.h
libcxx/include/__functional/reference_wrapper.h
libcxx/include/__iterator/iterator_traits.h
libcxx/include/__memory/shared_ptr.h
libcxx/include/__utility/pair.h
libcxx/include/array
libcxx/include/deque
libcxx/include/forward_list
libcxx/include/list
libcxx/include/map
libcxx/include/optional
libcxx/include/queue
libcxx/include/regex
libcxx/include/set
libcxx/include/stack
libcxx/include/string
libcxx/include/tuple
libcxx/include/unordered_map
libcxx/include/unordered_set
libcxx/include/vector
libcxx/test/std/containers/associative/map/map.cons/deduct.fail.cpp
libcxx/test/std/containers/associative/map/map.cons/deduct.pass.cpp
libcxx/test/std/containers/associative/map/map.cons/deduct_const.pass.cpp
libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp
libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.pass.cpp
libcxx/test/std/containers/associative/multimap/multimap.cons/deduct_const.pass.cpp
libcxx/test/std/containers/associative/multiset/multiset.cons/deduct.fail.cpp
libcxx/test/std/containers/associative/multiset/multiset.cons/deduct.pass.cpp
libcxx/test/std/containers/associative/set/set.cons/deduct.fail.cpp
libcxx/test/std/containers/associative/set/set.cons/deduct.pass.cpp
libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp
libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp
libcxx/test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp
libcxx/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp
libcxx/test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp
libcxx/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/array/array.cons/deduct.fail.cpp
libcxx/test/std/containers/sequences/array/array.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp
libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp
libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/list/list.cons/deduct.fail.cpp
libcxx/test/std/containers/sequences/list/list.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp
libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.fail.cpp
libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct_const.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.fail.cpp
libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp
libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/deduct.fail.cpp
libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/deduct.fail.cpp
libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/deduct.pass.cpp
libcxx/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp
libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp
libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp
libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.fail.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.pass.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_ptr.pass.cpp
libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/deduct.pass.cpp
libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/deduction.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/shared_ptr_deduction.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp
libcxx/test/std/utilities/utility/pairs/pairs.pair/implicit_deduction_guides.pass.cpp
libcxx/utils/libcxx/test/features.py

index a573629..0f2a231 100644 (file)
@@ -1350,10 +1350,6 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
 #define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS
 #endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES
 
-#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
-#define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-#endif
-
 #if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
 #define _LIBCPP_HAS_NO_COROUTINES
 #endif
index baa0135..386f8aa 100644 (file)
@@ -1045,7 +1045,7 @@ public:
 #endif // _LIBCPP_NO_RTTI
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _Rp, class ..._Ap>
 function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
 
@@ -1090,7 +1090,7 @@ struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { usin
 
 template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
 function(_Fp) -> function<_Stripped>;
-#endif // !_LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#endif // _LIBCPP_STD_VER >= 17
 
 template<class _Rp, class ..._ArgTypes>
 function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}
index 09f4a64..20b3eed 100644 (file)
@@ -176,7 +176,7 @@ public:
 #endif // _LIBCPP_CXX03_LANG
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template <class _Tp>
 reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
 #endif
index 5275705..a0454d2 100644 (file)
@@ -477,7 +477,7 @@ struct __is_exactly_cpp17_input_iterator
          __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
         !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator>
 using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
 
@@ -491,7 +491,7 @@ template<class _InputIterator>
 using __iter_to_alloc_type = pair<
     add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>,
     typename iterator_traits<_InputIterator>::value_type::second_type>;
-#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#endif // _LIBCPP_STD_VER >= 17
 
 _LIBCPP_END_NAMESPACE_STD
 
index 04161c4..9ac7ba8 100644 (file)
@@ -686,7 +686,7 @@ private:
     template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _Tp>
 shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
 template<class _Tp, class _Dp>
@@ -1406,7 +1406,7 @@ public:
     template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _Tp>
 weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
 #endif
index e0216f3..06d68d5 100644 (file)
@@ -310,10 +310,10 @@ private:
 #endif
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _T1, class _T2>
 pair(_T1, _T2) -> pair<_T1, _T2>;
-#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#endif
 
 template <class _T1, class _T2>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
index 022172b..b76b9fa 100644 (file)
@@ -356,7 +356,7 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
 };
 
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _Tp, class... _Args,
          class = _EnableIf<__all<_IsSame<_Tp, _Args>::value...>::value>
          >
index aff93de..37ba586 100644 (file)
@@ -1588,7 +1588,7 @@ public:
     void __move_assign(deque& __c, false_type);
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Alloc = allocator<__iter_value_type<_InputIterator>>,
          class = _EnableIf<__is_allocator<_Alloc>::value>
index 0ae8f19..66aa757 100644 (file)
@@ -870,7 +870,7 @@ private:
 };
 
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Alloc = allocator<__iter_value_type<_InputIterator>>,
          class = _EnableIf<__is_allocator<_Alloc>::value>
index 23da5fc..2ae6d58 100644 (file)
@@ -1141,7 +1141,7 @@ private:
     void __move_assign(list& __c, false_type);
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Alloc = allocator<__iter_value_type<_InputIterator>>,
          class = _EnableIf<__is_allocator<_Alloc>::value>
index 513a04d..3c2b6ff 100644 (file)
@@ -1502,7 +1502,7 @@ private:
 #endif
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
          class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
          class = _EnableIf<!__is_allocator<_Compare>::value, void>,
@@ -2175,7 +2175,7 @@ private:
     typedef unique_ptr<__node, _Dp> __node_holder;
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
          class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
          class = _EnableIf<!__is_allocator<_Compare>::value, void>,
index 5aec969..4469360 100644 (file)
@@ -1000,7 +1000,7 @@ public:
     using __base::reset;
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class T>
     optional(T) -> optional<T>;
 #endif
index 276fff9..2a09bac 100644 (file)
@@ -358,7 +358,7 @@ public:
     operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _Container,
          class = _EnableIf<!__is_allocator<_Container>::value>
 >
@@ -584,7 +584,7 @@ public:
                    __is_nothrow_swappable<value_compare>::value);
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template <class _Compare,
           class _Container,
           class = _EnableIf<!__is_allocator<_Compare>::value>,
index e47cf9f..a0bf3e2 100644 (file)
@@ -3014,7 +3014,7 @@ private:
     template <class, class> friend class __lookahead;
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template <class _ForwardIterator,
           class = typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value, nullptr_t>::type
 >
index 21ec843..04f8fc2 100644 (file)
@@ -868,7 +868,7 @@ public:
 #endif
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Compare = less<__iter_value_type<_InputIterator>>,
          class _Allocator = allocator<__iter_value_type<_InputIterator>>,
@@ -1399,7 +1399,7 @@ public:
 #endif
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Compare = less<__iter_value_type<_InputIterator>>,
          class _Allocator = allocator<__iter_value_type<_InputIterator>>,
index aefef31..5ee4d51 100644 (file)
@@ -231,7 +231,7 @@ public:
     operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y);
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _Container,
          class = _EnableIf<!__is_allocator<_Container>::value>
 >
index 4940021..01b79d8 100644 (file)
@@ -1732,7 +1732,7 @@ _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t)
 #endif
 
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _CharT = __iter_value_type<_InputIterator>,
          class _Allocator = allocator<_CharT>,
index e1019ef..2e339f8 100644 (file)
@@ -1097,7 +1097,7 @@ public:
     void swap(tuple&) _NOEXCEPT {}
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template <class ..._Tp>
 tuple(_Tp...) -> tuple<_Tp...>;
 template <class _Tp1, class _Tp2>
index ea0382d..a0c1c55 100644 (file)
@@ -1464,7 +1464,7 @@ private:
 #endif
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Hash = hash<__iter_key_type<_InputIterator>>,
          class _Pred = equal_to<__iter_key_type<_InputIterator>>,
@@ -2263,7 +2263,7 @@ public:
 
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Hash = hash<__iter_key_type<_InputIterator>>,
          class _Pred = equal_to<__iter_key_type<_InputIterator>>,
index a775a92..de87dcd 100644 (file)
@@ -799,7 +799,7 @@ public:
 
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Hash = hash<__iter_value_type<_InputIterator>>,
          class _Pred = equal_to<__iter_value_type<_InputIterator>>,
@@ -1465,7 +1465,7 @@ public:
 
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Hash = hash<__iter_value_type<_InputIterator>>,
          class _Pred = equal_to<__iter_value_type<_InputIterator>>,
index 9189ed4..3afaddc 100644 (file)
@@ -931,7 +931,7 @@ private:
   }
 };
 
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
 template<class _InputIterator,
          class _Alloc = allocator<__iter_value_type<_InputIterator>>,
          class = _EnableIf<__is_allocator<_Alloc>::value>
index 13722e9..a71efaf 100644 (file)
@@ -8,7 +8,6 @@
 
 // <map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 //  clang-6 gives different error messages.
 
index 139714b..4444782 100644 (file)
@@ -8,7 +8,6 @@
 
 // <map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Compare = less<iter-value-type<InputIterator>>,
index d584ffd..3da55fa 100644 (file)
@@ -8,7 +8,6 @@
 
 // <map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Compare = less<iter-value-type<InputIterator>>,
index fc8a407..541989a 100644 (file)
@@ -8,7 +8,6 @@
 
 // <map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 //  clang-6 gives different error messages.
 
index e5b42eb..b1faba6 100644 (file)
@@ -8,7 +8,6 @@
 
 // <map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Compare = less<iter-value-type<InputIterator>>,
index 127ee6e..716c522 100644 (file)
@@ -8,7 +8,6 @@
 
 // <map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Compare = less<iter-value-type<InputIterator>>,
index 59f90d2..79a73f8 100644 (file)
@@ -8,7 +8,6 @@
 
 // <set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 //  clang-6 gives different error messages.
 
index 9e0a7fe..180fa06 100644 (file)
@@ -8,7 +8,6 @@
 
 // <set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // UNSUPPORTED: apple-clang-9.1
 
 // template<class InputIterator,
index 2f06891..5d2a02f 100644 (file)
@@ -8,7 +8,6 @@
 
 // <set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 //  clang-6 gives different error messages.
 
index a4175ae..0a38ef3 100644 (file)
@@ -8,7 +8,6 @@
 
 // <set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // UNSUPPORTED: apple-clang-9.1
 
 // template<class InputIterator,
index 89ff2e7..6804c4d 100644 (file)
@@ -8,7 +8,6 @@
 
 // <queue>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class Compare, class Container>
 // priority_queue(Compare, Container)
index 4404cc1..716e409 100644 (file)
@@ -9,7 +9,6 @@
 // <queue>
 // UNSUPPORTED: c++03, c++11, c++14
 // UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
 // Clang 5 will generate bad implicit deduction guides
 //  Specifically, for the copy constructor.
 
index a38848b..55296f4 100644 (file)
@@ -8,8 +8,6 @@
 
 // <stack>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    vector(InputIterator, InputIterator, Allocator = Allocator())
index 5e279fc..41187e7 100644 (file)
@@ -9,11 +9,9 @@
 // <stack>
 // UNSUPPORTED: c++03, c++11, c++14
 // UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
 // Clang 5 will generate bad implicit deduction guides
 //     Specifically, for the copy constructor.
 
-
 // template<class Container>
 //   stack(Container) -> stack<typename Container::value_type, Container>;
 //
index ede849f..37b4cc0 100644 (file)
@@ -8,8 +8,6 @@
 
 // <array>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class T, class... U>
 //   array(T, U...) -> array<T, 1 + sizeof...(U)>;
index 292fe8a..44d8dcb 100644 (file)
@@ -9,17 +9,14 @@
 // <array>
 // UNSUPPORTED: c++03, c++11, c++14
 // UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
 // Clang 5 will generate bad implicit deduction guides
 //     Specifically, for the copy constructor.
 
-
 // template <class T, class... U>
 //   array(T, U...) -> array<T, 1 + sizeof...(U)>;
 //
 //  Requires: (is_same_v<T, U> && ...) is true. Otherwise the program is ill-formed.
 
-
 #include <array>
 #include <cassert>
 #include <cstddef>
index f40577d..044669a 100644 (file)
@@ -8,15 +8,12 @@
 
 // <array>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    deque(InputIterator, InputIterator, Allocator = Allocator())
 //    -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <deque>
 #include <iterator>
 #include <cassert>
index 3f0e16f..fb5f69c 100644 (file)
@@ -8,15 +8,12 @@
 
 // <deque>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    deque(InputIterator, InputIterator, Allocator = Allocator())
 //    -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <deque>
 #include <iterator>
 #include <cassert>
index dcfb89f..47c1cdc 100644 (file)
@@ -8,15 +8,12 @@
 
 // <forward_list>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    forward_list(InputIterator, InputIterator, Allocator = Allocator())
 //    -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <forward_list>
 #include <iterator>
 #include <cassert>
index 6c134d8..9af93f9 100644 (file)
@@ -8,15 +8,12 @@
 
 // <forward_list>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    forward_list(InputIterator, InputIterator, Allocator = Allocator())
 //    -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <forward_list>
 #include <iterator>
 #include <cassert>
index b06674f..96d1451 100644 (file)
@@ -8,15 +8,12 @@
 
 // <list>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    list(InputIterator, InputIterator, Allocator = Allocator())
 //    -> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <list>
 #include <iterator>
 #include <cassert>
index 9196317..afebdf8 100644 (file)
@@ -8,15 +8,12 @@
 
 // <list>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    list(InputIterator, InputIterator, Allocator = Allocator())
 //    -> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <list>
 #include <iterator>
 #include <cassert>
index 387328f..7ce00d7 100644 (file)
@@ -8,15 +8,12 @@
 
 // <vector>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    vector(InputIterator, InputIterator, Allocator = Allocator())
 //    -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <deque>
 #include <iterator>
 #include <cassert>
index f343ba8..6cdc19a 100644 (file)
@@ -8,15 +8,12 @@
 
 // <vector>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    vector(InputIterator, InputIterator, Allocator = Allocator())
 //    -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <vector>
 #include <iterator>
 #include <cassert>
index a84a1c0..2fc7fbe 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 
 // template<class InputIterator,
index 195495b..791830b 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Hash = hash<iter-key-type<InputIterator>>,
index 277639f..506a2b7 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Hash = hash<iter-key-type<InputIterator>>,
index ab60b3c..7fc82de 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 
 // template<class InputIterator,
index a7639ff..8d23afa 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Hash = hash<iter-key-type<InputIterator>>,
index 9f2bf24..c22f121 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_map>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // template<class InputIterator,
 //          class Hash = hash<iter-key-type<InputIterator>>,
index bf0d970..6e678aa 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 
 // template<class InputIterator,
index a4e5f97..69207c4 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // UNSUPPORTED: apple-clang-9.1
 
 // template<class InputIterator,
index b65ac2c..a0201ff 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
 
 // template<class InputIterator,
index 7af310d..0dd7ba1 100644 (file)
@@ -8,7 +8,6 @@
 
 // <unordered_set>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // UNSUPPORTED: apple-clang-9.1
 
 // template<class InputIterator,
index b7460aa..adb446a 100644 (file)
@@ -8,15 +8,12 @@
 
 // <regex>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
 //    vector(InputIterator, InputIterator, Allocator = Allocator())
 //    -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
 //
 
-
 #include <regex>
 #include <string>
 #include <iterator>
index 1a18dc2..feabcfc 100644 (file)
@@ -8,15 +8,12 @@
 
 // <regex>
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
 
 // template<class ForwardIterator>
 // basic_regex(ForwardIterator, ForwardIterator,
 //             regex_constants::syntax_option_type = regex_constants::ECMAScript)
 // -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
 
-
 #include <regex>
 #include <string>
 #include <iterator>
index a385032..e7dd236 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // <string>
 
index 3292003..4082005 100644 (file)
@@ -8,7 +8,6 @@
 
 // <string>
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
 
 // template<class InputIterator>
 //   basic_string(InputIterator begin, InputIterator end,
@@ -25,7 +24,6 @@
 //  is a type that does not qualify as an input iterator, or if Allocator is a type
 //  that does not qualify as an allocator.
 
-
 #include <string>
 #include <iterator>
 #include <cassert>
index 1fa2ee0..40211cf 100644 (file)
@@ -8,7 +8,6 @@
 
 // <string>
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
 
 // template<class InputIterator>
 //   basic_string(InputIterator begin, InputIterator end,
@@ -24,7 +23,6 @@
 //  The deduction guide shall not participate in overload resolution if Allocator
 //  is a type that does not qualify as an allocator.
 
-
 #include <string>
 #include <string_view>
 #include <iterator>
index e6dc0a7..46b3b8f 100644 (file)
@@ -8,7 +8,6 @@
 
 // <string>
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
 
 // template<class InputIterator>
 //   basic_string(InputIterator begin, InputIterator end,
@@ -24,7 +23,6 @@
 //  The deduction guide shall not participate in overload resolution if Allocator
 //  is a type that does not qualify as an allocator.
 
-
 #include <string>
 #include <string_view>
 #include <iterator>
index 07c9002..7e087fe 100644 (file)
@@ -8,7 +8,6 @@
 
 // <string>
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
 
 // template<class InputIterator>
 //   basic_string(InputIterator begin, InputIterator end,
@@ -30,7 +29,6 @@
 //  The deduction guide shall not participate in overload resolution if Allocator
 //  is a type that does not qualify as an allocator.
 
-
 #include <string>
 #include <string_view>
 #include <iterator>
index fae3b47..69e94ad 100644 (file)
@@ -8,7 +8,6 @@
 
 // <string>
 // UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
 
 // template<class InputIterator>
 //   basic_string(InputIterator begin, InputIterator end,
@@ -30,7 +29,6 @@
 //  The deduction guide shall not participate in overload resolution if Allocator
 //  is a type that does not qualify as an allocator.
 
-
 #include <string>
 #include <string_view>
 #include <iterator>
index d17ece6..8e1ff27 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // <string_view>
 
index 5dcecd3..ddcc080 100644 (file)
@@ -40,7 +40,7 @@ int main(int, char**) {
   m.lock();
   m.unlock();
 
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
   std::lock_guard lg(m);
   static_assert((std::is_same<decltype(lg), std::lock_guard<decltype(m)>>::value), "" );
 #endif
index d09cde0..9eba9cd 100644 (file)
@@ -99,7 +99,7 @@ int main(int, char**)
         q.join();
     }
 
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
     std::shared_lock sl(m);
     static_assert((std::is_same<decltype(sl), std::shared_lock<decltype(m)>>::value), "" );
 #endif
index bd25d02..0c3e5e5 100644 (file)
@@ -55,7 +55,7 @@ int main(int, char**)
     m.unlock();
     t.join();
 
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
     std::unique_lock ul(m);
     static_assert((std::is_same<decltype(ul), std::unique_lock<decltype(m)>>::value), "" );
 #endif
index 7c80662..cc20a01 100644 (file)
@@ -13,7 +13,6 @@
 // function(F) -> function<see-below>;
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // The deduction guides for std::function do not handle rvalue-ref qualified
 // call operators and C-style variadics. It also doesn't deduce from nullptr_t.
@@ -22,7 +21,6 @@
 #include <functional>
 #include <type_traits>
 
-
 struct R { };
 struct f0 { R operator()() && { return {}; } };
 struct f1 { R operator()(int, ...) { return {}; } };
index 793673d..00d1831 100644 (file)
@@ -13,7 +13,6 @@
 // function(F) -> function<see-below>;
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 #include <functional>
 #include <type_traits>
@@ -21,7 +20,6 @@
 
 #include "test_macros.h"
 
-
 struct R { };
 struct A1 { };
 struct A2 { };
index edd4322..cc61a75 100644 (file)
 // function(R(*)(Args...)) -> function<R(Args...)>;
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 #include <functional>
 #include <type_traits>
 
 #include "test_macros.h"
 
-
 struct R { };
 struct A1 { };
 struct A2 { };
index 4e197e8..56a226d 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // <functional>
 
index d8ad182..01fe619 100644 (file)
@@ -18,6 +18,8 @@
 #include <functional>
 #include <cassert>
 
+#include "test_macros.h"
+
 struct convertible_to_int_ref {
     int val = 0;
     operator int&() { return val; }
@@ -68,7 +70,7 @@ int main()
     (true) ? purr() : 0;
     }
 
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
     {
     int i = 0;
     std::reference_wrapper ri(i);
index 3c051eb..95e7048 100644 (file)
@@ -9,15 +9,12 @@
 // <optional>
 // UNSUPPORTED: c++03, c++11, c++14
 // UNSUPPORTED: clang-5
-// UNSUPPORTED: libcpp-no-deduction-guides
 // Clang 5 will generate bad implicit deduction guides
 //  Specifically, for the copy constructor.
 
-
 // template<class T>
 //   optional(T) -> optional<T>;
 
-
 #include <optional>
 #include <cassert>
 
index b75b155..72f747f 100644 (file)
@@ -9,15 +9,12 @@
 // <optional>
 // UNSUPPORTED: c++03, c++11, c++14
 // UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
 // Clang 5 will generate bad implicit deduction guides
 //  Specifically, for the copy constructor.
 
-
 // template<class T>
 //   optional(T) -> optional<T>;
 
-
 #include <optional>
 #include <cassert>
 
index abec365..623bcb6 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 // UNSUPPORTED: apple-clang-9
 
 // GCC's implementation of class template deduction is still immature and runs
index cd90fd7..3c0a7f1 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
 
 // GCC's implementation of class template deduction is still immature and runs
 // into issues with libc++. However GCC accepts this code when compiling
index 09afe20..205a486 100644 (file)
@@ -37,7 +37,6 @@ DEFAULT_FEATURES = [
   Feature(name='fdelayed-template-parsing',     when=lambda cfg: hasCompileFlag(cfg, '-fdelayed-template-parsing')),
   Feature(name='libcpp-no-if-constexpr',        when=lambda cfg: '__cpp_if_constexpr' not in featureTestMacros(cfg)),
   Feature(name='libcpp-no-structured-bindings', when=lambda cfg: '__cpp_structured_bindings' not in featureTestMacros(cfg)),
-  Feature(name='libcpp-no-deduction-guides',    when=lambda cfg: featureTestMacros(cfg).get('__cpp_deduction_guides', 0) < 201611),
   Feature(name='libcpp-no-concepts',            when=lambda cfg: featureTestMacros(cfg).get('__cpp_concepts', 0) < 201907),
   Feature(name='has-fobjc-arc',                 when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc') and
                                                                  sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.