use reduced type in templates when it is a pointer,array,reference or when using the templatereduce option
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8908 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b672cccec3
commit
a2df176033
1 changed files with 6 additions and 11 deletions
|
|
@ -2530,17 +2530,12 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va
|
|||
if (!value) {
|
||||
SwigType *ty = Getattr(p,k_type);
|
||||
if (ty) {
|
||||
if (template_reduce) {
|
||||
SwigType *rty = Swig_symbol_typedef_reduce(ty,tscope);
|
||||
ty = Swig_symbol_type_qualify(rty,tscope);
|
||||
Setattr(p,k_type,ty);
|
||||
Delete(ty);
|
||||
Delete(rty);
|
||||
} else {
|
||||
ty = Swig_symbol_type_qualify(ty,tscope);
|
||||
Setattr(p,k_type,ty);
|
||||
Delete(ty);
|
||||
}
|
||||
SwigType *rty = Swig_symbol_typedef_reduce(ty,tscope);
|
||||
int reduce = template_reduce || SwigType_ispointer(rty) || SwigType_isarray(rty) || SwigType_isreference(rty);
|
||||
ty = reduce ? Swig_symbol_type_qualify(rty,tscope) : Swig_symbol_type_qualify(ty,tscope);
|
||||
Setattr(p,k_type,ty);
|
||||
Delete(ty);
|
||||
Delete(rty);
|
||||
}
|
||||
} else {
|
||||
value = Swig_symbol_type_qualify(value,tscope);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue