From f473c321e237e53f2e73d3f6b6e55ffaf0b6f97c Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Wed, 5 Jun 2024 16:20:44 +0200 Subject: [PATCH] Fix QString::(last)IndexOf inlining conditions The original patch didn't make it into 6.7, so the conditions should be changed to 6.8 Found in API Review. Amends dfe968e9702c740b3522715fa9f0e9a281c92885. Change-Id: I8ba16370d3b04c6a921539a8f4c70a407c175bf9 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira (cherry picked from commit 2e7ac6ecf4eb39aa64b23e7113d78b56435b9150) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qstring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 895ec4b5c0a..98c2f3cdb0e 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -287,7 +287,7 @@ public: static QString vasprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(1, 0); static QString asprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(1, 2); - [[nodiscard]] QT_CORE_INLINE_SINCE(6, 7) + [[nodiscard]] QT_CORE_INLINE_SINCE(6, 8) qsizetype indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; [[nodiscard]] qsizetype indexOf(QLatin1StringView s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; [[nodiscard]] qsizetype indexOf(const QString &s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; @@ -295,7 +295,7 @@ public: { return QtPrivate::findString(*this, from, s, cs); } [[nodiscard]] qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept { return lastIndexOf(c, -1, cs); } - [[nodiscard]] QT_CORE_INLINE_SINCE(6, 7) + [[nodiscard]] QT_CORE_INLINE_SINCE(6, 8) qsizetype lastIndexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; [[nodiscard]] qsizetype lastIndexOf(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return lastIndexOf(s, size(), cs); } @@ -1510,7 +1510,7 @@ quint64 QString::toULongLong(bool *ok, int base) const return toIntegral_helper(*this, ok, base); } #endif -#if QT_CORE_INLINE_IMPL_SINCE(6, 7) +#if QT_CORE_INLINE_IMPL_SINCE(6, 8) qsizetype QString::indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const { return qToStringViewIgnoringNull(*this).indexOf(ch, from, cs);