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:
Marcelo Matus 2006-02-27 16:58:01 +00:00
commit a2df176033

View file

@ -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);