diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2011-05-23 00:05:24 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-05-23 00:05:24 +0000 |
commit | 4702f095fa6a0e4a76f0fff61b1693fde6db9eaa (patch) | |
tree | 1d62082ba3adf689c24eec5ec21b2555eb5f0c96 /libstdc++-v3/include/std | |
parent | 29cedf8ef3b3fd547d778738157a6bdbc3a7b78a (diff) | |
download | gcc-4702f095fa6a0e4a76f0fff61b1693fde6db9eaa.zip gcc-4702f095fa6a0e4a76f0fff61b1693fde6db9eaa.tar.gz gcc-4702f095fa6a0e4a76f0fff61b1693fde6db9eaa.tar.bz2 |
[multiple changes]
2011-05-22 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/20_util/bind/cv_quals_2.cc: New.
2011-05-22 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/49058
* include/std/functional (_Bind<_Functor(_Bound_args...)>::
operator()(_Args&&...)): Don't cv qualify _Functor directly
in the default template argument, SFINAE doesn't apply when
the functor has no arguments.
* testsuite/20_util/bind/49058_1.cc: New.
* testsuite/20_util/bind/49058_2.cc: Likewise.
From-SVN: r174048
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r-- | libstdc++-v3/include/std/functional | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 40cf870..0126510 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -1210,7 +1210,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) // Call as const template<typename... _Args, typename _Result - = decltype( std::declval<const _Functor>()( + = decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0), + typename add_const<_Functor>::type>::type>()( _Mu<_Bound_args>()( std::declval<const _Bound_args&>(), std::declval<tuple<_Args...>&>() )... ) )> _Result @@ -1223,7 +1224,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) // Call as volatile template<typename... _Args, typename _Result - = decltype( std::declval<volatile _Functor>()( + = decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0), + typename add_volatile<_Functor>::type>::type>()( _Mu<_Bound_args>()( std::declval<volatile _Bound_args&>(), std::declval<tuple<_Args...>&>() )... ) )> _Result @@ -1236,7 +1238,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) // Call as const volatile template<typename... _Args, typename _Result - = decltype( std::declval<const volatile _Functor>()( + = decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0), + typename add_cv<_Functor>::type>::type>()( _Mu<_Bound_args>()( std::declval<const volatile _Bound_args&>(), std::declval<tuple<_Args...>&>() )... ) )> _Result |