]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Assert: Avoid warnings about unused variables before C++20 18188/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 3 Mar 2025 16:11:08 +0000 (10:11 -0600)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 3 Mar 2025 16:17:32 +0000 (10:17 -0600)
include/deal.II/base/exception_macros.h

index f663107f45c721c3a61942c643780455952e068f..53c72169f3983ace13144428d8ee0f10c4074ae0 100644 (file)
@@ -636,10 +636,13 @@ DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
         }                                                      \
       while (false)
 #  else
-#    define Assert(cond, exc) \
-      do                      \
-        {                     \
-        }                     \
+#    define Assert(cond, exc)  \
+      do                       \
+        {                      \
+          if constexpr (false) \
+            if (!(cond))       \
+              ;                \
+        }                      \
       while (false)
 #  endif
 #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.