Re: [pygccxml-development] Implicit virtual functions in derived classes
Brought to you by:
mbaas,
roman_yakovenko
|
From: Julian S. <jul...@rs...> - 2008-02-16 05:44:55
|
Julian Scheid wrote:
> funcs.update( base_cls.member_functions( query | (all_virtual &
> declarations.custom_matcher_t( lambda decl: decl.parent.alias ==
> base_cls.alias and not decl.has_static and not decl.ignore and
> decl.exportable), allow_empty=True ) )
I found one more issue with my fix and I think your patch suffers from
the same problem. Consider this situation:
class A
{
public:
virtual void foo() {}
};
class B: public A
{
public:
virtual void foo() {}
};
class C: public B
{
}
Due to the way funcs.update works (?) this will put A.foo into "funcs"
instead of B.foo when generating the wrapper for C. This in turn will
lead to the following wrapper code for class C to be generated:
virtual void foo( ) {
if( bp::override func_foo = this->get_override( "foo" ) ) {
func_foo( );
} else
this->A::foo( );
}
Note it generates "this->A::foo" in the end where it actually should
invoke this->B:foo.
I haven't yet found a solution, simply reversing the base class list
used in the outer for loop doesn't seem to be enough.
Julian
|