Fixed template argument replacement bug.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4169 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b107a107e6
commit
8c75730cc8
2 changed files with 15 additions and 1 deletions
|
|
@ -243,6 +243,7 @@ Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms) {
|
|||
name = Getattr(tp,"name");
|
||||
value = Getattr(p,"value");
|
||||
tydef = Getattr(p,"typedef");
|
||||
|
||||
if (name) {
|
||||
if (!value) {
|
||||
value = Getattr(p,"type");
|
||||
|
|
@ -270,8 +271,11 @@ Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms) {
|
|||
sz = Len(typelist);
|
||||
for (i = 0; i < sz; i++) {
|
||||
String *s = Getitem(typelist,i);
|
||||
Replace(s,name,value, DOH_REPLACE_ID);
|
||||
/* Replace(s,name,value, DOH_REPLACE_ID); */
|
||||
/* Printf(stdout,"name = '%s', s = '%s' --> ", name, s); */
|
||||
SwigType_typename_replace(s,name,value);
|
||||
SwigType_typename_replace(s,tbase,iname);
|
||||
/* Printf(stdout,"'%s'\n", s); */
|
||||
}
|
||||
|
||||
if (!tydef) {
|
||||
|
|
|
|||
|
|
@ -1567,6 +1567,16 @@ SwigType_typename_replace(SwigType *t, String *pat, String *rep) {
|
|||
Append(e,nt);
|
||||
Delete(nt);
|
||||
}
|
||||
} else if (Swig_scopename_check(e)) {
|
||||
String *first, *rest;
|
||||
first = Swig_scopename_first(e);
|
||||
rest = Swig_scopename_suffix(e);
|
||||
SwigType_typename_replace(rest,pat,rep);
|
||||
SwigType_typename_replace(first,pat,rep);
|
||||
Clear(e);
|
||||
Printf(e,"%s::%s", first,rest);
|
||||
Delete(first);
|
||||
Delete(rest);
|
||||
}
|
||||
} else if (SwigType_isfunction(e)) {
|
||||
int j;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue