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...
As noted in the code for #183 , virtual single inheritance is broken:
If you create a
class(B) :: b
and callb%foo()
, the proxy code forA%foo
will be passed a pointerB*
. However, the_swig_A_foo
wrapper reinterpret-casts the pointer asA*
. This is fine for regular classes whereA*
andB*
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...