Parameter name expansion fix for template functions.

Fix regression in 4.0.0 where a template function containing a parameter
with the same name as the function name led to the parameter name used in the
target language being incorrectly modified.

Closes #1602
This commit is contained in:
William S Fulton 2019-08-01 19:46:16 +01:00
commit 3cc4b21163
3 changed files with 34 additions and 11 deletions

View file

@ -26,3 +26,16 @@ template<typename T> struct X {
%}
%template(Xint) X<int>;
// The function name and parameter name are both 'labels'
%inline %{
template <typename T>
void labels(T labels) {}
void voido(int vooo) {}
%}
// TODO: R has a problem with parameter names clashing with the function name
#if !defined(SWIGR)
%template(ShortLabels) labels<short>;
#endif