added test case for SF bug #1296

This commit is contained in:
Paweł Tomulik 2013-01-04 18:20:19 +01:00
commit 2bb6a8c4a8
2 changed files with 25 additions and 0 deletions

View file

@ -355,6 +355,7 @@ CPP_TEST_CASES += \
template_default \
template_default2 \
template_default_arg \
template_default_arg_virtual_destructor \
template_default_class_parms \
template_default_class_parms_typedef \
template_default_inherit \

View file

@ -0,0 +1,24 @@
%module template_default_arg_virtual_destructor
// SF bug #1296:
// virtual destructor in template class (template specification having
// default parameter(s)) triggers the warnint "illegal destructor name"
%inline %{
struct A {};
template <class X, class T = int>
struct B
{
B(T const&) {}
virtual ~B() {}
};
template <class X>
struct B<X,int>
{
B(int,int) {} // constructor specific to this partial specialization
virtual ~B() {} // "illegal destructor name" when ~B() is virtual
};
%}
%template(B_AF) B<A,float>;
%template(B_A) B<A>; // this instantiation triggert the warning