diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index c7b96589c20..683b2d736b0 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -683,7 +683,7 @@ namespace Qt { inline namespace Literals { inline namespace StringLiterals { -inline QByteArray operator"" _ba(const char *str, size_t size) noexcept +inline QByteArray operator""_ba(const char *str, size_t size) noexcept { return QByteArray(QByteArrayData(nullptr, const_cast(str), qsizetype(size))); } @@ -696,7 +696,7 @@ inline namespace QtLiterals { #if QT_DEPRECATED_SINCE(6, 8) QT_DEPRECATED_VERSION_X_6_8("Use _ba from Qt::StringLiterals namespace instead.") -inline QByteArray operator"" _qba(const char *str, size_t size) noexcept +inline QByteArray operator""_qba(const char *str, size_t size) noexcept { return Qt::StringLiterals::operator""_ba(str, size); } diff --git a/src/corelib/text/qchar.h b/src/corelib/text/qchar.h index e9f0cf3346c..30a15f96a28 100644 --- a/src/corelib/text/qchar.h +++ b/src/corelib/text/qchar.h @@ -627,7 +627,7 @@ namespace Qt { inline namespace Literals { inline namespace StringLiterals { -constexpr inline QLatin1Char operator"" _L1(char ch) noexcept +constexpr inline QLatin1Char operator""_L1(char ch) noexcept { return QLatin1Char(ch); } diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index e6fa0d4927a..4b525a98272 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -1702,12 +1702,12 @@ namespace Qt { inline namespace Literals { inline namespace StringLiterals { -constexpr inline QLatin1StringView operator"" _L1(const char *str, size_t size) noexcept +constexpr inline QLatin1StringView operator""_L1(const char *str, size_t size) noexcept { return {str, qsizetype(size)}; } -inline QString operator"" _s(const char16_t *str, size_t size) noexcept +inline QString operator""_s(const char16_t *str, size_t size) noexcept { return QString(QStringPrivate(nullptr, const_cast(str), qsizetype(size))); } @@ -1720,7 +1720,7 @@ inline namespace QtLiterals { #if QT_DEPRECATED_SINCE(6, 8) QT_DEPRECATED_VERSION_X_6_8("Use _s from Qt::StringLiterals namespace instead.") -inline QString operator"" _qs(const char16_t *str, size_t size) noexcept +inline QString operator""_qs(const char16_t *str, size_t size) noexcept { return Qt::StringLiterals::operator""_s(str, size); }