"constexpr" literal operators should be "consteval".

This commit is contained in:
Roman Telezhynskyi 2024-04-16 14:48:27 +03:00
parent f46197740d
commit 8ccc5c6c8f
2 changed files with 8 additions and 2 deletions

View File

@ -67,13 +67,13 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wreserved-identifier")
//---------------------------------------------------------------------------------------------------------------------
Q_DECL_CONSTEXPR inline auto operator""_L1(char ch)Q_DECL_NOEXCEPT->QLatin1Char
Q_DECL_CONSTEVAL inline auto operator""_L1(char ch)Q_DECL_NOEXCEPT->QLatin1Char
{
return QLatin1Char(ch);
}
//---------------------------------------------------------------------------------------------------------------------
Q_DECL_CONSTEXPR inline auto operator""_L1(const char *str, size_t size)Q_DECL_NOEXCEPT->QLatin1String
Q_DECL_CONSTEVAL inline auto operator""_L1(const char *str, size_t size)Q_DECL_NOEXCEPT->QLatin1String
{
return QLatin1String(str, static_cast<vsizetype>(size));
}

View File

@ -59,4 +59,10 @@ class QTextCodec;
using VTextCodec = QTextCodec;
#endif
#if __cplusplus >= 202002L && defined(__cpp_consteval) && __cpp_consteval >= 201811L
#define Q_DECL_CONSTEVAL consteval
#else
#define Q_DECL_CONSTEVAL constexpr
#endif
#endif // DEFGLOBAL_H