diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 33d4ccb1df6..f72991c764d 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -295,7 +295,7 @@ bool operator<(LikelyPair lhs, LikelyPair rhs) in the spec, but the examples clearly presume them and CLDR does provide such likely matches. */ -QLocaleId QLocaleId::withLikelySubtagsAdded() const +QLocaleId QLocaleId::withLikelySubtagsAdded() const noexcept { /* Each pattern that appears in a comments below, language_script_region and similar, indicates which of this's fields (even if blank) are being @@ -379,7 +379,7 @@ QLocaleId QLocaleId::withLikelySubtagsAdded() const return *this; } -QLocaleId QLocaleId::withLikelySubtagsRemoved() const +QLocaleId QLocaleId::withLikelySubtagsRemoved() const noexcept { QLocaleId max = withLikelySubtagsAdded(); // language diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h index 3044d137b9b..f911551eebd 100644 --- a/src/corelib/text/qlocale_p.h +++ b/src/corelib/text/qlocale_p.h @@ -189,34 +189,34 @@ namespace QIcu { struct QLocaleId { [[nodiscard]] Q_AUTOTEST_EXPORT static QLocaleId fromName(QStringView name); - [[nodiscard]] inline bool operator==(QLocaleId other) const + [[nodiscard]] inline bool operator==(QLocaleId other) const noexcept { return language_id == other.language_id && script_id == other.script_id && territory_id == other.territory_id; } - [[nodiscard]] inline bool operator!=(QLocaleId other) const + [[nodiscard]] inline bool operator!=(QLocaleId other) const noexcept { return !operator==(other); } - [[nodiscard]] inline bool isValid() const + [[nodiscard]] inline bool isValid() const noexcept { return language_id <= QLocale::LastLanguage && script_id <= QLocale::LastScript && territory_id <= QLocale::LastTerritory; } - [[nodiscard]] inline bool matchesAll() const + [[nodiscard]] inline bool matchesAll() const noexcept { return !language_id && !script_id && !territory_id; } // Use as: filter.accept...(candidate) - [[nodiscard]] inline bool acceptLanguage(quint16 lang) const + [[nodiscard]] inline bool acceptLanguage(quint16 lang) const noexcept { // Always reject AnyLanguage (only used for last entry in locale_data array). // So, when searching for AnyLanguage, accept everything *but* AnyLanguage. return language_id ? lang == language_id : lang; } - [[nodiscard]] inline bool acceptScriptTerritory(QLocaleId other) const + [[nodiscard]] inline bool acceptScriptTerritory(QLocaleId other) const noexcept { return (!territory_id || other.territory_id == territory_id) && (!script_id || other.script_id == script_id); } - [[nodiscard]] QLocaleId withLikelySubtagsAdded() const; - [[nodiscard]] QLocaleId withLikelySubtagsRemoved() const; + [[nodiscard]] QLocaleId withLikelySubtagsAdded() const noexcept; + [[nodiscard]] QLocaleId withLikelySubtagsRemoved() const noexcept; [[nodiscard]] QByteArray name(char separator = '-') const;