In this test case, SWIG will generate a setter for Three::m called _wrap_Three_m_set, which tries to call Two's copy constructor (which is private). If you change "Two m;" to "One m;" SWIG behaves correctly and doesn't generate the setter -- that extra level of inheritance seems to confuse it. Tested with SWIG 1.3.38 & Python.
%module test;
%inline {
struct nocopy
{
nocopy() {}
private: nocopy\(const nocopy&\); nocopy& operator=\(const nocopy&\); \}; struct One: public nocopy \{\}; struct Two: public One \{\}; struct Three \{ Two m; \};
}
Still reproducible with git master. Here's the testcase without the sourceforge escaping damage:
Fixed in https://github.com/swig/swig/commit/f11bffcb1993eb5435b093f2641f857ccb674a77.