diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-10-14 19:20:08 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-12-09 20:28:07 -0300 |
commit | 1588c124fb818a6edd54491bcfbecebbb9b7869b (patch) | |
tree | 9d5e8248adc8ecb0ec21fb629b066351b853d512 | |
parent | a27ca79d73de13a1d0d5f049ea6c90e47024457d (diff) | |
download | shiboken-1588c124fb818a6edd54491bcfbecebbb9b7869b.tar.gz shiboken-1588c124fb818a6edd54491bcfbecebbb9b7869b.tar.xz shiboken-1588c124fb818a6edd54491bcfbecebbb9b7869b.zip |
Fixed code generation for functions arguments that use object types as values.
-rw-r--r-- | generator/cppgenerator.cpp | 1 | ||||
-rw-r--r-- | tests/libsample/objecttypebyvalue.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 3310ff23..0aa8cc8c 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -2754,6 +2754,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f } else { int idx = arg->argumentIndex() - removedArgs; bool deRef = isValueTypeWithCopyConstructorOnly(arg->type()) + || isObjectTypeUsedAsValueType(arg->type()) || (arg->type()->isReference() && isWrapperType(arg->type()) && !isPointer(arg->type())); QString argName = hasConversionRule ? QString("%1"CONV_RULE_OUT_VAR_SUFFIX).arg(arg->name()) diff --git a/tests/libsample/objecttypebyvalue.h b/tests/libsample/objecttypebyvalue.h index 0eb3bdd7..ce5d33ee 100644 --- a/tests/libsample/objecttypebyvalue.h +++ b/tests/libsample/objecttypebyvalue.h @@ -28,6 +28,7 @@ class ObjectTypeByValue { public: ObjectTypeByValue returnSomeKindOfMe() { return ObjectTypeByValue(); } + void acceptKindOfMeAsValue(ObjectTypeByValue kindOfMe) {} // prop used to check for segfaults ProtectedProperty prop; |