Fixed nested namespace resolution problem.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4699 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
75cf98911d
commit
540c265eb4
1 changed files with 23 additions and 3 deletions
|
|
@ -785,12 +785,13 @@ SwigType *SwigType_typedef_qualified(SwigType *t)
|
||||||
String *result;
|
String *result;
|
||||||
int i,len;
|
int i,len;
|
||||||
|
|
||||||
if (!typedef_qualified_cache) typedef_qualified_cache = NewHash();
|
if (!typedef_qualified_cache) typedef_qualified_cache = NewHash();
|
||||||
result = Getattr(typedef_qualified_cache,t);
|
result = Getattr(typedef_qualified_cache,t);
|
||||||
if (result) {
|
if (result) {
|
||||||
String *rc = Copy(result);
|
String *rc = Copy(result);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = NewString("");
|
result = NewString("");
|
||||||
elements = SwigType_split(t);
|
elements = SwigType_split(t);
|
||||||
len = Len(elements);
|
len = Len(elements);
|
||||||
|
|
@ -817,7 +818,6 @@ SwigType *SwigType_typedef_qualified(SwigType *t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (Swig_scopename_check(e)) {
|
if (Swig_scopename_check(e)) {
|
||||||
String *tqname;
|
String *tqname;
|
||||||
String *qlast;
|
String *qlast;
|
||||||
|
|
@ -832,7 +832,27 @@ SwigType *SwigType_typedef_qualified(SwigType *t)
|
||||||
Delete(tqname);
|
Delete(tqname);
|
||||||
}
|
}
|
||||||
/* Automatic template instantiation might go here??? */
|
/* Automatic template instantiation might go here??? */
|
||||||
|
} else {
|
||||||
|
/* It's a bare name. It's entirely possible, that the
|
||||||
|
name is part of a namespace. We'll check this by unrolling
|
||||||
|
out of the current scope */
|
||||||
|
|
||||||
|
Typetab *cs = current_scope;
|
||||||
|
while (cs) {
|
||||||
|
String *qs = SwigType_scope_name(cs);
|
||||||
|
if (Len(qs)) {
|
||||||
|
Append(qs,"::");
|
||||||
|
}
|
||||||
|
Append(qs,e);
|
||||||
|
if (Getattr(scopes,qs)) {
|
||||||
|
Clear(e);
|
||||||
|
Append(e,qs);
|
||||||
|
Delete(qs);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Delete(qs);
|
||||||
|
cs = Getattr(cs,"parent");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isenum) e = isenum;
|
if (isenum) e = isenum;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue