swig/Examples/test-suite/abstract_virtual.i
William S Fulton d6b81eb831 Revert rev 11187 "Merged with recent changes from trunk."
This reverts commit c595e4d90ebfd63eb55430c735bb121cf690bd59.

Conflicts:

	Source/Modules/c.cxx

From: William S Fulton <wsf@fultondesigns.co.uk>

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@13033 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-06 01:13:16 +00:00

69 lines
1.2 KiB
OpenEdge ABL

%module(ruby_minherit="1") abstract_virtual
%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
SWIGWARN_D_MULTIPLE_INHERITANCE,
SWIGWARN_PHP_MULTIPLE_INHERITANCE) D; /* C#, D, Java, PHP multiple inheritance */
%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
SWIGWARN_D_MULTIPLE_INHERITANCE,
SWIGWARN_PHP_MULTIPLE_INHERITANCE) E; /* C#, D, Java, PHP multiple inheritance */
%inline %{
#if defined(_MSC_VER)
#pragma warning( disable : 4250) // warning C4250: 'D' : inherits 'B::B::foo' via dominance
#endif
struct A
{
virtual ~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()
{
}
};
%}