diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-11 14:26:09 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-13 07:25:06 +0000 |
commit | 7b2025f542729b0c407519d2cb45688dd402eed7 (patch) | |
tree | 65b2c76142d13bdd30087450f985b39a5b04aee8 /sources/shiboken2/generator/shiboken2 | |
parent | 2bf3dcc98e6df1b434b0fb26b981302423c7ef87 (diff) |
shiboken: Refactor Generator::minimalConstructor(AbstractMetaClass)
Add some convenience functions returning the status of
default expressions to AbstractMetaArgument.
Rewrite the function to only insert suitable candidates into
an ordered multimap instead of looping twice over all candidates.
This unearthed a bug in the old algorithm trying to find the maximum
number of arguments: When no candidates were found, maxArgs was left
at 0, which caused it to assume default constructible. This triggered
for the QMatrixNxN classes inheriting QGenericMatrix<int, int, Type>
with (unsupported) non-type template parameters. For these, the
default constructor needs to be specified now.
Task-number: PYSIDE-62
Change-Id: I5ce2bed43001780553048d8af0addaba2b22410b
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken2/generator/shiboken2')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 4bb1e02b6..dfe23a598 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -3173,7 +3173,7 @@ void CppGenerator::writeMethodCall(QTextStream &s, const AbstractMetaFunction *f bool argsClear = true; for (int i = func->arguments().size() - 1; i >= maxArgs + removedArgs; i--) { const AbstractMetaArgument* arg = func->arguments().at(i); - bool defValModified = arg->defaultValueExpression() != arg->originalDefaultValueExpression(); + const bool defValModified = arg->hasModifiedDefaultValueExpression(); bool hasConversionRule = !func->conversionRule(TypeSystem::NativeCode, arg->argumentIndex() + 1).isEmpty(); if (argsClear && !defValModified && !hasConversionRule) continue; |