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/SWIG@8908 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c3bb0f609c
commit
0cfd700c10
1 changed files with 6 additions and 11 deletions
|
|
@ -2530,17 +2530,12 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va
|
||||||
if (!value) {
|
if (!value) {
|
||||||
SwigType *ty = Getattr(p,k_type);
|
SwigType *ty = Getattr(p,k_type);
|
||||||
if (ty) {
|
if (ty) {
|
||||||
if (template_reduce) {
|
SwigType *rty = Swig_symbol_typedef_reduce(ty,tscope);
|
||||||
SwigType *rty = Swig_symbol_typedef_reduce(ty,tscope);
|
int reduce = template_reduce || SwigType_ispointer(rty) || SwigType_isarray(rty) || SwigType_isreference(rty);
|
||||||
ty = Swig_symbol_type_qualify(rty,tscope);
|
ty = reduce ? Swig_symbol_type_qualify(rty,tscope) : Swig_symbol_type_qualify(ty,tscope);
|
||||||
Setattr(p,k_type,ty);
|
Setattr(p,k_type,ty);
|
||||||
Delete(ty);
|
Delete(ty);
|
||||||
Delete(rty);
|
Delete(rty);
|
||||||
} else {
|
|
||||||
ty = Swig_symbol_type_qualify(ty,tscope);
|
|
||||||
Setattr(p,k_type,ty);
|
|
||||||
Delete(ty);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = Swig_symbol_type_qualify(value,tscope);
|
value = Swig_symbol_type_qualify(value,tscope);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue