From: Jonathan Wakely Date: Mon, 17 Oct 2016 12:23:09 +0000 (+0100) Subject: PR77998 Remove std::thread::_Invoker::result_type X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2284544a152bbe3c03408fa63acba7d9d55a9e5;p=gcc.git PR77998 Remove std::thread::_Invoker::result_type PR libstdc++/77998 * include/std/future (__future_base::_Deferred_state) (__future_base::_Async_state_impl): Use decltype to deduce return type, instead of _Invoker::result_type. * include/std/thread (thread::_Invoker::operator()): Likewise. (thread::_Invoker::result_type): Remove. From-SVN: r241236 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ed572815d64..31280a36acf 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2016-10-17 Jonathan Wakely + PR libstdc++/77998 + * include/std/future (__future_base::_Deferred_state) + (__future_base::_Async_state_impl): Use decltype to deduce return + type, instead of _Invoker::result_type. + * include/std/thread (thread::_Invoker::operator()): Likewise. + (thread::_Invoker::result_type): Remove. + PR libstdc++/77987 * include/bits/unique_ptr.h (unique_ptr::reset(U)): Copy value to pointer of the correct type to swap, to support conversions diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index 31a21f976ee..5542d49584f 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -561,10 +561,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION class _Async_state_commonV2; #endif - template + template()())> class _Deferred_state; - template + template()())> class _Async_state_impl; template diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index 7a3c4078cc1..576e5776e6e 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -235,14 +235,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using _Indices = typename _Build_index_tuple::value>::__type; - using result_type - = decltype(std::declval<_Invoker>()._M_invoke(_Indices())); - - result_type + auto operator()() - noexcept(noexcept(std::declval<_Invoker>()._M_invoke(_Indices()))) + noexcept(noexcept(std::declval<_Invoker&>()._M_invoke(_Indices()))) + -> decltype(std::declval<_Invoker&>()._M_invoke(_Indices())) { return _M_invoke(_Indices()); } - }; // Alias for _Invoker>