Skip to content

Commit 0166690

Browse files
committed
[libc++] Remove workarounds for the lack of deduction guides in C++17
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
1 parent 6f6175d commit 0166690

File tree

82 files changed

+36
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+36
-131
lines changed

libcxx/include/__config

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,10 +1350,6 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
13501350
#define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS
13511351
#endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES
13521352

1353-
#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
1354-
#define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
1355-
#endif
1356-
13571353
#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
13581354
#define _LIBCPP_HAS_NO_COROUTINES
13591355
#endif

libcxx/include/__functional/function.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
10451045
#endif // _LIBCPP_NO_RTTI
10461046
};
10471047

1048-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
1048+
#if _LIBCPP_STD_VER >= 17
10491049
template<class _Rp, class ..._Ap>
10501050
function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
10511051

@@ -1090,7 +1090,7 @@ struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { usin
10901090

10911091
template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
10921092
function(_Fp) -> function<_Stripped>;
1093-
#endif // !_LIBCPP_HAS_NO_DEDUCTION_GUIDES
1093+
#endif // _LIBCPP_STD_VER >= 17
10941094

10951095
template<class _Rp, class ..._ArgTypes>
10961096
function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}

libcxx/include/__functional/reference_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class _LIBCPP_TEMPLATE_VIS reference_wrapper
176176
#endif // _LIBCPP_CXX03_LANG
177177
};
178178

179-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
179+
#if _LIBCPP_STD_VER >= 17
180180
template <class _Tp>
181181
reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
182182
#endif

libcxx/include/__iterator/iterator_traits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ struct __is_exactly_cpp17_input_iterator
477477
__has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
478478
!__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
479479

480-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
480+
#if _LIBCPP_STD_VER >= 17
481481
template<class _InputIterator>
482482
using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
483483

@@ -491,7 +491,7 @@ template<class _InputIterator>
491491
using __iter_to_alloc_type = pair<
492492
add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>,
493493
typename iterator_traits<_InputIterator>::value_type::second_type>;
494-
#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
494+
#endif // _LIBCPP_STD_VER >= 17
495495

496496
_LIBCPP_END_NAMESPACE_STD
497497

libcxx/include/__memory/shared_ptr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
686686
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
687687
};
688688

689-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
689+
#if _LIBCPP_STD_VER >= 17
690690
template<class _Tp>
691691
shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
692692
template<class _Tp, class _Dp>
@@ -1406,7 +1406,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
14061406
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
14071407
};
14081408

1409-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
1409+
#if _LIBCPP_STD_VER >= 17
14101410
template<class _Tp>
14111411
weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
14121412
#endif

libcxx/include/__utility/pair.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,10 @@ struct _LIBCPP_TEMPLATE_VIS pair
310310
#endif
311311
};
312312

313-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
313+
#if _LIBCPP_STD_VER >= 17
314314
template<class _T1, class _T2>
315315
pair(_T1, _T2) -> pair<_T1, _T2>;
316-
#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
316+
#endif
317317

318318
template <class _T1, class _T2>
319319
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11

libcxx/include/array

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
356356
};
357357

358358

359-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
359+
#if _LIBCPP_STD_VER >= 17
360360
template<class _Tp, class... _Args,
361361
class = _EnableIf<__all<_IsSame<_Tp, _Args>::value...>::value>
362362
>

libcxx/include/deque

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ public:
15881588
void __move_assign(deque& __c, false_type);
15891589
};
15901590

1591-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
1591+
#if _LIBCPP_STD_VER >= 17
15921592
template<class _InputIterator,
15931593
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
15941594
class = _EnableIf<__is_allocator<_Alloc>::value>

libcxx/include/forward_list

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ private:
870870
};
871871

872872

873-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
873+
#if _LIBCPP_STD_VER >= 17
874874
template<class _InputIterator,
875875
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
876876
class = _EnableIf<__is_allocator<_Alloc>::value>

libcxx/include/list

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ private:
11411141
void __move_assign(list& __c, false_type);
11421142
};
11431143

1144-
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
1144+
#if _LIBCPP_STD_VER >= 17
11451145
template<class _InputIterator,
11461146
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
11471147
class = _EnableIf<__is_allocator<_Alloc>::value>

0 commit comments

Comments
 (0)