Fix typemap method hiding regression introduced in swig-2.0.5 - rev 12764

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13071 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-05-11 21:23:37 +00:00
commit ef7a8a8253
5 changed files with 73 additions and 12 deletions

View file

@ -430,6 +430,7 @@ CPP_TEST_CASES += \
typemap_ns_using \
typemap_numinputs \
typemap_template \
typemap_template_parm_typedef \
typemap_out_optimal \
typemap_qualifier_strip \
typemap_variables \

View file

@ -0,0 +1,48 @@
%module typemap_template_parm_typedef
%typemap(in) SWIGTYPE " _in_will_not_compile_ "
%typemap(in) SWIGTYPE * " _in_will_not_compile_ "
%typemap(out) SWIGTYPE " _out_will_not_compile_ "
%typemap(out) SWIGTYPE * " _out_will_not_compile_ "
%{
#include <vector>
#include <list>
#include <deque>
namespace jada {
typedef unsigned int uint;
void test_no_typedef(std::list<unsigned int> bada) {}
void test_typedef(std::vector<uint> bada) {}
std::deque<unsigned int> no_typedef_out() {}
}
%}
%typemap(in) std::list<unsigned int> (std::list<unsigned int> tmp) {
$1 = tmp;
}
%typemap(in) std::vector<unsigned int> (std::vector<unsigned int> tmp) {
$1 = tmp;
}
%typemap(out) std::list<unsigned int> {
}
// The presennce of this 'out' typemap was hiding the std::vector<unsigned int> 'in' typemap in swig-2.0.5 and swig-2.0.6
%typemap(out) std::vector<jada::uint> {
}
// This typemap was not used for no_typedef_out in 2.0.4 and earlier
%typemap(out) std::deque<jada::uint> {
$result = 0;
}
namespace jada {
typedef unsigned int uint;
void test_no_typedef(std::list<uint> bada);
void test_typedef(std::vector<uint> bada);
std::deque<unsigned int> no_typedef_out();
}