From 74c7caa716c923b87d4204ee06a01dd9e3f3febd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <foss@grueninger.de>
Date: Mon, 4 May 2020 15:08:55 +0200
Subject: [PATCH] [solverregistry] Fix superfluous semicolon warning

---
 dumux/linear/istlsolverregistry.hh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dumux/linear/istlsolverregistry.hh b/dumux/linear/istlsolverregistry.hh
index f32ae4a647..2746af7d0e 100644
--- a/dumux/linear/istlsolverregistry.hh
+++ b/dumux/linear/istlsolverregistry.hh
@@ -35,11 +35,16 @@
  * DUMUX_REGISTER_PRECONDITIONER("mypreconditioner", Dumux::MultiTypeBlockMatrixPreconditionerTag, Dune::defaultPreconditionerBlockLevelCreator<Dumux::MyPreconditioner, 1>());
  * Expicitly specifying the namespaces is required.
  * Set parameter Preconditioner.Type to "mypreconditioner" to use it through the factory.
+ *
+ * In the macro implementation, the final static_assert forces implementers
+ * to put a semicolon after every DUMUX_REGISTER_PRECONDITIONER macro call (cf. example)
+ * and avoids a compiler warning for an empty line semicolon at the same time
  */
 #define DUMUX_REGISTER_PRECONDITIONER(name, tag, ...)                 \
 } namespace Dune {                                               \
 DUNE_REGISTRY_PUT(tag, name, __VA_ARGS__);  \
-} namespace Dumux {                                              \
+} namespace Dumux { \
+static_assert(true, "Require semicolon after macro call")
 
 namespace Dumux {
 namespace {
-- 
GitLab