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 <marc.mutz@qt.io>
bb10
Thiago Macieira 2022-01-26 16:10:11 -08:00
parent 55a88206f3
commit 7792360413
1 changed files with 4 additions and 4 deletions

View File

@ -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