From 32cbaee758d653b7e1060fcd22e667c913b7c92a Mon Sep 17 00:00:00 2001 From: Harinath Nampally Date: Sat, 25 Jan 2025 10:31:04 -0500 Subject: [PATCH] ci static check fix Signed-off-by: Harinath Nampally --- include/nlohmann/detail/macro_scope.hpp | 3 ++- single_include/nlohmann/json.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp index 8bf0633fb..f0f7dd571 100644 --- a/include/nlohmann/detail/macro_scope.hpp +++ b/include/nlohmann/detail/macro_scope.hpp @@ -26,7 +26,8 @@ template #if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND) || defined(EXCEPTIONS) throw std::forward(exception); #else - (void)exception; + // Forward the exception (even if unused) and abort + std::forward(exception); std::abort(); #endif } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 94768c22d..8c7163aaf 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -2392,7 +2392,8 @@ template #if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND) || defined(EXCEPTIONS) throw std::forward(exception); #else - (void)exception; + // Forward the exception (even if unused) and abort + std::forward(exception); std::abort(); #endif }