From a3ef285aecaf46d0af08116557ab5b39a41002fd Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 24 Dec 2024 12:39:10 -0800 Subject: [PATCH] Always inline const_check to improve debug codegen in clang --- include/fmt/base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 9bd09fce..e6ea0648 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -364,7 +364,9 @@ constexpr auto is_constant_evaluated(bool default_value = false) noexcept } // Suppresses "conditional expression is constant" warnings. -template constexpr auto const_check(T value) -> T { return value; } +template FMT_ALWAYS_INLINE constexpr auto const_check(T val) -> T { + return val; +} FMT_NORETURN FMT_API void assert_fail(const char* file, int line, const char* message);