#1153986 swig: segfault (infinite recursion in Swig_symbol_typedef_reduce) on namespaced typedef of shared_ptr, regression in 4.5

Package:
swig
Source:
swig
Description:
Generate scripting interfaces to C/C++ code
Submitter:
Nico Della Torre
Date:
2026-11-14 16:27:02 UTC
Severity:
normal
Tags:
#1153986#5
Date:
2026-11-14 16:22:08 UTC
From:
To:
swig 4.5.1 segfaults (infinite recursion between Swig_symbol_typedef_reduce
and Swig_symbol_template_reduce in Swig/symbol.c) on a typedef in a
namespace that has the same name as the class in its template argument.
This makes siconos FTBFS. It works with 4.4.1-2.

Reproducer, run with: swig -c++ -python test.i

%module m

namespace std {
   template<class T> class shared_ptr {};
   template<class T> class set { public: typedef T *iterator; };
}

class A;
namespace SP { typedef std::shared_ptr<A> A; }

typedef std::set<SP::A> ASet;
typedef ASet::iterator AIterator;