From 7ec34f87af104dc13d27a70e0f35557eb00df768 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 19 Jan 2006 04:51:04 +0000 Subject: [PATCH] fix feature:immutable and the 'const A* var;' case git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8480 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/CParse/parser.y | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 56f992ea9..526777e4e 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -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);