diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index f72991c764d..82ea7ebc447 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -465,7 +465,7 @@ QByteArray QLocalePrivate::bcp47Name(char separator) const return m_data->id().withLikelySubtagsRemoved().name(separator); } -static qsizetype findLocaleIndexById(QLocaleId localeId) +static qsizetype findLocaleIndexById(QLocaleId localeId) noexcept { qsizetype idx = locale_index[localeId.language_id]; // If there are no locales for specified language (so we we've got the @@ -484,7 +484,7 @@ static qsizetype findLocaleIndexById(QLocaleId localeId) return -1; } -qsizetype QLocaleData::findLocaleIndex(QLocaleId lid) +qsizetype QLocaleData::findLocaleIndex(QLocaleId lid) noexcept { QLocaleId localeId = lid; QLocaleId likelyId = localeId.withLikelySubtagsAdded(); @@ -853,7 +853,7 @@ static qsizetype defaultIndex() return data - locale_data; } -const QLocaleData *QLocaleData::c() +const QLocaleData *QLocaleData::c() noexcept { Q_ASSERT(locale_index[QLocale::C] == 0); return locale_data; diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h index f911551eebd..ee65076780b 100644 --- a/src/corelib/text/qlocale_p.h +++ b/src/corelib/text/qlocale_p.h @@ -244,8 +244,8 @@ struct QLocaleData public: // Having an index for each locale enables us to have diverse sources of // data, e.g. calendar locales, as well as the main CLDR-derived data. - [[nodiscard]] static qsizetype findLocaleIndex(QLocaleId localeId); - [[nodiscard]] static const QLocaleData *c(); + [[nodiscard]] static qsizetype findLocaleIndex(QLocaleId localeId) noexcept; + [[nodiscard]] static const QLocaleData *c() noexcept; enum DoubleForm { DFExponent = 0,