From fe013be447cd855ccaf6094a1d06aea570450629 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Sep 2023 23:17:18 +0200 Subject: Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. PR: 273753 MFC after: 1 month (cherry picked from commit 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e) --- .../llvm-project/libcxx/include/__algorithm/search.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'contrib/llvm-project/libcxx/include/__algorithm/search.h') diff --git a/contrib/llvm-project/libcxx/include/__algorithm/search.h b/contrib/llvm-project/libcxx/include/__algorithm/search.h index 93771be39e35..5882a04808ba 100644 --- a/contrib/llvm-project/libcxx/include/__algorithm/search.h +++ b/contrib/llvm-project/libcxx/include/__algorithm/search.h @@ -14,12 +14,13 @@ #include <__algorithm/iterator_operations.h> #include <__config> #include <__functional/identity.h> +#include <__functional/invoke.h> #include <__iterator/advance.h> #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> +#include <__type_traits/enable_if.h> #include <__type_traits/is_callable.h> #include <__utility/pair.h> -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -126,8 +127,8 @@ pair<_Iter1, _Iter1> __search_impl(_Iter1 __first1, _Sent1 __last1, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2, - __enable_if_t<__is_cpp17_random_access_iterator<_Iter1>::value - && __is_cpp17_random_access_iterator<_Iter2>::value>* = nullptr) { + __enable_if_t<__has_random_access_iterator_category<_Iter1>::value + && __has_random_access_iterator_category<_Iter2>::value>* = nullptr) { auto __size2 = __last2 - __first2; if (__size2 == 0) @@ -158,10 +159,10 @@ pair<_Iter1, _Iter1> __search_impl(_Iter1 __first1, _Sent1 __last1, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2, - __enable_if_t<__is_cpp17_forward_iterator<_Iter1>::value - && __is_cpp17_forward_iterator<_Iter2>::value - && !(__is_cpp17_random_access_iterator<_Iter1>::value - && __is_cpp17_random_access_iterator<_Iter2>::value)>* = nullptr) { + __enable_if_t<__has_forward_iterator_category<_Iter1>::value + && __has_forward_iterator_category<_Iter2>::value + && !(__has_random_access_iterator_category<_Iter1>::value + && __has_random_access_iterator_category<_Iter2>::value)>* = nullptr) { return std::__search_forward_impl<_ClassicAlgPolicy>(__first1, __last1, __first2, __last2, __pred, @@ -187,7 +188,7 @@ _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, return std::search(__first1, __last1, __first2, __last2, __equal_to()); } -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) { -- cgit v1.2.3