fix feature:immutable and the 'const A* var;' case

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8480 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-19 04:51:04 +00:00
commit 9acfaee0db

View file

@ -374,14 +374,24 @@ static void add_symbols(Node *n) {
Setattr(n,"hasvalue","1");
}
if (type) {
SwigType *rt = SwigType_typedef_resolve_all(type);
if (SwigType_isconst(rt)) {
SwigType *rt;
SwigType *ty;
SwigType *tmp = 0;
if (decl) {
ty = tmp = Copy(type);
SwigType_push(ty,decl);
} else {
ty = type;
}
rt = SwigType_typedef_resolve_all(ty);
if (SwigType_isconst(ty)) {
SetFlag(n,"hasconsttype");
}
if (!SwigType_ismutable(rt)) {
SetFlag(n,"feature:immutable");
}
Delete(rt);
if (tmp) Delete(tmp);
}
if (!type) {
Printf(stderr,"notype name %s\n", name);