Skip to content

Commit fa69a5f

Browse files
author
MarcoFalke
committed
util: Treat Assume as Assert when evaluating at compile-time
1 parent d94adc7 commit fa69a5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/check.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ void assertion_fail(std::string_view file, int line, std::string_view func, std:
4242
template <bool IS_ASSERT, typename T>
4343
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)
4444
{
45-
if constexpr (IS_ASSERT
45+
if (IS_ASSERT || std::is_constant_evaluated()
4646
#ifdef ABORT_ON_FAILED_ASSUME
47-
|| true
47+
|| true
4848
#endif
4949
) {
5050
if (!val) {

0 commit comments

Comments
 (0)