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@4378 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6a3eb88852
commit
baba2c6b31
3 changed files with 60 additions and 0 deletions
53
SWIG/Examples/test-suite/abstract_virtual.i
Normal file
53
SWIG/Examples/test-suite/abstract_virtual.i
Normal 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()
|
||||
{
|
||||
}
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
from abstract_virtual import *
|
||||
|
||||
|
||||
d = D()
|
||||
|
||||
e = E()
|
||||
Loading…
Add table
Add a link
Reference in a new issue