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
parent f8425a6e6d
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()
{
}
};
%}

View File

@ -42,6 +42,7 @@ DYNAMIC_LIB_PATH = $(RUNTIMEDIR):.
# Broken C++ test cases. (Can be run individually using make testcase.cpptest.)
CPP_TEST_BROKEN += \
abstract_virtual \
abstract_typedef2 \
cast_operator \
arrayref \

View File

@ -0,0 +1,6 @@
from abstract_virtual import *
d = D()
e = E()