diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-11-03 10:32:29 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-03 14:43:58 +0000 |
commit | 066fc6cc186cebdb825117080f3e647214da51bf (patch) | |
tree | 39d478b002912dbc546c2ac0b6e6b94ce37905d9 | |
parent | fc658071c660ba4064278ef83e43f7d4ea18c319 (diff) |
shiboken6: Clean up messages about cyclic dependencies of overloaded functions
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 <tismer@stackless.com>
(cherry picked from commit 8430d4e02940c2d3fd9493044e05f9e113c07001)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/shiboken6/ApiExtractor/messages.cpp | 9 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/messages.h | 3 | ||||
-rw-r--r-- | sources/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<const AbstractMetaFunction *> &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<const AbstractMetaFunction *> &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 <typesystem.h> #include <graph.h> #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(); |