Test for patch #1116431 Fix non member functions inadvertently being called instead of member functions.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7499 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-09-23 21:20:27 +00:00
commit db84d961e3
3 changed files with 29 additions and 0 deletions

View file

@ -147,6 +147,7 @@ CPP_TEST_CASES += \
grouping \
ignore_parameter \
import_nomodule \
inherit \
inherit_missing \
inherit_same_name \
inherit_void_arg \

View file

@ -0,0 +1,19 @@
// Test that was failing for Perl - the non-member Foo was being called when the member version was intended
%module inherit
%inline %{
const char* Foo(void) {
return "Non-member Foo";
}
class CBase {
public:
const char* Foo(void) {
return "CBase::Foo";
}
};
class CDerived : public CBase {};
%}

View file

@ -0,0 +1,9 @@
use inherit;
$der = new inherit::CDerived();
$str = $der->Foo();
if ($str != "CBase::Foo") {
die "test failed";
}