#919 c++ private assignment operator not obeyed for arrays

open
nobody
python (259)
5
2012-12-21
2008-05-23
No

Using swig 1.3.35 the python interface generated for this c++ code:

class foo
{

private:

const foo& operator=(const foo&);

};

foo bar[16];

will generate the __wrap.cxx file containing:

SWIGINTERN int Swig_var_bar_set(PyObject *_val) {
{
foo *inp = 0;
int res = SWIG_ConvertPtr(_val, SWIG_as_voidptrptr(&inp),
SWIGTYPE_p_foo, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""bar""'
of type '""foo [16]""'");
} else if (inp) {
size_t ii = 0;
for (; ii < (size_t)16; ++ii) bar[ii] = inp[ii];
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference "
"in variable '""bar""' of type '""foo [16]""'");
}
}
return 0;
fail:
return 1;
}

which calls the private assignment operator of foo.

A fix for this would also take into account when the private assignment operator is inherited from another class.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks