From c1e36b912874ab7ee06da7408748e494eb7355db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com> Date: Thu, 5 Nov 2020 17:57:55 +0100 Subject: [PATCH] Fix compilation warnings when building type is RelWithDebInfo --- src/utils/PugsAssert.hpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/utils/PugsAssert.hpp b/src/utils/PugsAssert.hpp index def5604de..7ac521a51 100644 --- a/src/utils/PugsAssert.hpp +++ b/src/utils/PugsAssert.hpp @@ -102,16 +102,15 @@ struct AssertChecker<std::tuple<Args...> > #else // NDEBUG -#define Assert(...) \ - { \ - using TupleArgs = decltype(std::make_tuple(__VA_ARGS__)); \ - AssertChecker<TupleArgs>::check_args_type(); \ - constexpr int tuple_size = std::tuple_size_v<TupleArgs>; \ - static_assert(tuple_size >= 1 and tuple_size <= 2); \ - auto args = std::forward_as_tuple(__VA_ARGS__); \ - if (not static_cast<bool>(std::get<0>(args))) { \ - throw AssertError(__FILE__, __LINE__, __PRETTY_FUNCTION__, args, #__VA_ARGS__); \ - } \ +#define Assert(...) \ + { \ + using TupleArgs = decltype(std::make_tuple(__VA_ARGS__)); \ + AssertChecker<TupleArgs>::check_args_type(); \ + constexpr int tuple_size = std::tuple_size_v<TupleArgs>; \ + static_assert(tuple_size >= 1 and tuple_size <= 2); \ + if (not static_cast<bool>(std::get<0>(std::forward_as_tuple(__VA_ARGS__)))) { \ + throw AssertError(__FILE__, __LINE__, __PRETTY_FUNCTION__, std::forward_as_tuple(__VA_ARGS__), #__VA_ARGS__); \ + } \ } #endif // NDEBUG -- GitLab