diff options
Diffstat (limited to 'src/corelib/text/qanystringview.h')
-rw-r--r-- | src/corelib/text/qanystringview.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/text/qanystringview.h b/src/corelib/text/qanystringview.h index 0cd97fd54e..b1af305d0d 100644 --- a/src/corelib/text/qanystringview.h +++ b/src/corelib/text/qanystringview.h @@ -51,15 +51,18 @@ private: static constexpr bool isAsciiOnlyCharsAtCompileTime(Char *str, qsizetype sz) noexcept { // do not perform check if not at compile time -#if defined(__cpp_lib_is_constant_evaluated) +#if !(defined(__cpp_lib_is_constant_evaluated) || defined(Q_CC_GNU)) + Q_UNUSED(str); + Q_UNUSED(sz); + return false; +#else +# if defined(__cpp_lib_is_constant_evaluated) if (!std::is_constant_evaluated()) return false; -#elif defined(Q_CC_GNU) && !defined(Q_CC_CLANG) +# elif defined(Q_CC_GNU) && !defined(Q_CC_CLANG) if (!str || !__builtin_constant_p(*str)) return false; -#else - return false; -#endif +# endif if constexpr (sizeof(Char) != sizeof(char)) { Q_UNUSED(str); Q_UNUSED(sz); @@ -69,8 +72,9 @@ private: if (uchar(str[i]) > 0x7f) return false; } + return true; } - return true; +#endif } template<typename Char> |