aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-19 13:38:04 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-04-19 13:27:42 +0000
commit3b69819eee9c54cd95cdf39e945c4e39f1d11171 (patch)
treed5c5e62938ca2a83c9d6e0209b29064f866756dc
parent2f0c820176868865e071c56c95fd8cb4c1f2343e (diff)
shiboken6: Fix warnings about unused init functions
Amends 5b8ce393310ed9b6ffa4b0add29d1bb164e37baa, which broke a condition setting AbstractMetaClass::hasNonPrivateConstructor which needs to take into account copy constructors. Task-number: PYSIDE-2602 Change-Id: Iba4a8070a984a5306fe5c73bf77bee0777719bb3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit d66b276df502cd3a2196c69cbae8bdbd8ac08c7d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index af1d793cf..50ef1b94a 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -1451,12 +1451,12 @@ void AbstractMetaBuilderPrivate::traverseFunctions(const ScopeModelItem& scopeIt
}
}
- if (metaFunction->functionType() == AbstractMetaFunction::ConstructorFunction) {
- if (metaFunction->isPrivate())
- metaClass->setHasPrivateConstructor(true);
- else
- metaClass->setHasNonPrivateConstructor(true);
+ if (metaFunction->functionType() == AbstractMetaFunction::ConstructorFunction
+ && metaFunction->isPrivate()) {
+ metaClass->setHasPrivateConstructor(true);
}
+ if (metaFunction->isConstructor() && !metaFunction->isPrivate()) // Including Copy CT
+ metaClass->setHasNonPrivateConstructor(true);
if (!metaFunction->isDestructor()
&& !(metaFunction->isPrivate() && metaFunction->functionType() == AbstractMetaFunction::ConstructorFunction)) {