id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 925,export inhereted method under gcc fails,andreitd,david_abrahams,"{{{ When I try to export a method inhereted from some base class, I get compilation errors unless I also export the base class. I've got a feeling it's compiler bug (gcc 2.96), but I am not entirely sure. .................................... class Base { public: int f(int i) { return -i; } }; class Derived : public Base { }; BOOST_PYTHON_MODULE_INIT(ex_pmf_ext) { try { python::module_builder this_module(""ex_pmf_ext""); python::class_builder derived_class(this_module, ""Derived""); derived_class.def(python::constructor<>()); derived_class.def(&Derived::f, ""f""); } catch(...) { python::handle_exception(); } } ....................... The compiler says it can't find 'from_python()' function for 'Base' class. The error message also shows that the compiler sees '&Base::f' pointer-to-member instead of '&Derived::f'. That silent conversion seems to be a primary cause of the entire problem. ...instantiated from `boost::python::detail::wrapped_function_pointer::do_call (PyObject *, PyObject *) const [with R = int, F = int ({unnamed}::Base::*) (int)]'... If I add ... python::class_builder base_class(this_module, ""Base""); derived_class.declare_base(base_class,python::without_downcast); ... then everything works. However, it's obviously a nuisance since the entire class hierarchy may be quite convoluted or undocumented in general case (inhereted from vendor-supplied library, for instance), and I only care about using this method through my 'Derived' class, not the 'Base' class directly. Is this a bug in the compiler (it does not have the right to replace &Derived::f with &Base::f, does it)? Of cause, I can define and export functions like int f(Derived *self,int i) { return self->f(i); } }}}",Bugs,closed,,python USE GITHUB,None,,None,,