From 846a2208a8ab099f595fe7e8b2e6d54a7b5e67fb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 20 Nov 2021 18:36:30 +0100 Subject: Vendor import of llvm-project main llvmorg-14-init-10223-g401b76fdf2b3. --- libcxx/include/__algorithm/min.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libcxx/include/__algorithm/min.h') diff --git a/libcxx/include/__algorithm/min.h b/libcxx/include/__algorithm/min.h index 9fea7f70a2bb..5cacb2f28e7e 100644 --- a/libcxx/include/__algorithm/min.h +++ b/libcxx/include/__algorithm/min.h @@ -11,6 +11,7 @@ #include <__config> #include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> #include <__algorithm/min_element.h> #include @@ -49,7 +50,8 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp min(initializer_list<_Tp> __t, _Compare __comp) { - return *_VSTD::min_element(__t.begin(), __t.end(), __comp); + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return *_VSTD::__min_element<_Comp_ref>(__t.begin(), __t.end(), __comp); } template -- cgit v1.2.3