fix partial specialization with many parameters

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11709 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-10-20 23:21:28 +00:00
commit f825fba4f7
2 changed files with 19 additions and 1 deletions

View file

@ -91,6 +91,24 @@ namespace Two {
%template(E1_) Two::TwoParm<const int *, int *>;
%template(E2_) Two::TwoParm<int **, int *>;
// Many template parameters
%inline %{
template <typename T1, typename T2, typename T3, typename T4, typename T5> struct FiveParm { void a() {} };
template <typename T1> struct FiveParm<T1, int, int, double, short> { void b() {} };
%}
%template(FiveParm1) FiveParm<bool, int, int, double, short>;
%inline %{
template <typename T, int N = 0, int M = 0> struct ThreeParm;
template <typename T, int N, int M> struct ThreeParm { void a1() {} };
template <typename T> struct ThreeParm<T, 0, 0> { void a2() {} };
template <typename T, int N> struct ThreeParm<T, N, N> { void a3() {} };
%}
%template(ThreeParmInt) ThreeParm<int, 0, 0>;
#if 0
// TODO fix:
%inline %{

View file

@ -3791,7 +3791,7 @@ cpp_template_decl : TEMPLATE LESSTHAN template_parms GREATERTHAN { template_para
Parm *newp = NewParm(ttr, 0);
if (partialparms)
set_nextSibling(partialparms, newp);
set_nextSibling(parm_current, newp);
else
partialparms = newp;
parm_current = newp;