summaryrefslogtreecommitdiff
path: root/Examples/test-suite/template_default_arg_virtual_destructor.i
blob: c56c29bc6e002dc2a8c1a9dc1ffea168b13f4d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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