diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 0c790caf6..f29374df6 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -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 \ diff --git a/Examples/test-suite/template_default_arg_virtual_destructor.i b/Examples/test-suite/template_default_arg_virtual_destructor.i new file mode 100644 index 000000000..c56c29bc6 --- /dev/null +++ b/Examples/test-suite/template_default_arg_virtual_destructor.i @@ -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 + struct B + { + B(T const&) {} + virtual ~B() {} + }; +template + struct B + { + B(int,int) {} // constructor specific to this partial specialization + virtual ~B() {} // "illegal destructor name" when ~B() is virtual + }; +%} +%template(B_AF) B; +%template(B_A) B; // this instantiation triggert the warning