Fix %template seg fault on some cases of overloading the templated method.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-08-15 10:40:19 +00:00
commit d74b680a79
4 changed files with 34 additions and 1 deletions

View file

@ -5,6 +5,8 @@
%warnfilter(SWIGWARN_LANG_TEMPLATE_METHOD_IGNORE) convolve1<float>();
%warnfilter(SWIGWARN_LANG_TEMPLATE_METHOD_IGNORE) convolve3<float>();
%include <std_string.i>
///////////////////
%ignore convolve1<float>(float a);
@ -76,3 +78,23 @@ struct Klass {
%template(KlassTMethodBool) Klass::tmethod<bool>;
%template(KlassStaticTMethodBool) Klass::statictmethod<bool>;
////////////////////////////////////////////////////////////////////////////
%inline %{
class ComponentProperties{
public:
ComponentProperties() {}
~ComponentProperties() {}
template <typename T1> void adda(std::string key, T1 val) {}
template <typename T1, typename T2> void adda(std::string key1, T1 val1, std::string key2, T2 val2) {}
template <typename T1, typename T2, typename T3> void adda(std::string key1, T1 val1, std::string key2, T2 val2, std::string key3, T3 val3) {}
};
%}
%extend ComponentProperties {
%template(adda) adda<std::string, double>;
%template(adda) adda<std::string, std::string, std::string>; // ERROR OCCURS HERE
%template(adda) adda<int, int, int>;
}