]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Assert: make release mode variant work in constexpr context
authorMatthias Maier <tamiko@43-1.org>
Wed, 14 Aug 2024 14:59:10 +0000 (09:59 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 14 Aug 2024 14:59:10 +0000 (09:59 -0500)
include/deal.II/base/exceptions.h

index 04293c46e44d607b7332685f77c8305a9d7982b7..9c3f6b051548df61b1e38b3affc638639b8a75d9 100644 (file)
@@ -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<decltype(cond)>::type *dealii_assert_a; \
-        typename std::remove_reference<decltype(exc)>::type  *dealii_assert_b; \
-        (void)dealii_assert_a;                                                 \
-        (void)dealii_assert_b;                                                 \
-      }                                                                        \
+#  define Assert(cond, exc)                                  \
+    do                                                       \
+      {                                                      \
+        typename std::remove_reference<decltype(cond)>::type \
+          *dealii_assert_variable_a = nullptr;               \
+        typename std::remove_reference<decltype(exc)>::type  \
+          *dealii_assert_variable_b = nullptr;               \
+        (void)dealii_assert_variable_a;                      \
+        (void)dealii_assert_variable_b;                      \
+      }                                                      \
     while (false)
 
 #endif /*ifdef DEBUG*/

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.