Menu

#1063 Swig confused by class in other namespace in template parame

open
nobody
None
5
2023-06-13
2010-01-15
Kevin Smyth
No

Given the input:

#ifdef SWIG
%ignore A::Class;
#endif

namespace A {
template <class TYPE >
class Templated { };
class Class { };
}

namespace B {
class Class { };
A::Templated< Class > test1() {}
}

`./swig -csharp -c++ -module testing testing2.cpp` produces:
SWIGEXPORT void * SWIGSTDCALL CSharp_test1() {
void * jresult ;
SwigValueWrapper< A::Templated< A::Class > > result;

result = B::test1();
jresult = new A::Templated< A::Class >((const A::Templated< A::Class > &)result);
return jresult;
}

Here, A::Class should be B::Class instead.

Discussion

  • Kevin Smyth

    Kevin Smyth - 2010-01-15

    works-for-me patch

     
  • Olly Betts

    Olly Betts - 2022-03-15

    Reproducible with SWIG git master.

    @wsfulton Does the suggested fix look plausible?

     
  • Olly Betts

    Olly Betts - 2023-06-13

    I've opened a PR with this patch to try to move things forwards: https://github.com/swig/swig/pull/2636

     

Log in to post a comment.