QAnyStringView: fix MSVC warning
When use /W4, MSVC warns about the code is not reachable. It's not reachable indeed, so it's no need to include it in the final binary, just use the same #ifdef guard to comment it out. Pick-to: 6.4 Change-Id: I22a321e2c748bd1c5608475d61ba9a83734c5364 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
8cb832090a
commit
8ba8d1346a
@ -73,15 +73,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);
|
||||
@ -93,6 +96,7 @@ private:
|
||||
}
|
||||
}
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename Char>
|
||||
|
Loading…
x
Reference in New Issue
Block a user