From: Matthias Maier Date: Wed, 14 Aug 2024 14:59:10 +0000 (-0500) Subject: Assert: make release mode variant work in constexpr context X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18cc381afd9ba75278e84c53787aaba56b66ffdb;p=dealii.git Assert: make release mode variant work in constexpr context --- 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*/