Fix %rename override of wildcard %rename for templates

%rename(GlobalIntOperator) *::operator bool; // wildcard %rename
%rename(XIntOperator) X::operator bool; // fix now overrides first %rename above
OR
%rename(XIntOperator) X<int>::operator bool; // fix now overrides first %rename above

template<typename T> struct X {
  operator bool();
  ...
};
%template(Xint) X<int>;
This commit is contained in:
William S Fulton 2016-11-28 22:44:28 +00:00
commit 7268f58c4c
5 changed files with 257 additions and 1 deletions

View file

@ -404,7 +404,17 @@ DOH *Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType
}
Delete(cls);
}
/* A template-based class lookup, check name first */
/* Lookup a name within a templated-based class */
if (!rn) {
String *t_name = SwigType_istemplate_templateprefix(prefix);
if (t_name) {
Clear(tname);
Printf(tname, "%s::%s", t_name, name);
rn = name_object_get(namehash, tname, decl, ncdecl);
Delete(t_name);
}
}
/* Lookup a template-based name within a class */
if (!rn) {
String *t_name = SwigType_istemplate_templateprefix(name);
if (t_name)