From 1f6fd64fe9c996b4795ee4a6c66b8f9216747560 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 20 Nov 2021 18:39:12 +0100 Subject: Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-10223-g401b76fdf2b3. PR: 261742 MFC after: 2 weeks (cherry picked from commit 5e801ac66d24704442eba426ed13c3effb8a34e7) --- contrib/llvm-project/libcxx/include/__algorithm/max.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib/llvm-project/libcxx/include/__algorithm/max.h') diff --git a/contrib/llvm-project/libcxx/include/__algorithm/max.h b/contrib/llvm-project/libcxx/include/__algorithm/max.h index 2fa97cad87f6..79cbd2be86b6 100644 --- a/contrib/llvm-project/libcxx/include/__algorithm/max.h +++ b/contrib/llvm-project/libcxx/include/__algorithm/max.h @@ -11,6 +11,7 @@ #include <__config> #include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> #include <__algorithm/max_element.h> #include @@ -49,7 +50,8 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp max(initializer_list<_Tp> __t, _Compare __comp) { - return *_VSTD::max_element(__t.begin(), __t.end(), __comp); + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return *_VSTD::__max_element<_Comp_ref>(__t.begin(), __t.end(), __comp); } template -- cgit v1.2.3