Fix usage of nested template classes within templated classes so that compileable code is generated.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11737 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
dd5714ea28
commit
b502f4fc5a
3 changed files with 31 additions and 2 deletions
|
|
@ -1,13 +1,17 @@
|
||||||
Version 1.3.41 (in progress)
|
Version 1.3.41 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2009-11-13: wsfulton
|
||||||
|
Fix usage of nested template classes within templated classes so that compileable code
|
||||||
|
is generated.
|
||||||
|
|
||||||
2009-11-13: olly
|
2009-11-13: olly
|
||||||
[php] Fix place where class prefix (as specified with -prefix)
|
[php] Fix place where class prefix (as specified with -prefix)
|
||||||
wasn't being used. Patch from gverbruggen in SF#2892647.
|
wasn't being used. Patch from gverbruggen in SF#2892647.
|
||||||
|
|
||||||
2009-11-12: wsfulton
|
2009-11-12: wsfulton
|
||||||
Fix usage of nested template classes so that compileable code is generated - the nested
|
Fix usage of nested template classes so that compileable code is generated - the nested
|
||||||
template class is now treated like a normal nested classes that is as an opaque type
|
template class is now treated like a normal nested classes, that is, as an opaque type
|
||||||
unless the nestedworkaround feature is used.
|
unless the nestedworkaround feature is used.
|
||||||
|
|
||||||
2009-11-12: wsfulton
|
2009-11-12: wsfulton
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,20 @@
|
||||||
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterClass::Inner2;
|
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterClass::Inner2;
|
||||||
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterTemplate::NestedInnerTemplate1;
|
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterTemplate::NestedInnerTemplate1;
|
||||||
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterTemplate::NestedInnerTemplate2;
|
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterTemplate::NestedInnerTemplate2;
|
||||||
|
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterTemplate::NestedInnerTemplate3;
|
||||||
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterTemplate::NestedStruct;
|
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) ns::OuterTemplate::NestedStruct;
|
||||||
|
|
||||||
|
namespace ns {
|
||||||
|
template <class T> struct ForwardTemplate;
|
||||||
|
}
|
||||||
|
%{
|
||||||
|
namespace ns {
|
||||||
|
template <class T> struct ForwardTemplate {
|
||||||
|
void tmethod(T t) {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
namespace ns {
|
namespace ns {
|
||||||
|
|
@ -80,10 +92,17 @@ namespace ns {
|
||||||
void hohum() {}
|
void hohum() {}
|
||||||
};
|
};
|
||||||
UU hohum(UU u) { return u; }
|
UU hohum(UU u) { return u; }
|
||||||
|
template <typename VV> struct NestedInnerTemplate3 : public NestedInnerTemplate2<VV> {
|
||||||
|
void hohum() {}
|
||||||
|
};
|
||||||
struct NestedStruct {
|
struct NestedStruct {
|
||||||
NestedStruct() {}
|
NestedStruct() {}
|
||||||
void hohum() {}
|
void hohum() {}
|
||||||
};
|
};
|
||||||
|
NestedInnerTemplate1<short> useNestedInnerTemplate1(const NestedInnerTemplate1<short>& inner) { return inner; }
|
||||||
|
NestedInnerTemplate2<short> useNestedInnerTemplate2(const NestedInnerTemplate2<short>& inner) { return inner; }
|
||||||
|
NestedInnerTemplate3<short> useNestedInnerTemplate3(const NestedInnerTemplate3<short>& inner) { return inner; }
|
||||||
|
NestedStruct useNestedStruct(const NestedStruct& inner) { return inner; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -525,7 +525,13 @@ String *SwigType_namestr(const SwigType *t) {
|
||||||
Putc(' ', r);
|
Putc(' ', r);
|
||||||
Putc('>', r);
|
Putc('>', r);
|
||||||
suffix = SwigType_templatesuffix(t);
|
suffix = SwigType_templatesuffix(t);
|
||||||
Append(r, suffix);
|
if (Len(suffix) > 0) {
|
||||||
|
String *suffix_namestr = SwigType_namestr(suffix);
|
||||||
|
Append(r, suffix_namestr);
|
||||||
|
Delete(suffix_namestr);
|
||||||
|
} else {
|
||||||
|
Append(r, suffix);
|
||||||
|
}
|
||||||
Delete(suffix);
|
Delete(suffix);
|
||||||
Delete(p);
|
Delete(p);
|
||||||
return r;
|
return r;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue