#1296 illegal destructor name: template+dflt args+virt. dtor

None
closed
None
5
2013-01-06
2012-12-21
No

Hello,

the following code yields warning 512 "Illegal destructor name"

---------- %< -------------
%module testmod1
%inline %{
struct A {};
template <class X, class T = int>
struct B
{
virtual ~B() { }
};
template <class X>
struct B<X,int>
{
// swig reports "illegal destructor name" (only?) if this destructor
// is virtual
virtual ~B() { }
};
%}
%template(B_T_F) B<A,float>;
%template(B_T_I) B<A>;
---------- %< -------------

Attached code to reproduce this.

Discussion

  • Paweł Tomulik

    Paweł Tomulik - 2012-12-21
    • assigned_to: nobody --> wsfulton
     
  • Paweł Tomulik

    Paweł Tomulik - 2012-12-21

    I patched Source/CParse/parser.y and it seems to fix problem (see patch attached). Not sure about side effects. There was (intentional?) discrepancy in naming non-virtual and virtual destructor nodes. For virtual destructors, the parser always tried to append template specification to the name.

     
    Last edit: Paweł Tomulik 2012-12-21
  • William Fulton

    William Fulton - 2013-01-06
    • summary: illegal destructor name: tepmplate+dflt args+virt. dtor --> illegal destructor name: template+dflt args+virt. dtor
    • status: open --> closed
    • milestone: -->
     
  • William Fulton

    William Fulton - 2013-01-06

    Thanks, patch applied for swig-2.0.10.

     

Log in to post a comment.