Fix typemap matching to expand template parameters when the name contains template parameters.

In the %typemap below the type is T and the name is X<T>::make
which now expands correctly to X< int >::make

template<typename T> struct X {
  %typemap(out) T X<T>::make "..."
  T make();
};

%template(Xint) X<int>;
This commit is contained in:
William S Fulton 2019-02-17 21:35:28 +00:00
commit b9350614b5
5 changed files with 66 additions and 0 deletions

View file

@ -30,8 +30,10 @@ static void add_parms(ParmList *p, List *patchlist, List *typelist) {
while (p) {
SwigType *ty = Getattr(p, "type");
SwigType *val = Getattr(p, "value");
SwigType *name = Getattr(p, "name");
Append(typelist, ty);
Append(typelist, val);
Append(typelist, name);
Append(patchlist, val);
p = nextSibling(p);
}