Fixes for compactdefaultargs and pass by value where the class being passed by value has no default constructor - previously it used SwigValueWrapper

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11312 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-06-24 17:20:17 +00:00
commit 5d3deb2db1
3 changed files with 13 additions and 1 deletions

View file

@ -195,7 +195,11 @@ int Swig_cargs(Wrapper *w, ParmList *p) {
String *type = Getattr(p, "type");
/* default values only emitted if in compact default args mode */
String *pvalue = (compactdefargs) ? Getattr(p, "value") : 0;
SwigType *altty = SwigType_alttype(type, 0);
/* When using compactdefaultargs, the code generated initialises a variable via a constructor call that accepts the
* default value as a parameter. The default constructor is not called and therefore SwigValueWrapper is not needed. */
SwigType *altty = pvalue ? 0 : SwigType_alttype(type, 0);
int tycode = SwigType_type(type);
if (tycode == T_REFERENCE) {
if (pvalue) {