Fix expansion of the $parentclassname special variable

It incorrectly contains brackets in the expanded name.
Fixes SF Bug 1375.
This commit is contained in:
William S Fulton 2014-07-01 20:27:48 +01:00
commit 83749b3937
3 changed files with 17 additions and 1 deletions

View file

@ -5,3 +5,6 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.3 (in progress)
===========================
2014-07-01: wsfulton
Fix SF Bug #1375 - Expansion of the $parentclassname special variable incorrectly contains
brackets in the expanded name.

View file

@ -19,3 +19,16 @@
struct ForExtension {
};
%}
%inline %{
namespace Space {
template <class T> class ExtendTemplate {};
}
%}
%extend Space::ExtendTemplate
{
void extending() { $parentclassname tmp; }
}
%template(ExtendTemplateInt) Space::ExtendTemplate<int>;

View file

@ -869,7 +869,7 @@ void Swig_replace_special_variables(Node *n, Node *parentnode, String *code) {
String *parentclassname = 0;
if (parentclass)
parentclassname = Getattr(parentclass, "name");
Replaceall(code, "$parentclassname", parentclassname ? parentclassname : "");
Replaceall(code, "$parentclassname", parentclassname ? SwigType_str(parentclassname, "") : "");
}
}