diff --git a/dune/subgrid/subgrid.hh b/dune/subgrid/subgrid.hh
index 99bdb45d6a4e6ce56e3331ab4cb8ba1e766a7650..7405c299916ce1fd0f668d18276c80e6142f8218 100644
--- a/dune/subgrid/subgrid.hh
+++ b/dune/subgrid/subgrid.hh
@@ -335,7 +335,7 @@ class SubGrid :
         /** global refinement
         * \todo optimize implementation
         */
-        void globalRefine (int refCount DUNE_UNUSED)
+        void globalRefine ([[maybe_unused]] int refCount)
         {
             for (auto&& e : elements(this->leafGridView()))
                 mark(1, e);
diff --git a/dune/subgrid/subgrid/subgridhierarchiciterator.hh b/dune/subgrid/subgrid/subgridhierarchiciterator.hh
index 5c2e28d901fd67f36d8e6c48ce2aaca79ea774aa..b3d939cb1440a0c1c2d17727c65eb889c2b1e62d 100644
--- a/dune/subgrid/subgrid/subgridhierarchiciterator.hh
+++ b/dune/subgrid/subgrid/subgridhierarchiciterator.hh
@@ -57,7 +57,7 @@ class SubGridHierarchicIterator :
          * 
          * \param endDummy Here only to distinguish it from the other constructor
          */
-        explicit SubGridHierarchicIterator(const GridImp* subGrid, const SubGridElement& startEntity, int maxLevel, bool endDummy DUNE_UNUSED) :
+        explicit SubGridHierarchicIterator(const GridImp* subGrid, const SubGridElement& startEntity, int maxLevel, [[maybe_unused]] bool endDummy) :
             Base(subGrid, startEntity.hostEntity().hend(maxLevel)),
             hostHierarchicEndIterator_(hostIterator_)
         {}
diff --git a/dune/subgrid/subgrid/subgridindexstorage.hh b/dune/subgrid/subgrid/subgridindexstorage.hh
index e273fc9d0fc9ff8c7e868529497588d44d185b0d..95892e836d57a0d2a774e530aa1d431e09d5b286 100644
--- a/dune/subgrid/subgrid/subgridindexstorage.hh
+++ b/dune/subgrid/subgrid/subgridindexstorage.hh
@@ -180,7 +180,7 @@ class SubGridIndexStorageBase
 
 
         //! get multilevel geometry type counter for given geometry type for usage on given level
-        MultilevelCounter& getGeometryTypeCountForLevel(const GeometryType& gt, int level DUNE_UNUSED)
+        MultilevelCounter& getGeometryTypeCountForLevel(const GeometryType& gt, [[maybe_unused]] int level)
         {
             // Is this the first time we see this kind of entity?
             auto countIt = numEntities.find(gt);
@@ -196,7 +196,7 @@ class SubGridIndexStorageBase
             return countIt->second;
         }
 
-        const MultilevelCounter& getGeometryTypeCountForLevel(const GeometryType& gt, int level DUNE_UNUSED) const
+        const MultilevelCounter& getGeometryTypeCountForLevel(const GeometryType& gt, [[maybe_unused]] int level) const
         {
             return numEntities.find(gt)->second;
         }
@@ -571,7 +571,7 @@ class SubGridMapSubindexSetter<GridType,0>
 
         typedef typename std::remove_const<GridType>::type::template Codim<0>::Entity Element;
 
-        static void insertSubEntities(SubGridMapIndexStorage<GridType>& indexStorage DUNE_UNUSED, const Element& e DUNE_UNUSED, bool isLeaf DUNE_UNUSED, int level DUNE_UNUSED)
+        static void insertSubEntities([[maybe_unused]] SubGridMapIndexStorage<GridType>& indexStorage, [[maybe_unused]] const Element& e, [[maybe_unused]] bool isLeaf, [[maybe_unused]] int level)
         {};
 };
 
@@ -951,7 +951,7 @@ class SubGridVectorSubindexSetter<GridType,0>
 
         typedef typename std::remove_const<GridType>::type::template Codim<0>::Entity Element;
 
-        static void insertSubEntities(SubGridVectorIndexStorage<GridType>& indexStorage DUNE_UNUSED, const Element& e DUNE_UNUSED, bool isLeaf DUNE_UNUSED, int level DUNE_UNUSED)
+        static void insertSubEntities([[maybe_unused]] SubGridVectorIndexStorage<GridType>& indexStorage, [[maybe_unused]] const Element& e, [[maybe_unused]] bool isLeaf, [[maybe_unused]] int level)
         {};
 };
 
diff --git a/dune/subgrid/subgrid/subgridleafiterator.hh b/dune/subgrid/subgrid/subgridleafiterator.hh
index 4524a973802f58f3c743a84d3a8fd045bfb6f612..ba1535b5910b6dae47280df73dceac10332dc5e3 100644
--- a/dune/subgrid/subgrid/subgridleafiterator.hh
+++ b/dune/subgrid/subgrid/subgridleafiterator.hh
@@ -64,7 +64,7 @@ class SubGridLeafIterator :
          * 
          * \param endDummy Here only to distinguish it from the other constructor
          */
-        explicit SubGridLeafIterator(const GridImp* subGrid, bool endDummy DUNE_UNUSED) :
+        explicit SubGridLeafIterator(const GridImp* subGrid, [[maybe_unused]] bool endDummy) :
             Base(subGrid, subGrid->getHostGrid().levelGridView(subGrid->maxLevel()).template end<codim>()),
             hostLevelEndIterator_(subGrid->getHostGrid().levelGridView(0).template end<codim>()),
             level_(0)
diff --git a/dune/subgrid/subgrid/subgridleveliterator.hh b/dune/subgrid/subgrid/subgridleveliterator.hh
index f91522741a10e8a22df53a85fa4da611fea7f5ef..36964e375ab85984f82dbdee5b21db12eabaa8f6 100644
--- a/dune/subgrid/subgrid/subgridleveliterator.hh
+++ b/dune/subgrid/subgrid/subgridleveliterator.hh
@@ -52,10 +52,10 @@ class SubGridLevelIterator :
 
         /**
          * \brief Constructor which create the end iterator
-         * 
+         *
          * \param endDummy Here only to distinguish it from the other constructor
          */
-        explicit SubGridLevelIterator(const GridImp* subGrid, int level, bool endDummy DUNE_UNUSED) :
+        explicit SubGridLevelIterator(const GridImp* subGrid, int level, [[maybe_unused]] bool endDummy) :
             Base(subGrid, subGrid->getHostGrid().levelGridView(level).template end<codim>()),
             hostLevelEndIterator_(hostIterator_)
         {}