added test case for SF bug #1296
This commit is contained in:
parent
3e2c6bb03d
commit
2bb6a8c4a8
2 changed files with 25 additions and 0 deletions
|
|
@ -355,6 +355,7 @@ CPP_TEST_CASES += \
|
||||||
template_default \
|
template_default \
|
||||||
template_default2 \
|
template_default2 \
|
||||||
template_default_arg \
|
template_default_arg \
|
||||||
|
template_default_arg_virtual_destructor \
|
||||||
template_default_class_parms \
|
template_default_class_parms \
|
||||||
template_default_class_parms_typedef \
|
template_default_class_parms_typedef \
|
||||||
template_default_inherit \
|
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 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue