49@@ -44,7 +50,7 @@ void assertion_fail(std::string_view file, int line, std::string_view func, std:
50 template <bool IS_ASSERT, typename T>
51 constexpr T&& inline_assertion_check(LIFETIMEBOUND T&& val, [[maybe_unused]] const char* file, [[maybe_unused]] int line, [[maybe_unused]] const char* func, [[maybe_unused]] const char* assertion)
52 {
53- if (IS_ASSERT || std::is_constant_evaluated() || g_fuzzing
54+ if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
0 if constexpr (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
Do we need the std::is_constant_evaluated()
then? I’m getting this warning everywhere when I build
0../../../../src/util/check.h:53:32: warning: 'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression [-Wconstant-evaluated]
1 53 | if constexpr (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
2 | ^
3../../../../src/util/check.h:53:32: warning: 'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression [-Wconstant-evaluated]
Yeah, the two are exclusive. It is not possible to add constexpr
here and use std::is_constant_evaluated()
correctly. The meaning of std::is_constant_evaluated()
in this context denotes whether the Assume()
was called in a constexpr context, not whether the if condition was evaluated constant.