From 640acba8509d7458a9c749b243355d223b1cfa25 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 25 Feb 2021 01:29:04 +1100 Subject: [PATCH] Print x.what() of FMT_THROW when exception is disabled (#2145) 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 6d5c1f69..8eb4bcce 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