From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10600 invoked by alias); 3 Jan 2010 12:37:49 -0000 Received: (qmail 10574 invoked by uid 48); 3 Jan 2010 12:37:39 -0000 Date: Sun, 03 Jan 2010 12:37:00 -0000 Subject: [Bug libstdc++/42593] New: [c++0x] std::bind not assignable to std::function X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "d dot frey at gmx dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg00257.txt.bz2 The following code compiles fine with GCC 4.3.3 and 4.4.2, but fails to compile with 4.5 (snapshot from 2009-12-31): #include void f( int ) {} int main() { std::function< void( int ) > pf = std::bind( &f, std::placeholders::_1 ); } with the following error: In file included from t.cc:1:0: /home/frey/work/install/gcc-4.5-snapshot/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/functional: In static member function ‘static void std::_Function_handler::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Functor = std::_Bind))(int)>, _ArgTypes = {int}]’: /home/frey/work/install/gcc-4.5-snapshot/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/functional:2127:6: instantiated from ‘std::function<_Res(_ArgTypes ...)>::function(_Functor, typename __gnu_cxx::__enable_if<(! std::is_integral<_Functor>::value), std::function<_Res(_ArgTypes ...)>::_Useless>::__type) [with _Functor = std::_Bind))(int)>, _Res = void, _ArgTypes = {int}, typename __gnu_cxx::__enable_if<(! std::is_integral<_Functor>::value), std::function<_Res(_ArgTypes ...)>::_Useless>::__type = std::function::_Useless]’ t.cc:3:85: instantiated from here /home/frey/work/install/gcc-4.5-snapshot/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/functional:1748:9: error: no match for call to ‘(std::_Bind))(int)>) (int)’ /home/frey/work/install/gcc-4.5-snapshot/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/functional:1219:9: note: candidates are: typename std::result_of<_Functor(typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) [with _Args = {int}, _Functor = void (*)(int), _Bound_args = {std::_Placeholder<1>}, typename std::result_of<_Functor(typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type = void] /home/frey/work/install/gcc-4.5-snapshot/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/functional:1230:9: note: typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) const [with _Args = {int}, _Functor = void (*)(int), _Bound_args = {std::_Placeholder<1>}, typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type = void] /home/frey/work/install/gcc-4.5-snapshot/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/functional:1242:9: note: typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) volatile [with _Args = {int}, _Functor = void (*)(int), _Bound_args = {std::_Placeholder<1>}, typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type = void] /home/frey/work/install/gcc-4.5-snapshot/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/functional:1255:9: note: typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type std::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) const volatile [with _Args = {int}, _Functor = void (*)(int), _Bound_args = {std::_Placeholder<1>}, typename std::result_of(_Bound_args, std::tuple<_UElements ...>)>::type ...)>::type = void] -- Summary: [c++0x] std::bind not assignable to std::function Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: d dot frey at gmx dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42593