This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17501] New: Failing to compile code using boost bind/signal
- From: "larsbj at gullik dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2004 15:04:57 -0000
- Subject: [Bug c++/17501] New: Failing to compile code using boost bind/signal
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code compiles with gcc 3.3.3 (RH Fedorea core 2 release), and also
used to compile with gcc 3.4.x before 3.4.2 was released. Currently both gcc
3.4.3 and gcc 4.0.0 fail to compile this.
This is with boost 1.31.0.
Code:
#include <boost/bind.hpp>
#include <boost/signals/signal0.hpp>
class Bar {
public:
static Bar const & cref() { static Bar bar; return bar; };
void update() const;
};
typedef boost::signal0<void>::slot_type slot_type;
boost::signals::connection connect(slot_type const &);
void foo()
{
connect(boost::bind(&Bar::update, boost::cref(Bar::cref())));
}
I compile with:
g++ --save-temps -I../../boost -c test.C -o test.o
Error message:
../../boost/boost/signals/slot.hpp: In constructor
`boost::slot<SlotFunction>::slot(const F&) [with F = boost::_bi::bind_t<void,
boost::_mfi::cmf0<void, Bar>, boost::_bi::list1<boost::reference_wrapper<const
Bar> > >, SlotFunction = boost::function0<void,
std::allocator<boost::function_base> >]':
test.C:17: instantiated from here
../../boost/boost/signals/slot.hpp:108: error: no matching function for call to
`get_inspectable_slot(const boost::_bi::bind_t<void, boost::_mfi::cmf0<void,
Bar>, boost::_bi::list1<boost::reference_wrapper<const Bar> > >&,
boost::signals::detail::reference_tag)'
../../boost/boost/signals/slot.hpp:71: note: candidates are: const F&
boost::signals::get_inspectable_slot(const F&,
boost::signals::detail::signal_tag) [with F = boost::_bi::bind_t<void,
boost::_mfi::cmf0<void, Bar>, boost::_bi::list1<boost::reference_wrapper<const
Bar> > >]
../../boost/boost/signals/slot.hpp:81: note: const F&
boost::signals::get_inspectable_slot(const F&,
boost::signals::detail::value_tag) [with F = boost::_bi::bind_t<void,
boost::_mfi::cmf0<void, Bar>, boost::_bi::list1<boost::reference_wrapper<const
Bar> > >]
g++ --version
g++ (GCC) 4.0.0 20040914 (experimental)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Please tell if preprocessed source is needed.
--
Summary: Failing to compile code using boost bind/signal
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: larsbj at gullik dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17501