From faf33e0bd8fbfc66d4afc5bfb7ae1636d65eeb3f Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 20 Mar 2006 01:06:11 +0000 Subject: [PATCH] fix %rename + %copyctor issue reported by William git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9020 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Examples/test-suite/constructor_copy.i | 10 ++++++++++ SWIG/Source/Modules/lang.cxx | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/SWIG/Examples/test-suite/constructor_copy.i b/SWIG/Examples/test-suite/constructor_copy.i index 16081bad3..761dcafdf 100644 --- a/SWIG/Examples/test-suite/constructor_copy.i +++ b/SWIG/Examples/test-suite/constructor_copy.i @@ -109,3 +109,13 @@ public: #endif +%rename(ABC_Libor_ModelUtils) ABC_Nam::ABC_Libor::ModelUtils; + +%copyctor; +%inline %{ + namespace ABC_Nam { + namespace ABC_Libor { + struct ModelUtils {}; + } + } +%} diff --git a/SWIG/Source/Modules/lang.cxx b/SWIG/Source/Modules/lang.cxx index 9b2540dc8..9e75f6156 100644 --- a/SWIG/Source/Modules/lang.cxx +++ b/SWIG/Source/Modules/lang.cxx @@ -2076,7 +2076,8 @@ static void addDefaultConstructor(Node *n) String *name = NewStringf("%s::%s",cname,last); String *decl = NewString("f()."); String *csymname = Getattr(n,"sym:name"); - String *symname = Swig_name_make(cn, cname, last, decl, 0); + String *oldname = csymname; + String *symname = Swig_name_make(cn, cname, last, decl, oldname); if (!symname) { symname = Copy(csymname); }