diff --git a/SWIG/Examples/test-suite/common.mk b/SWIG/Examples/test-suite/common.mk index 7b4381ec5..2ac4eaa75 100644 --- a/SWIG/Examples/test-suite/common.mk +++ b/SWIG/Examples/test-suite/common.mk @@ -208,6 +208,7 @@ CPP_TEST_CASES += \ template_ns_scope \ template_qualifier \ template_qualifier \ + template_ref_type \ template_rename \ template_retvalue \ template_specialization \ diff --git a/SWIG/Examples/test-suite/perl5/template_ref_type_runme.pl b/SWIG/Examples/test-suite/perl5/template_ref_type_runme.pl new file mode 100644 index 000000000..ba6e2b901 --- /dev/null +++ b/SWIG/Examples/test-suite/perl5/template_ref_type_runme.pl @@ -0,0 +1,6 @@ +use template_ref_type; + +my $xr = template_ref_type::XC->new(); +my $y = template_ref_type::Y->new(); + +$y->find($xr); diff --git a/SWIG/Examples/test-suite/python/template_ref_type_runme.py b/SWIG/Examples/test-suite/python/template_ref_type_runme.py new file mode 100644 index 000000000..0b3e4dd26 --- /dev/null +++ b/SWIG/Examples/test-suite/python/template_ref_type_runme.py @@ -0,0 +1,5 @@ +import template_ref_type + +xr = template_ref_type.XC() +y = template_ref_type.Y() +y.find(xr) diff --git a/SWIG/Examples/test-suite/template_ref_type.i b/SWIG/Examples/test-suite/template_ref_type.i new file mode 100644 index 000000000..a41d006ef --- /dev/null +++ b/SWIG/Examples/test-suite/template_ref_type.i @@ -0,0 +1,27 @@ +%module template_ref_type + +%inline %{ +class X { +public: + unsigned _i; +}; + +template class Container { +public: + Container () {} + bool reset () { return false ;} +}; + +typedef Container XC; +%} + +%template(XC) Container; + +%inline %{ +class Y { +public: + Y () {}; + bool find (XC &) { return false; } +}; +%} +