This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] libstdc++/59768 Fix std::invoke support for reference_wrappers
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 22 Dec 2015 11:38:09 +0000
- Subject: Re: [patch] libstdc++/59768 Fix std::invoke support for reference_wrappers
- Authentication-results: sourceware.org; auth=none
- References: <20151211214338 dot GI5356 at redhat dot com>
On 11/12/15 21:43 +0000, Jonathan Wakely wrote:
Fix std::invoke support for reference_wrappers
PR libstdc++/59768
* include/std/functional (_Unwrap, __invfwd): Define.
(__invoke_impl): Remove reference_wrapper overloads and use __invfwd.
* include/std/type_traits (__result_of_memobj, __result_of_memfun):
Add partial specializations for const reference_wrappers and simplify.
* testsuite/20_util/bind/ref_neg.cc: Use dg-excess-errors.
* testsuite/20_util/function_objects/invoke/59768.cc: New.
This change was missing an inline specifier on the new __invfwd
function template.
Tested ppc64le-linux, committed to trunk.
commit a8177a9b95226cc5499d32ecee2034640d881f96
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Dec 22 11:20:09 2015 +0000
Add inline to std::__invfwd
PR libstdc++/59768
* include/std/functional (__invfwd): Add inline specifier.
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index b994df4..9b853e8 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -207,7 +207,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Used by __invoke_impl instead of std::forward<_Tp> so that a
// reference_wrapper is converted to an lvalue-reference.
template<typename _Tp>
- typename _Unwrap<_Tp>::type
+ inline typename _Unwrap<_Tp>::type
__invfwd(typename remove_reference<_Tp>::type& __t) noexcept
{ return _Unwrap<_Tp>::_S_fwd(__t); }