summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--overloaddata.cpp2
-rw-r--r--tests/libsample/overload.h3
-rw-r--r--tests/samplebinding/typesystem_sample.xml5
3 files changed, 9 insertions, 1 deletions
diff --git a/overloaddata.cpp b/overloaddata.cpp
index 1d81cab1..a71091ea 100644
--- a/overloaddata.cpp
+++ b/overloaddata.cpp
@@ -572,7 +572,7 @@ bool OverloadData::isSingleArgument(const AbstractMetaFunctionList& overloads)
{
bool singleArgument = true;
foreach (const AbstractMetaFunction* func, overloads) {
- if (func->arguments().size() - numberOfRemovedArguments(func) > 1) {
+ if (func->arguments().size() - numberOfRemovedArguments(func) != 1) {
singleArgument = false;
break;
}
diff --git a/tests/libsample/overload.h b/tests/libsample/overload.h
index 739c4065..36b30f2b 100644
--- a/tests/libsample/overload.h
+++ b/tests/libsample/overload.h
@@ -57,6 +57,9 @@ public:
inline int intOverloads(const Point& p, double d) { return 1; }
inline int intOverloads(int i, int i2) { return 2; }
inline int intOverloads(int i, int removedArg, double d) { return 3; }
+
+ void singleOverload(Point* x) {}
+ Point* singleOverload() {return new Point();}
};
#endif // OVERLOAD_H
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 40b70ab4..4f98dff4 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -978,6 +978,11 @@
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, 2, %3));
</inject-code>
</modify-function>
+ <modify-function signature="singleOverload(Point*)">
+ <modify-argument index="1">
+ <define-ownership owner="c++"/>
+ </modify-argument>
+ </modify-function>
</value-type>
<object-type name="Collector" stream="yes"/>