From fa588e9e0f8019d855dbc41199814564c27d5256 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 6 Aug 2026 09:16:27 +0200 Subject: [PATCH] refactor: Mark assertion_fail as [[noreturn]] Found by Sjors in https://github.com/bitcoin/bitcoin/pull/35896#discussion_r3723634042 This should also fix GCC warnings such as https://github.com/bitcoin/bitcoin/pull/35896#issuecomment-5197419300 --- src/util/check.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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