diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index b9807735e3..6202bfdfbb 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -3920,7 +3920,7 @@ class NumericTokenizer // TODO: use deterministic finite-state-automata. // TODO QTBUG-95460: CLDR has Inf/NaN representations per locale. static constexpr char lettersInfNaN[] = "afin"; // Letters of Inf, NaN - static constexpr auto matchInfNaN = makeCharacterSetMatch(); + static constexpr auto matchInfNaN = QtPrivate::makeCharacterSetMatch(); const QStringView m_text; const QLocaleData::NumericData m_guide; qsizetype m_index = 0; diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h index 99b2528633..fdf6889748 100644 --- a/src/corelib/text/qlocale_p.h +++ b/src/corelib/text/qlocale_p.h @@ -55,8 +55,8 @@ template struct QCharacterSetMatch } }; -namespace { -static constexpr char ascii_space_chars[] = +namespace QtPrivate { +inline constexpr char ascii_space_chars[] = "\t" // 9: HT - horizontal tab "\n" // 10: LF - line feed "\v" // 11: VT - vertical tab @@ -64,7 +64,8 @@ static constexpr char ascii_space_chars[] = "\r" // 13: CR - carriage return " "; // 32: space -template static constexpr auto makeCharacterSetMatch() +template +inline constexpr auto makeCharacterSetMatch() { constexpr auto view = std::string_view(Set); constexpr uchar MinElement = *std::min_element(view.begin(), view.end()); @@ -87,7 +88,7 @@ template static constexpr auto makeChar return QCharacterSetMatch(view); } } -} // unnamed namespace +} // QtPrivate struct QLocaleData; // Subclassed by Android platform plugin: @@ -536,7 +537,7 @@ QString qt_readEscapedFormatString(QStringView format, qsizetype *idx); [[nodiscard]] constexpr inline bool ascii_isspace(uchar c) { - constexpr auto matcher = makeCharacterSetMatch(); + constexpr auto matcher = QtPrivate::makeCharacterSetMatch(); return matcher.matches(c); }