Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.2
-
Linux Mint Ulyssa 20.1 x86_64
Clang 12
X11
-
-
40eaa9509b1c2e430b7617e1b42aa66214ad80df (qt/qtdeclarative/dev) 2a5b952a624abd2ea45192861f8f56479743aa8b (qt/qtdeclarative/6.0) 3dda59305053240d154cab3b35fbcbcc9cfa9042 (qt/qtdeclarative/6.1) 2426d3aec5 (qt/qtdeclarative/5.15)
Description
When compiled with clang, the module QmlPluginDump produces the following error:
qtdeclarative/tools/qmlplugindump/main.cpp:118:44: error: use of overloaded operator '==' is ambiguous (with operand types 'const QString' and 'QHashedString') || versionInfo.pluginImportUri == ty.module() ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ /home/twdragon/src/qt5/build/qtbase/include/QtCore/../../../../qtbase/src/corelib/text/qstring.h:806:31: note: candidate function friend Q_CORE_EXPORT bool operator==(const QString &s1, const QString &s2) noexcept; ^ ../../include/QtQml/5.15.2/QtQml/private/../../../../../../../qtdeclarative/src/qml/qml/ftw/qhashedstring_p.h:212:21: note: candidate function (with reversed parameter order) bool QHashedString::operator==(const QHashedString &string) const ^ ../../include/QtQml/5.15.2/QtQml/private/../../../../../../../qtdeclarative/src/qml/qml/ftw/qhashedstring_p.h:218:21: note: candidate function (with reversed parameter order)
The workaround is to select the inherited type explicitly in file qtdeclarative/tools/qmlplugindump/main.cpp:
static bool matchingImportUri(const QQmlType &ty, const QmlVersionInfo& versionInfo) { if (versionInfo.strict) { return (versionInfo.pluginImportUri == static_cast<QString>(ty.module()) && (ty.majorVersion() == versionInfo.majorVersion || ty.majorVersion() == -1)) || ty.module().isEmpty(); } return ty.module().isEmpty() || versionInfo.pluginImportUri == static_cast<QString>(ty.module()) || ty.module().startsWith(versionInfo.pluginImportUri + QLatin1Char('.')); }
instead of:
static bool matchingImportUri(const QQmlType &ty, const QmlVersionInfo& versionInfo) { if (versionInfo.strict) { return (versionInfo.pluginImportUri == ty.module() && (ty.majorVersion() == versionInfo.majorVersion || ty.majorVersion() == -1)) || ty.module().isEmpty(); } return ty.module().isEmpty() versionInfo.pluginImportUri == ty.module() ty.module().startsWith(versionInfo.pluginImportUri + QLatin1Char('.')); }
Attachments
For Gerrit Dashboard: QTBUG-89955 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
333314,3 | qmlplugindump: Fix overload ambiguity | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
333366,2 | qmlplugindump: Fix overload ambiguity | 6.1 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
333367,2 | qmlplugindump: Fix overload ambiguity | 6.0 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
333369,4 | qmlplugindump: Fix overload ambiguity | tqtc/lts-5.15 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |