Added another broken test for template + extend + overload

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4195 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2002-12-12 22:18:33 +00:00
commit eea44f5690
2 changed files with 116 additions and 0 deletions

View file

@ -47,6 +47,7 @@ CPP_TEST_BROKEN = \
namespace_nested \
template_default_arg \
template_extend_overload \
template_extend_overload_2 \
template_specialization_defarg \
template_specialization_enum \
using_namespace

View file

@ -0,0 +1,115 @@
%module template_extend_overload_2
%inline %{
struct A
{
A()
{
}
A(int)
{
}
int hi()
{
return 0;
}
};
template <class T>
struct AT
{
AT()
{
}
AT(int)
{
}
int hi()
{
return 0;
}
};
template <class T>
struct BT
{
BT()
{
}
BT(int)
{
}
int hi()
{
return 0;
}
};
%}
%extend A
{
//
// this works
//
int hi(int)
{
return 0;
}
A(double i)
{
A* a = new A();
return a;
}
}
%template(AT_double) AT<double>;
%extend AT<double>
{
//
// this doesn't work
//
int hi(int)
{
return 1;
}
AT<double>(double i)
{
AT<double>* a = new AT<double>();
return a;
}
}
%extend BT<double>
{
//
// this doesn't work either
//
int hi(int)
{
return 1;
}
BT<double>(double i)
{
BT<double>* a = new BT<double>();
return a;
}
}
%template(BT_double) BT<double>;