From 0c756be4e227c61e00301df84aa040304a8cb644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Ljungstr=C3=B6m?= Date: Wed, 30 Jun 2021 14:10:49 +0200 Subject: [PATCH] silence warning C4100 on MSVC 2019 when exceptions are disabled --- include/fmt/core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 0cbfc49b1b7c4..818767005fb7f 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -361,7 +361,9 @@ FMT_NORETURN FMT_API void assert_fail(const char* file, int line, #ifndef FMT_ASSERT # ifdef NDEBUG // FMT_ASSERT is not empty to avoid -Werror=empty-body. -# define FMT_ASSERT(condition, message) ((void)0) +FMT_INLINE constexpr void assert_ignore(bool, const char*) {} +# define FMT_ASSERT(condition, message) \ + ::fmt::detail::assert_ignore((condition), (message)) # else # define FMT_ASSERT(condition, message) \ ((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \