Menu

#1067 Mismatching between class name and other type

open
nobody
5
2022-03-19
2010-02-02
No

Hello,

Using the file attached:

struct A{};

template <class T>
struct B{ typedef A C; };

template <class T>
struct C{
typedef B<T> BT;
typename BT::C get_data(){return data;};
typename BT::C data;
};

with .i
%module t3
%{
#include "t3.h"
%}

%include "t3.h"
%template(Vh_sc) C<int>;

Swig generates
SwigValueWrapper< C< int >::BT::C<(int)> > result;
instead of
SwigValueWrapper< C< int >::BT::C > result;

Everything works as expected if I change the typedef in class B.

Discussion

  • Sébastien Loriot

     
  • Sébastien Loriot

    Forgot to mention usual info:

    SWIG Version 1.3.40
    Compiled with g++ (Debian 4.3.4-6) 4.3.4

    Best.

     
  • William Fulton

    William Fulton - 2010-02-05

    The current version in svn generates:
    SwigValueWrapper< C< int >::BT::C< int > > result;

    which is slightly different, but still the trailing <int> needs to be dropped.

     
  • Olly Betts

    Olly Betts - 2010-05-26
    • labels: --> code generation (general)
     
  • Olly Betts

    Olly Betts - 2022-03-19

    Current git master generates sc different again:

    SwigValueWrapper< B< int >::C< int > > result;
    

    Still doesn't compile though. I think again the trailing <int> shouldn't be there.

     

Log in to post a comment.