Added test that shows a problem in the 'abstract detection method' when virtual base classes are used (in different order)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4378 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2003-02-21 21:03:05 +00:00
commit daa23f01ce
3 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,53 @@
%module abstract_virtual
%inline %{
struct A
{
virtual int foo() = 0;
};
struct B : virtual A
{
int foo()
{
return 0;
}
};
struct C: virtual A
{
protected:
C()
{
}
};
//
// This case works
//
struct D : B, C
{
D()
{
}
};
//
// This case doesn't work.
// It seems the is_abstract function doesn't
// navigate the entire set of base classes,
// and therefore, it doesn't detect B::foo()
//
#ifdef SWIG
// Uncommenting this line, of course, make it works
// %feature("notabstract") E;
#endif
//
struct E : C, B
{
E()
{
}
};
%}