From 18cc381afd9ba75278e84c53787aaba56b66ffdb Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 14 Aug 2024 09:59:10 -0500 Subject: [PATCH] Assert: make release mode variant work in constexpr context --- include/deal.II/base/exceptions.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 04293c46e4..9c3f6b0515 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -1665,14 +1665,16 @@ namespace deal_II_exceptions * We accomplish this by using decltype(...) and create a dummy pointer * with these signatures. */ -# define Assert(cond, exc) \ - do \ - { \ - typename std::remove_reference::type *dealii_assert_a; \ - typename std::remove_reference::type *dealii_assert_b; \ - (void)dealii_assert_a; \ - (void)dealii_assert_b; \ - } \ +# define Assert(cond, exc) \ + do \ + { \ + typename std::remove_reference::type \ + *dealii_assert_variable_a = nullptr; \ + typename std::remove_reference::type \ + *dealii_assert_variable_b = nullptr; \ + (void)dealii_assert_variable_a; \ + (void)dealii_assert_variable_b; \ + } \ while (false) #endif /*ifdef DEBUG*/ -- 2.39.5