From eb1ff91d79b4d274d0d724d4f2419b7d469b7bd5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 22 Feb 2021 15:04:43 +1100 Subject: [PATCH] Print x.what() of FMT_THROW when exception is disabled Signed-off-by: Jiahao XU --- include/fmt/format.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 53094c1a..ffc3bfc5 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -123,8 +123,7 @@ FMT_END_NAMESPACE # else # define FMT_THROW(x) \ do { \ - static_cast(x); \ - FMT_ASSERT(false, ""); \ + FMT_ASSERT(false, (x).what()); \ } while (false) # endif #endif