Merge branch 'SFbug1296' of https://github.com/ptomulik/swig into ptomulik-SFbug1296
This commit is contained in:
commit
3f1d77ee0f
3 changed files with 25 additions and 10 deletions
|
|
@ -356,6 +356,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 \
|
||||
|
|
|
|||
|
|
@ -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 warning "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
|
||||
Loading…
Add table
Add a link
Reference in a new issue