diff --git a/src/util/check.h b/src/util/check.h index 4f5b0010161..22e1e48e5b6 100644 --- a/src/util/check.h +++ b/src/util/check.h @@ -64,8 +64,8 @@ public: NonFatalCheckError(std::string_view msg, const std::source_location& loc); }; -/** Internal helper */ -void assertion_fail(const std::source_location& loc, std::string_view assertion); +/// Internal helper. The noreturn enables optimizers to discard invalid paths. +[[noreturn]] void assertion_fail(const std::source_location& loc, std::string_view assertion); /** Helper for CHECK_NONFATAL() */ template