From 066fc6cc186cebdb825117080f3e647214da51bf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 3 Nov 2021 10:32:29 +0100 Subject: shiboken6: Clean up messages about cyclic dependencies of overloaded functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move message helper msgCyclicDependency() from overloaddata.cpp to message.cpp to prevent a clash between the static helper and the one declared in messages.h. This was an oversight causing problems in 5.15: tqtc-pyside-setup/sources/shiboken2/generator/shiboken2/overloaddata.cpp: In function ‘QString msgCyclicDependency(const QString&, const QString&, const MetaFunctionList&)’: tqtc-pyside-setup/sources/shiboken2/generator/shiboken2/overloaddata.cpp:151:16: error: ‘QString msgCyclicDependency(const QString&, const QString&, const MetaFunctionList&)’ was declared ‘extern’ and later ‘static’ [-fpermissive] Change-Id: I56375c5bbc483859f83658cfeb4df1e6067421a0 Reviewed-by: Christian Tismer (cherry picked from commit 8430d4e02940c2d3fd9493044e05f9e113c07001) Reviewed-by: Qt Cherry-pick Bot --- sources/shiboken6/ApiExtractor/messages.cpp | 9 +++++--- sources/shiboken6/ApiExtractor/messages.h | 3 ++- .../shiboken6/generator/shiboken/overloaddata.cpp | 26 +--------------------- 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp index ffca9bcd8..605b99966 100644 --- a/sources/shiboken6/ApiExtractor/messages.cpp +++ b/sources/shiboken6/ApiExtractor/messages.cpp @@ -639,13 +639,16 @@ QString msgInvalidVersion(const QString &package, const QString &version) } QString msgCyclicDependency(const QString &funcName, const QString &graphName, - const QList &involvedConversions) + const AbstractMetaFunctionCList &cyclic, + const AbstractMetaFunctionCList &involvedConversions) { QString result; QTextStream str(&result); str << "Cyclic dependency found on overloaddata for \"" << funcName - << "\" method! The graph boy saved the graph at \"" - << QDir::toNativeSeparators(graphName) << "\"."; + << "\" method! The graph boy saved the graph at \"" << QDir::toNativeSeparators(graphName) + << "\". Cyclic functions:"; + for (const auto &c : cyclic) + str << ' ' << c->signature(); if (const int count = involvedConversions.size()) { str << " Implicit conversions (" << count << "): "; for (int i = 0; i < count; ++i) { diff --git a/sources/shiboken6/ApiExtractor/messages.h b/sources/shiboken6/ApiExtractor/messages.h index c0127f83e..686c0efd7 100644 --- a/sources/shiboken6/ApiExtractor/messages.h +++ b/sources/shiboken6/ApiExtractor/messages.h @@ -211,7 +211,8 @@ QString msgCannotFindView(const QString &viewedName, const QString &name); QString msgCannotFindSnippet(const QString &file, const QString &snippetLabel); QString msgCyclicDependency(const QString &funcName, const QString &graphName, - const QList &involvedConversions); + const AbstractMetaFunctionCList &cyclic, + const AbstractMetaFunctionCList &involvedConversions); QString msgClassNotFound(const TypeEntry *t); diff --git a/sources/shiboken6/generator/shiboken/overloaddata.cpp b/sources/shiboken6/generator/shiboken/overloaddata.cpp index 1eb06b10b..c6e2b5d83 100644 --- a/sources/shiboken6/generator/shiboken/overloaddata.cpp +++ b/sources/shiboken6/generator/shiboken/overloaddata.cpp @@ -34,6 +34,7 @@ #include #include #include "overloaddata.h" +#include "messages.h" #include "ctypenames.h" #include "pytypenames.h" #include "textstream.h" @@ -116,31 +117,6 @@ static QString getImplicitConversionTypeName(const AbstractMetaType &containerTy + types.join(QLatin1String(", ")) + QLatin1String(" >"); } -// overloaddata.cpp -static QString msgCyclicDependency(const QString &funcName, const QString &graphName, - const AbstractMetaFunctionCList &cyclic, - const AbstractMetaFunctionCList &involvedConversions) -{ - QString result; - QTextStream str(&result); - str << "Cyclic dependency found on overloaddata for \"" << funcName - << "\" method! The graph boy saved the graph at \"" << QDir::toNativeSeparators(graphName) - << "\". Cyclic functions:"; - for (const auto &c : cyclic) - str << ' ' << c->signature(); - if (const int count = involvedConversions.size()) { - str << " Implicit conversions (" << count << "): "; - for (int i = 0; i < count; ++i) { - if (i) - str << ", \""; - str << involvedConversions.at(i)->signature() << '"'; - if (const AbstractMetaClass *c = involvedConversions.at(i)->implementingClass()) - str << '(' << c->name() << ')'; - } - } - return result; -} - static inline int overloadNumber(const OverloadDataNodePtr &o) { return o->referenceFunction()->overloadNumber(); -- cgit v1.2.3