From dc8c996eda80430f00b4d7ceb51805712c6993a6 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 31 Oct 2016 18:37:44 +0000 Subject: Pull in r228705 from upstream libc++ trunk (by Eric Fiselier): [libcxx] Fix PR 22468 - std::function does not accept non-void-returning functions Summary: The bug can be found here: https://llvm.org/bugs/show_bug.cgi?id=22468 `__invoke_void_return_wrapper` is needed to properly handle calling a function that returns a value but where the std::function return type is void. Without this '-Wsystem-headers' will cause `function::operator()(...)` to not compile. Reviewers: eugenis, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D7444 This should allow newer versions of the graphics/aseprite port to compile without modification. Direct commit to stable/10, since stable/11 and head already have this change. Reported by: yuri@rawbw.com PR: 213773 --- contrib/libc++/include/functional | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'contrib/libc++/include/functional') diff --git a/contrib/libc++/include/functional b/contrib/libc++/include/functional index d14b46b..36d422c 100644 --- a/contrib/libc++/include/functional +++ b/contrib/libc++/include/functional @@ -1367,7 +1367,8 @@ template _Rp __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) { - return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...); + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...); } #ifndef _LIBCPP_NO_RTTI @@ -1429,7 +1430,7 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_ArgTypes...)> template struct __callable<_Fp, true> { - static const bool value = + static const bool value = is_same::value || is_convertible::type, _Rp>::value; }; -- cgit v1.1