#1375 $parentclassname fails to compile for templates

None
closed
template (2)
5
2014-08-17
2014-06-27
Kris Thielemans
No

For templates, $parentclassname generates a string that has extra (round) brackets around the template argument, which then fails to compile. For instance

    %module swigtest
    %{
    %}
    %inline %{
    template <class T> class A {};
    %}
    %extend A
    {
       void a() { $parentclassname tmp; }
    }

This generates a line in the wrapper as follows

     SWIGINTERN void A_Sl_int_Sg__a(A< int > *self){ A<(int)> tmp; }

g++ refuses to compile the A<(int)> syntax.

Discussion

  • William Fulton
    William Fulton
    2014-07-01

    • status: open --> closed
    • assigned_to: William Fulton
    • Group: -->
     
  • William Fulton
    William Fulton
    2014-07-01

    Fixed for swig-3.0.3