mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
util: Treat Assume as Assert when evaluating at compile-time
This commit is contained in:
parent
d94adc7270
commit
fa69a5f4b7
1 changed files with 2 additions and 2 deletions
|
@ -42,9 +42,9 @@ void assertion_fail(std::string_view file, int line, std::string_view func, std:
|
||||||
template <bool IS_ASSERT, typename T>
|
template <bool IS_ASSERT, typename T>
|
||||||
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)
|
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)
|
||||||
{
|
{
|
||||||
if constexpr (IS_ASSERT
|
if (IS_ASSERT || std::is_constant_evaluated()
|
||||||
#ifdef ABORT_ON_FAILED_ASSUME
|
#ifdef ABORT_ON_FAILED_ASSUME
|
||||||
|| true
|
|| true
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue