From 77923604130057261bf774b5cc32d849a595a1f0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 26 Jan 2022 16:10:11 -0800 Subject: [PATCH] QVersionNumber: remove "pure" declaration from fromString() GCC doesn't like that we modify the contents of passed by pointer in the pure function. Reading the description of this attribute in the GCC manual was ambiguous then, but I can see the GCC maintainers' interpretation. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104243 Fixes: QTBUG-62185 Pick-to: 5.15 6.2 6.3 Change-Id: I6fcda969a9e9427198bffffd16cdf815d059d252 Reviewed-by: Marc Mutz --- src/corelib/tools/qversionnumber.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index e72e4efc23..24de456005 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -283,7 +283,7 @@ public: [[nodiscard]] Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2); [[nodiscard]] Q_CORE_EXPORT QString toString() const; - [[nodiscard]] Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QAnyStringView string, qsizetype *suffixIndex = nullptr); + [[nodiscard]] Q_CORE_EXPORT static QVersionNumber fromString(QAnyStringView string, qsizetype *suffixIndex = nullptr); #if QT_DEPRECATED_SINCE(6, 4) && QT_POINTER_SIZE != 4 Q_WEAK_OVERLOAD @@ -305,9 +305,9 @@ public: #endif #if QT_REMOVED_SINCE(6, 4) - [[nodiscard]] Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex); - [[nodiscard]] Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QLatin1String string, int *suffixIndex); - [[nodiscard]] Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QStringView string, int *suffixIndex); + [[nodiscard]] Q_CORE_EXPORT static QVersionNumber fromString(const QString &string, int *suffixIndex); + [[nodiscard]] Q_CORE_EXPORT static QVersionNumber fromString(QLatin1String string, int *suffixIndex); + [[nodiscard]] Q_CORE_EXPORT static QVersionNumber fromString(QStringView string, int *suffixIndex); #endif [[nodiscard]] friend bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept