forked from swig/swig
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
As noted in the code for #183 , virtual single inheritance is broken:
class A {
public:
virtual int foo() { return 1; }
};
class B : virtual public A {
};
If you create a class(B) :: b
and call b%foo()
, the proxy code for A%foo
will be passed a pointer B*
. However, the _swig_A_foo
wrapper reinterpret-casts the pointer as A*
. This is fine for regular classes where A*
and B*
have the same address, but not fine for virtual classes where the pointers have to be offset. Not sure what the right approach here is...