aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libstdc++-v3/include/std/functional
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-05-17 17:03:43 -0700
committerBen Cheng <bccheng@google.com>2014-05-17 17:12:35 -0700
commit8c493ead6366b552adee796de296936b78f34c5a (patch)
tree4936e52fb9b84edbcd9293bd321027413d1835bf /gcc-4.9/libstdc++-v3/include/std/functional
parent9750bde7e561731ce8a07cdbd0165a688e74a696 (diff)
downloadtoolchain_gcc-8c493ead6366b552adee796de296936b78f34c5a.tar.gz
toolchain_gcc-8c493ead6366b552adee796de296936b78f34c5a.tar.bz2
toolchain_gcc-8c493ead6366b552adee796de296936b78f34c5a.zip
[4.9] Refresh GCC 4.9 to the 20140514 snapshot.
For critical bug fixes including devirtualization and codegen. Change-Id: I8138d3dc408fc12db5eecb01d2753d39219712f2
Diffstat (limited to 'gcc-4.9/libstdc++-v3/include/std/functional')
-rw-r--r--gcc-4.9/libstdc++-v3/include/std/functional11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc-4.9/libstdc++-v3/include/std/functional b/gcc-4.9/libstdc++-v3/include/std/functional
index 5a987d914..0e80fa37c 100644
--- a/gcc-4.9/libstdc++-v3/include/std/functional
+++ b/gcc-4.9/libstdc++-v3/include/std/functional
@@ -2149,8 +2149,15 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
using _Invoke = decltype(__callable_functor(std::declval<_Functor&>())
(std::declval<_ArgTypes>()...) );
+ // Used so the return type convertibility checks aren't done when
+ // performing overload resolution for copy construction/assignment.
+ template<typename _Tp>
+ using _NotSelf = __not_<is_same<_Tp, function>>;
+
template<typename _Functor>
- using _Callable = __check_func_return_type<_Invoke<_Functor>, _Res>;
+ using _Callable
+ = __and_<_NotSelf<_Functor>,
+ __check_func_return_type<_Invoke<_Functor>, _Res>>;
template<typename _Cond, typename _Tp>
using _Requires = typename enable_if<_Cond::value, _Tp>::type;
@@ -2291,7 +2298,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* reference_wrapper<F>, this function will not throw.
*/
template<typename _Functor>
- _Requires<_Callable<_Functor>, function&>
+ _Requires<_Callable<typename decay<_Functor>::type>, function&>
operator=(_Functor&& __f)
{
function(std::forward<_Functor>(__f)).swap(*this);