public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "d dot frey at gmx dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/42593] New: [c++0x] std::bind not assignable to std::function Date: Sun, 03 Jan 2010 12:37:00 -0000 [thread overview] Message-ID: <bug-42593-3237@http.gcc.gnu.org/bugzilla/> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 4368 bytes --] 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 <functional> 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<void(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Functor = std::_Bind<void (*(std::_Placeholder<1>))(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<void (*(std::_Placeholder<1>))(int)>, _Res = void, _ArgTypes = {int}, typename __gnu_cxx::__enable_if<(! std::is_integral<_Functor>::value), std::function<_Res(_ArgTypes ...)>::_Useless>::__type = std::function<void(int)>::_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<void (*(std::_Placeholder<1>))(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<std::_Mu<_Bound_args>(_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<std::_Mu<_Bound_args>(_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<const _Functor(typename std::result_of<std::_Mu<_Bound_args>(_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<const _Functor(typename std::result_of<std::_Mu<_Bound_args>(_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<volatile _Functor(typename std::result_of<std::_Mu<_Bound_args>(_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<volatile _Functor(typename std::result_of<std::_Mu<_Bound_args>(_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<const volatile _Functor(typename std::result_of<std::_Mu<_Bound_args>(_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<const volatile _Functor(typename std::result_of<std::_Mu<_Bound_args>(_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
next reply other threads:[~2010-01-03 12:37 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-01-03 12:37 d dot frey at gmx dot de [this message] 2010-01-03 12:47 ` [Bug libstdc++/42593] [c++0x] [4.5 Regression] " paolo dot carlini at oracle dot com 2010-01-03 14:13 ` redi at gcc dot gnu dot org 2010-01-03 14:26 ` paolo dot carlini at oracle dot com 2010-01-03 15:07 ` redi at gcc dot gnu dot org 2010-01-03 15:11 ` paolo dot carlini at oracle dot com 2010-01-03 16:03 ` paolo dot carlini at oracle dot com 2010-01-03 16:28 ` redi at gcc dot gnu dot org 2010-01-03 16:34 ` paolo dot carlini at oracle dot com 2010-01-03 17:57 ` redi at gcc dot gnu dot org 2010-01-03 18:05 ` paolo dot carlini at oracle dot com 2010-01-03 18:07 ` redi at gcc dot gnu dot org 2010-01-03 20:58 ` paolo dot carlini at oracle dot com 2010-01-03 21:03 ` paolo dot carlini at oracle dot com 2010-01-03 22:10 ` redi at gcc dot gnu dot org 2010-01-04 10:30 ` paolo dot carlini at oracle dot com 2010-01-10 13:46 ` paolo dot carlini at oracle dot com 2010-01-10 16:26 ` redi at gcc dot gnu dot org 2010-01-12 0:54 ` redi at gcc dot gnu dot org 2010-01-12 0:55 ` redi at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-42593-3237@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).