https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79798

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We need to add && to the arg types in the result_of argument, so that top-level
cv qualifiers aren't lost in the function type that result_of requires us to
use:

--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -502,7 +502,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)

       template<typename _Fn, typename _CallArgs, typename... _BArgs>
        using _Res_type_impl
-         = typename result_of< _Fn&(_Mu_type<_BArgs, _CallArgs>...) >::type;
+         = typename result_of< _Fn&(_Mu_type<_BArgs, _CallArgs>&&...) >::type;

       template<typename _CallArgs>
        using _Res_type = _Res_type_impl<_Functor, _CallArgs, _Bound_args...>;

This would be fixed by adopting the proposed invoke_result and using that
instead of result_of, which we've agreed to deprecate.

Reply via email to