diff --git a/dune/istl/bccsmatrixinitializer.hh b/dune/istl/bccsmatrixinitializer.hh
index 11690dfe41f3bd3d45f3f7a489ae0676ecbc9632..596fcb7b324ef061a032e66e97f563238ec4c758 100644
--- a/dune/istl/bccsmatrixinitializer.hh
+++ b/dune/istl/bccsmatrixinitializer.hh
@@ -7,7 +7,6 @@
 #include <set>
 
 #include <dune/common/typetraits.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/scalarmatrixview.hh>
 
 #include <dune/istl/bccsmatrix.hh>
@@ -187,9 +186,8 @@ namespace Dune::ISTL::Impl
     }
 
     template<typename Iter, typename CIter>
-    void countEntries(const Iter& row, const CIter& col) const
+    void countEntries([[maybe_unused]] const Iter& row, const CIter& col) const
     {
-      DUNE_UNUSED_PARAMETER(row);
       countEntries(col.index());
     }
 
diff --git a/dune/istl/bvector.hh b/dune/istl/bvector.hh
index 8734053bf0aa89cf7229f4bec40a0f707c8caff6..aec1b370cf0dd341d057b83b8655093e8e654022 100644
--- a/dune/istl/bvector.hh
+++ b/dune/istl/bvector.hh
@@ -19,7 +19,6 @@
 #include <dune/common/fvector.hh>
 #include <dune/common/promotiontraits.hh>
 #include <dune/common/typetraits.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/scalarvectorview.hh>
 
 #include <dune/istl/blocklevel.hh>
@@ -473,7 +472,7 @@ namespace Imp {
      */
     void reserve(size_type capacity)
     {
-      DUNE_UNUSED const auto &guard =
+      [[maybe_unused]] const auto &guard =
         Imp::makeScopeGuard([this]{ syncBaseArray(); });
       storage_.reserve(capacity);
     }
@@ -501,7 +500,7 @@ namespace Imp {
      */
     void resize(size_type size)
     {
-      DUNE_UNUSED const auto &guard =
+      [[maybe_unused]] const auto &guard =
         Imp::makeScopeGuard([this]{ syncBaseArray(); });
       storage_.resize(size);
     }
@@ -525,7 +524,7 @@ namespace Imp {
     BlockVector& operator= (const BlockVector& a)
       noexcept(noexcept(std::declval<BlockVector>().storage_ = a.storage_))
     {
-      DUNE_UNUSED const auto &guard =
+      [[maybe_unused]] const auto &guard =
         Imp::makeScopeGuard([this]{ syncBaseArray(); });
       storage_ = a.storage_;
       return *this;
@@ -544,7 +543,7 @@ namespace Imp {
       noexcept(noexcept(
             std::declval<BlockVector&>().storage_.swap(other.storage_)))
     {
-      DUNE_UNUSED const auto &guard = Imp::makeScopeGuard([&]{
+      [[maybe_unused]] const auto &guard = Imp::makeScopeGuard([&]{
           syncBaseArray();
           other.syncBaseArray();
         });
diff --git a/dune/istl/cholmod.hh b/dune/istl/cholmod.hh
index bdaa7bd8810b4f8beac771e1cd4bbb4bd4aafa79..9a67f0f18e0bc27586793d77b9514370f06c7e8e 100644
--- a/dune/istl/cholmod.hh
+++ b/dune/istl/cholmod.hh
@@ -83,9 +83,8 @@ public:
 
   /** @brief simple forward to apply(X&, Y&, InverseOperatorResult&)
     */
-  void apply (X& x, B& b, double reduction, InverseOperatorResult& res)
+  void apply (X& x, B& b, [[maybe_unused]] double reduction, InverseOperatorResult& res)
   {
-    DUNE_UNUSED_PARAMETER(reduction);
     apply(x,b,res);
   }
 
diff --git a/dune/istl/io.hh b/dune/istl/io.hh
index eba142e075f0ad14c6d8f21d3ab5d7afc3fd3b4a..cddc248566da7d7e46952ce8b34e29fb7e2eb73e 100644
--- a/dune/istl/io.hh
+++ b/dune/istl/io.hh
@@ -16,7 +16,6 @@
 #include <dune/common/fvector.hh>
 #include <dune/common/fmatrix.hh>
 #include <dune/common/hybridutilities.hh>
-#include <dune/common/unused.hh>
 
 #include <dune/istl/bcrsmatrix.hh>
 
@@ -128,9 +127,8 @@ namespace Dune {
    * #include <dune/istl/io.hh>
    * \endcode
    */
-  inline void fill_row (std::ostream& s, int m, int width, int precision)
+  inline void fill_row (std::ostream& s, int m, int width, [[maybe_unused]] int precision)
   {
-    DUNE_UNUSED_PARAMETER(precision);
     for (int j=0; j<m; j++)
     {
       s << " ";         // space in front of each entry
@@ -148,17 +146,13 @@ namespace Dune {
    */
   template<class K>
   void print_row (std::ostream& s, const K& value,
-                  typename FieldMatrix<K,1,1>::size_type I,
-                  typename FieldMatrix<K,1,1>::size_type J,
-                  typename FieldMatrix<K,1,1>::size_type therow,
-                  int width, int precision,
+                  [[maybe_unused]] typename FieldMatrix<K,1,1>::size_type I,
+                  [[maybe_unused]] typename FieldMatrix<K,1,1>::size_type J,
+                  [[maybe_unused]] typename FieldMatrix<K,1,1>::size_type therow,
+                  int width,
+                  [[maybe_unused]] int precision,
                   typename std::enable_if_t<Dune::IsNumber<K>::value>* sfinae = nullptr)
   {
-    DUNE_UNUSED_PARAMETER(I);
-    DUNE_UNUSED_PARAMETER(J);
-    DUNE_UNUSED_PARAMETER(therow);
-    DUNE_UNUSED_PARAMETER(precision);
-
     s << " ";         // space in front of each entry
     s.width(width);   // set width for each entry anew
     s << value;
diff --git a/dune/istl/ldl.hh b/dune/istl/ldl.hh
index 569ea0c0cdd43de1e3be23fb8887b1f06c5c80c6..24a35d62f8e95921914cd0a160d69566ec8a8999 100644
--- a/dune/istl/ldl.hh
+++ b/dune/istl/ldl.hh
@@ -18,7 +18,6 @@ extern "C"
 #endif
 
 #include <dune/common/exceptions.hh>
-#include <dune/common/unused.hh>
 
 #include <dune/istl/bccsmatrixinitializer.hh>
 #include <dune/istl/solvers.hh>
@@ -162,9 +161,8 @@ namespace Dune {
     }
 
     /** \copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&) */
-    virtual void apply(domain_type& x, range_type& b, double reduction, InverseOperatorResult& res)
+    virtual void apply(domain_type& x, range_type& b, [[maybe_unused]] double reduction, InverseOperatorResult& res)
     {
-      DUNE_UNUSED_PARAMETER(reduction);
       apply(x,b,res);
     }
 
@@ -183,11 +181,8 @@ namespace Dune {
       ldl_permt(dimMat, x, Y_, P_);
     }
 
-    void setOption(unsigned int option, double value)
-    {
-      DUNE_UNUSED_PARAMETER(option);
-      DUNE_UNUSED_PARAMETER(value);
-    }
+    void setOption([[maybe_unused]] unsigned int option, [[maybe_unused]] double value)
+    {}
 
     /** @brief Initialize data from given matrix. */
     void setMatrix(const Matrix& matrix)
diff --git a/dune/istl/matrix.hh b/dune/istl/matrix.hh
index 7f4bb9afc0bee2318e29315141507664aa4e7464..71526248f7f36a17f80d8271460f3e2b5ecade23 100644
--- a/dune/istl/matrix.hh
+++ b/dune/istl/matrix.hh
@@ -1063,13 +1063,11 @@ namespace MatrixImp
     //===== query
 
     //! return true if (i,j) is in pattern
-    bool exists (size_type i, size_type j) const
+    bool exists ([[maybe_unused]] size_type i, [[maybe_unused]] size_type j) const
     {
 #ifdef DUNE_ISTL_WITH_CHECKING
       if (i<0 || i>=N()) DUNE_THROW(ISTLError,"row index out of range");
       if (j<0 || i>=M()) DUNE_THROW(ISTLError,"column index out of range");
-#else
-      DUNE_UNUSED_PARAMETER(i);  DUNE_UNUSED_PARAMETER(j);
 #endif
       return true;
     }
diff --git a/dune/istl/matrixmarket.hh b/dune/istl/matrixmarket.hh
index 8780f1e0078e13bf72c3fd39beae88f60988355e..19f88c11fc45d3deaa3fe8d9f1396886b2c915b2 100644
--- a/dune/istl/matrixmarket.hh
+++ b/dune/istl/matrixmarket.hh
@@ -22,7 +22,6 @@
 #include <dune/common/exceptions.hh>
 #include <dune/common/fmatrix.hh>
 #include <dune/common/fvector.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/hybridutilities.hh>
 #include <dune/common/stdstreams.hh>
 
@@ -614,9 +613,8 @@ namespace Dune
       return is>>num.number;
     }
 
-    inline std::istream& operator>>(std::istream& is, NumericWrapper<PatternDummy>& num)
+    inline std::istream& operator>>(std::istream& is, [[maybe_unused]] NumericWrapper<PatternDummy>& num)
     {
-      DUNE_UNUSED_PARAMETER(num);
       return is;
     }
 
diff --git a/dune/istl/matrixmatrix.hh b/dune/istl/matrixmatrix.hh
index 3a3374280151204136f28d4e9516a383aa9c4fc0..8b4d45452b371670f775a579cc1b8d935972c9c9 100644
--- a/dune/istl/matrixmatrix.hh
+++ b/dune/istl/matrixmatrix.hh
@@ -420,9 +420,8 @@ namespace Dune
       {}
 
       template<class T1, class T2>
-      void operator()(const T1& t1, const T2& t2, size_type i)
+      void operator()(const T1& t1, const T2& t2, [[maybe_unused]] size_type i)
       {
-        DUNE_UNUSED_PARAMETER(i);
         assert(this->col.index()==i);
         addMatMultTransposeMat(*this->col,t1,t2);
       }
@@ -557,9 +556,8 @@ namespace Dune
    */
   template<class T, class A, class A1, class A2, int n, int m, int k>
   void matMultTransposeMat(BCRSMatrix<FieldMatrix<T,n,k>,A>& res, const BCRSMatrix<FieldMatrix<T,n,m>,A1>& mat,
-                           const BCRSMatrix<FieldMatrix<T,k,m>,A2>& matt, bool tryHard=false)
+                           const BCRSMatrix<FieldMatrix<T,k,m>,A2>& matt, [[maybe_unused]] bool tryHard=false)
   {
-    DUNE_UNUSED_PARAMETER(tryHard);
     matMultMat<2>(res,mat, matt);
   }
 
@@ -588,9 +586,8 @@ namespace Dune
    */
   template<class T, class A, class A1, class A2, int n, int m, int k>
   void transposeMatMultMat(BCRSMatrix<FieldMatrix<T,n,m>,A>& res, const BCRSMatrix<FieldMatrix<T,k,n>,A1>& mat,
-                           const BCRSMatrix<FieldMatrix<T,k,m>,A2>& matt, bool tryHard=false)
+                           const BCRSMatrix<FieldMatrix<T,k,m>,A2>& matt, [[maybe_unused]] bool tryHard=false)
   {
-    DUNE_UNUSED_PARAMETER(tryHard);
     matMultMat<1>(res,mat, matt);
   }
 
diff --git a/dune/istl/matrixredistribute.hh b/dune/istl/matrixredistribute.hh
index cb5731b02ca4e7cf9fc254d427d7a1cd8f95f81e..7170b6368e2e96cc324e58219d92f6c335559f49 100644
--- a/dune/istl/matrixredistribute.hh
+++ b/dune/istl/matrixredistribute.hh
@@ -6,7 +6,6 @@
 #include "repartition.hh"
 #include <dune/common/exceptions.hh>
 #include <dune/common/parallel/indexset.hh>
-#include <dune/common/unused.hh>
 #include <dune/istl/owneroverlapcopy.hh>
 #include <dune/istl/paamg/pinfo.hh>
 /**
@@ -24,52 +23,37 @@ namespace Dune
       return false;
     }
     template<class D>
-    void redistribute(const D& from, D& to) const
-    {
-      DUNE_UNUSED_PARAMETER(from);
-      DUNE_UNUSED_PARAMETER(to);
-    }
+    void redistribute([[maybe_unused]] const D& from, [[maybe_unused]] D& to) const
+    {}
 
     template<class D>
-    void redistributeBackward(D& from, const D& to) const
-    {
-      DUNE_UNUSED_PARAMETER(from);
-      DUNE_UNUSED_PARAMETER(to);
-    }
+    void redistributeBackward([[maybe_unused]] D& from, [[maybe_unused]]const D& to) const
+    {}
 
     void resetSetup()
     {}
 
-    void setNoRows(std::size_t size)
-    {
-      DUNE_UNUSED_PARAMETER(size);
-    }
+    void setNoRows([[maybe_unused]] std::size_t size)
+    {}
 
-    void setNoCopyRows(std::size_t size)
-    {
-      DUNE_UNUSED_PARAMETER(size);
-    }
+    void setNoCopyRows([[maybe_unused]] std::size_t size)
+    {}
 
-    void setNoBackwardsCopyRows(std::size_t size)
-    {
-      DUNE_UNUSED_PARAMETER(size);
-    }
+    void setNoBackwardsCopyRows([[maybe_unused]] std::size_t size)
+    {}
 
-    std::size_t getRowSize(std::size_t index) const
+    std::size_t getRowSize([[maybe_unused]] std::size_t index) const
     {
-      DUNE_UNUSED_PARAMETER(index);
       return -1;
     }
 
-    std::size_t getCopyRowSize(std::size_t index) const
+    std::size_t getCopyRowSize([[maybe_unused]] std::size_t index) const
     {
-      DUNE_UNUSED_PARAMETER(index);
       return -1;
     }
 
-    std::size_t getBackwardsCopyRowSize(std::size_t index) const
+    std::size_t getBackwardsCopyRowSize([[maybe_unused]] std::size_t index) const
     {
-      DUNE_UNUSED_PARAMETER(index);
       return -1;
     }
 
@@ -564,9 +548,8 @@ namespace Dune
         }
       }
     }
-    static void scatter(Container& cont, const GlobalIndex& gi, std::size_t i, std::size_t j)
+    static void scatter(Container& cont, const GlobalIndex& gi, std::size_t i, [[maybe_unused]] std::size_t j)
     {
-      DUNE_UNUSED_PARAMETER(j);
       try{
         if (gi != std::numeric_limits<GlobalIndex>::max()) {
           const typename I::IndexPair& ip=cont.aggidxset.at(gi);
@@ -650,9 +633,8 @@ namespace Dune
         return datastore;
       }
     }
-    static void scatter(Container& cont, const Data& data, std::size_t i, std::size_t j)
+    static void scatter(Container& cont, const Data& data, std::size_t i, [[maybe_unused]] std::size_t j)
     {
-      DUNE_UNUSED_PARAMETER(j);
       try{
         if (data.first != std::numeric_limits<GlobalIndex>::max()) {
           typename M::size_type column=cont.aggidxset.at(data.first).local();
diff --git a/dune/istl/matrixutils.hh b/dune/istl/matrixutils.hh
index 5ec10838f262c5b765ae5f7193cc631f2049847a..f8f47a5ea5f6cf2bf3eb6438fb823605eefe7ecd 100644
--- a/dune/istl/matrixutils.hh
+++ b/dune/istl/matrixutils.hh
@@ -10,7 +10,6 @@
 #include <dune/common/fmatrix.hh>
 #include <dune/common/dynmatrix.hh>
 #include <dune/common/diagonalmatrix.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/scalarmatrixview.hh>
 #include <dune/istl/scaledidmatrix.hh>
 #include "istlexception.hh"
@@ -49,9 +48,8 @@ namespace Dune
      * @brief Check whether the a matrix has diagonal values
      * on blocklevel recursion levels.
      */
-    static void check(const Matrix& mat)
+    static void check([[maybe_unused]] const Matrix& mat)
     {
-      DUNE_UNUSED_PARAMETER(mat);
 #ifdef DUNE_ISTL_WITH_CHECKING
       typedef typename Matrix::ConstRowIterator Row;
       typedef typename Matrix::ConstColIterator Entry;
diff --git a/dune/istl/multitypeblockmatrix.hh b/dune/istl/multitypeblockmatrix.hh
index 86c9133b77f6f3549e8d0b7f21fe5fa4b7e1e771..22b5b7c8b44c72960654c5d23fa82bbcecfe6162 100644
--- a/dune/istl/multitypeblockmatrix.hh
+++ b/dune/istl/multitypeblockmatrix.hh
@@ -95,9 +95,9 @@ namespace Dune {
      */
     template< size_type index >
     auto
-    operator[] ( const std::integral_constant< size_type, index > indexVariable ) -> decltype(std::get<index>(*this))
+    operator[] ([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable)
+                -> decltype(std::get<index>(*this))
     {
-      DUNE_UNUSED_PARAMETER(indexVariable);
       return std::get<index>(*this);
     }
 
@@ -108,9 +108,9 @@ namespace Dune {
      */
     template< size_type index >
     auto
-    operator[] ( const std::integral_constant< size_type, index > indexVariable ) const -> decltype(std::get<index>(*this))
+    operator[] ([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable) const
+                -> decltype(std::get<index>(*this))
     {
-      DUNE_UNUSED_PARAMETER(indexVariable);
       return std::get<index>(*this);
     }
 
diff --git a/dune/istl/multitypeblockvector.hh b/dune/istl/multitypeblockvector.hh
index e165b56ac5f0c64a03dc7547ab87a561d8fa0fed..46aecee1ebdb9bfb3ee0c1040729fbb5322dc89d 100644
--- a/dune/istl/multitypeblockvector.hh
+++ b/dune/istl/multitypeblockvector.hh
@@ -139,9 +139,8 @@ namespace Dune {
      */
     template< size_type index >
     typename std::tuple_element<index,TupleType>::type&
-    operator[] ( const std::integral_constant< size_type, index > indexVariable )
+    operator[] ([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable)
     {
-      DUNE_UNUSED_PARAMETER(indexVariable);
       return std::get<index>(*this);
     }
 
@@ -152,9 +151,8 @@ namespace Dune {
      */
     template< size_type index >
     const typename std::tuple_element<index,TupleType>::type&
-    operator[] ( const std::integral_constant< size_type, index > indexVariable ) const
+    operator[] ([[maybe_unused]] const std::integral_constant< size_type, index > indexVariable) const
     {
-      DUNE_UNUSED_PARAMETER(indexVariable);
       return std::get<index>(*this);
     }
 
diff --git a/dune/istl/overlappingschwarz.hh b/dune/istl/overlappingschwarz.hh
index 5b27847cd9b43613d68cd2d50682e59cc872955d..c4230ed48c82692f183554c0365fa0b402c4e7f5 100644
--- a/dune/istl/overlappingschwarz.hh
+++ b/dune/istl/overlappingschwarz.hh
@@ -10,7 +10,6 @@
 #include <set>
 #include <dune/common/dynmatrix.hh>
 #include <dune/common/sllist.hh>
-#include <dune/common/unused.hh>
 
 #include <dune/istl/bccsmatrixinitializer.hh>
 #include "preconditioners.hh"
@@ -842,11 +841,8 @@ namespace Dune
 
        \copydoc Preconditioner::pre(X&,Y&)
      */
-    virtual void pre (X& x, X& b)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-      DUNE_UNUSED_PARAMETER(b);
-    }
+    virtual void pre ([[maybe_unused]] X& x, [[maybe_unused]] X& b)
+    {}
 
     /*!
        \brief Apply the precondtioner
@@ -860,10 +856,8 @@ namespace Dune
 
        \copydoc Preconditioner::post(X&)
      */
-    virtual void post (X& x)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-    }
+    virtual void post ([[maybe_unused]] X& x)
+    {}
 
     template<bool forward>
     void apply(X& v, const X& d);
@@ -1123,16 +1117,12 @@ namespace Dune
   template<class RowToDomain, class Solvers, class SubDomains>
   std::size_t
   SeqOverlappingSchwarzAssemblerHelper< DynamicMatrixSubdomainSolver< BCRSMatrix< K, Al>, X, Y >,false>::
-  assembleLocalProblems(const RowToDomain& rowToDomain,
-                        const matrix_type& mat,
-                        Solvers& solvers,
+  assembleLocalProblems([[maybe_unused]] const RowToDomain& rowToDomain,
+                        [[maybe_unused]] const matrix_type& mat,
+                        [[maybe_unused]] Solvers& solvers,
                         const SubDomains& subDomains,
-                        bool onTheFly)
+                        [[maybe_unused]] bool onTheFly)
   {
-    DUNE_UNUSED_PARAMETER(onTheFly);
-    DUNE_UNUSED_PARAMETER(rowToDomain);
-    DUNE_UNUSED_PARAMETER(mat);
-    DUNE_UNUSED_PARAMETER(solvers);
     typedef typename SubDomains::const_iterator DomainIterator;
     std::size_t maxlength = 0;
 
@@ -1203,13 +1193,12 @@ namespace Dune
 
   template<class M,class X,class Y>
   template<class RowToDomain, class Solvers, class SubDomains>
-  std::size_t SeqOverlappingSchwarzAssemblerILUBase<M,X,Y>::assembleLocalProblems(const RowToDomain& rowToDomain,
+  std::size_t SeqOverlappingSchwarzAssemblerILUBase<M,X,Y>::assembleLocalProblems([[maybe_unused]] const RowToDomain& rowToDomain,
                                                                                   const matrix_type& mat,
                                                                                   Solvers& solvers,
                                                                                   const SubDomains& subDomains,
                                                                                   bool onTheFly)
   {
-    DUNE_UNUSED_PARAMETER(rowToDomain);
     typedef typename SubDomains::const_iterator DomainIterator;
     typedef typename Solvers::iterator SolverIterator;
     std::size_t maxlength = 0;
@@ -1580,13 +1569,11 @@ namespace Dune
 
   template<typename S, typename T, typename A>
   MultiplicativeAdder<S,BlockVector<T,A> >
-  ::MultiplicativeAdder(BlockVector<T,A>& v_,
+  ::MultiplicativeAdder([[maybe_unused]] BlockVector<T,A>& v_,
                         BlockVector<T,A>& x_,
                         OverlappingAssigner<S>& assigner_, const field_type& relax_)
     : x(&x_), assigner(&assigner_), relax(relax_)
-  {
-    DUNE_UNUSED_PARAMETER(v_);
-  }
+  {}
 
 
   template<typename S,typename T, typename A>
diff --git a/dune/istl/paamg/aggregates.hh b/dune/istl/paamg/aggregates.hh
index 2cdcaa5becd79fcbfcd0da306360fb0a6f51c5e6..a50e7a1ed0c797f3dd4dd61dbaac779e0a22b1c8 100644
--- a/dune/istl/paamg/aggregates.hh
+++ b/dune/istl/paamg/aggregates.hh
@@ -13,7 +13,6 @@
 #include <dune/common/stdstreams.hh>
 #include <dune/common/poolallocator.hh>
 #include <dune/common/sllist.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/ftraits.hh>
 #include <dune/common/scalarmatrixview.hh>
 
@@ -597,10 +596,8 @@ namespace Dune
       {
       public:
         template<class EdgeIterator>
-        void operator()(const EdgeIterator& edge) const
-        {
-          DUNE_UNUSED_PARAMETER(edge);
-        }
+        void operator()([[maybe_unused]] const EdgeIterator& edge) const
+        {}
       };
 
 
@@ -1415,10 +1412,9 @@ namespace Dune
     }
 
     template<class M, class N>
-    inline void SymmetricDependency<M,N>::initRow(const Row& row, int index, const std::true_type&)
+    inline void SymmetricDependency<M,N>::initRow([[maybe_unused]] const Row& row, int index, const std::true_type&)
     {
       using std::min;
-      DUNE_UNUSED_PARAMETER(row);
       maxValue_ = min(- std::numeric_limits<typename Matrix::field_type>::max(), std::numeric_limits<typename Matrix::field_type>::min());
       row_ = index;
       diagonal_ = norm_(matrix_->operator[](row_)[row_]);
@@ -1485,10 +1481,9 @@ namespace Dune
     }
 
     template<class M, class N>
-    inline void Dependency<M,N>::initRow(const Row& row, int index)
+    inline void Dependency<M,N>::initRow([[maybe_unused]] const Row& row, int index)
     {
       using std::min;
-      DUNE_UNUSED_PARAMETER(row);
       maxValue_ = min(- std::numeric_limits<real_type>::max(), std::numeric_limits<real_type>::min());
       row_ = index;
       diagonal_ = norm_(matrix_->operator[](row_)[row_]);
diff --git a/dune/istl/paamg/amg.hh b/dune/istl/paamg/amg.hh
index 41a9eeb4c484be96fa6a1b2aac2cee4b26b4b5a6..619374cbad1f8beef1596af6dc392714b30e674d 100644
--- a/dune/istl/paamg/amg.hh
+++ b/dune/istl/paamg/amg.hh
@@ -1128,9 +1128,8 @@ namespace Dune
 
     /** \copydoc Preconditioner::post */
     template<class M, class X, class S, class PI, class A>
-    void AMG<M,X,S,PI,A>::post(Domain& x)
+    void AMG<M,X,S,PI,A>::post([[maybe_unused]] Domain& x)
     {
-      DUNE_UNUSED_PARAMETER(x);
       // Postprocess all smoothers
       typedef typename Hierarchy<Smoother,A>::Iterator Iterator;
       typedef typename Hierarchy<Domain,A>::Iterator DIterator;
diff --git a/dune/istl/paamg/combinedfunctor.hh b/dune/istl/paamg/combinedfunctor.hh
index 79afdcdf0defeab0d8db1382734f036122ca29d4..d77c3490dbcd77e92c65d67fa81d06cccab58607 100644
--- a/dune/istl/paamg/combinedfunctor.hh
+++ b/dune/istl/paamg/combinedfunctor.hh
@@ -5,8 +5,6 @@
 
 #include <tuple>
 
-#include <dune/common/unused.hh>
-
 namespace Dune
 {
   namespace Amg
@@ -26,11 +24,8 @@ namespace Dune
     struct ApplyHelper<0>
     {
       template<class TT, class T>
-      static void apply(TT tuple, const T& t)
-      {
-        DUNE_UNUSED_PARAMETER(tuple);
-        DUNE_UNUSED_PARAMETER(t);
-      }
+      static void apply([[maybe_unused]] TT tuple, [[maybe_unused]] const T& t)
+      {}
     };
 
     template<typename T>
diff --git a/dune/istl/paamg/construction.hh b/dune/istl/paamg/construction.hh
index 883896cea6c6a147c070d496d5a5e42be29651d2..a25a81d861b658a382b047f06a0dee412949b90b 100644
--- a/dune/istl/paamg/construction.hh
+++ b/dune/istl/paamg/construction.hh
@@ -3,7 +3,6 @@
 #ifndef DUNE_AMGCONSTRUCTION_HH
 #define DUNE_AMGCONSTRUCTION_HH
 
-#include <dune/common/unused.hh>
 #include <dune/istl/bvector.hh>
 #include <dune/istl/operators.hh>
 #include <dune/istl/owneroverlapcopy.hh>
@@ -89,11 +88,9 @@ namespace Dune
 
     struct SequentialCommunicationArgs
     {
-      SequentialCommunicationArgs(CollectiveCommunication<void*> comm, int cat)
+      SequentialCommunicationArgs(CollectiveCommunication<void*> comm, [[maybe_unused]] int cat)
         : comm_(comm)
-      {
-        DUNE_UNUSED_PARAMETER(cat);
-      }
+      {}
 
       CollectiveCommunication<void*> comm_;
     };
diff --git a/dune/istl/paamg/dependency.hh b/dune/istl/paamg/dependency.hh
index 361bf87fc63ec7468480bd3e414a6e144e944181..f90e29ecfcf0824187adc0687e1adf636ff0aa1c 100644
--- a/dune/istl/paamg/dependency.hh
+++ b/dune/istl/paamg/dependency.hh
@@ -10,7 +10,6 @@
 #include "graph.hh"
 #include "properties.hh"
 #include <dune/common/propertymap.hh>
-#include <dune/common/unused.hh>
 
 
 namespace Dune
@@ -289,9 +288,8 @@ namespace Dune
 
   template<typename G, typename EP, typename VM, typename EM>
   typename PropertyMapTypeSelector<Amg::VertexVisitedTag,Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM> >::Type
-  get(const Amg::VertexVisitedTag& tag, Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM>& graph)
+  get([[maybe_unused]] const Amg::VertexVisitedTag& tag, Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM>& graph)
   {
-    DUNE_UNUSED_PARAMETER(tag);
     return Amg::PropertyGraphVertexPropertyMap<Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM>, Amg::VertexProperties::VISITED>(graph);
   }
 
diff --git a/dune/istl/paamg/fastamg.hh b/dune/istl/paamg/fastamg.hh
index 38064873f9c200424a9f8d04758954b1715c086d..ccaeea4c2e95c7597699316edc283324c65b5b8f 100644
--- a/dune/istl/paamg/fastamg.hh
+++ b/dune/istl/paamg/fastamg.hh
@@ -6,7 +6,6 @@
 #include <memory>
 #include <dune/common/exceptions.hh>
 #include <dune/common/typetraits.hh>
-#include <dune/common/unused.hh>
 #include <dune/istl/paamg/smoother.hh>
 #include <dune/istl/paamg/transfer.hh>
 #include <dune/istl/paamg/matrixhierarchy.hh>
@@ -691,9 +690,8 @@ namespace Dune
 
     /** \copydoc Preconditioner::post */
     template<class M, class X, class PI, class A>
-    void FastAMG<M,X,PI,A>::post(Domain& x)
+    void FastAMG<M,X,PI,A>::post([[maybe_unused]] Domain& x)
     {
-      DUNE_UNUSED_PARAMETER(x);
       lhs_=nullptr;
       rhs_=nullptr;
       residual_=nullptr;
diff --git a/dune/istl/paamg/galerkin.hh b/dune/istl/paamg/galerkin.hh
index 30b6880c947556e0af885294e6d05ac1b6dc95cb..1d77e5095b15b14209b507a9b9b377d2d9e99e12 100644
--- a/dune/istl/paamg/galerkin.hh
+++ b/dune/istl/paamg/galerkin.hh
@@ -7,7 +7,6 @@
 #include "pinfo.hh"
 #include <dune/common/poolallocator.hh>
 #include <dune/common/enumset.hh>
-#include <dune/common/unused.hh>
 #include <set>
 #include <limits>
 #include <algorithm>
@@ -493,11 +492,10 @@ namespace Dune
     template<class V, class R>
     void ConnectivityConstructor<G,SequentialInformation>::examine(G& graph,
                                                                    V& visitedMap,
-                                                                   const SequentialInformation& pinfo,
+                                                                   [[maybe_unused]] const SequentialInformation& pinfo,
                                                                    const AggregatesMap<Vertex>& aggregates,
                                                                    R& row)
     {
-      DUNE_UNUSED_PARAMETER(pinfo);
       typedef typename G::VertexIterator VertexIterator;
 
       VertexIterator vend=graph.end();
@@ -614,9 +612,8 @@ namespace Dune
                                                   const SequentialInformation& pinfo,
                                                   const AggregatesMap<typename G::VertexDescriptor>& aggregates,
                                                   const typename G::Matrix::size_type& size,
-                                                  const Set& overlap)
+                                                  [[maybe_unused]] const Set& overlap)
     {
-      DUNE_UNUSED_PARAMETER(overlap);
       typedef typename G::MutableMatrix M;
       M* coarseMatrix = new M(size, size, M::row_wise);
 
@@ -642,9 +639,8 @@ namespace Dune
 
     template<class M, class V, class P, class O>
     void BaseGalerkinProduct::calculate(const M& fine, const AggregatesMap<V>& aggregates, M& coarse,
-                                        const P& pinfo, const O& copy)
+                                        const P& pinfo, [[maybe_unused]] const O& copy)
     {
-      DUNE_UNUSED_PARAMETER(copy);
       coarse = static_cast<typename M::field_type>(0);
 
       typedef typename M::ConstIterator RowIterator;
diff --git a/dune/istl/paamg/globalaggregates.hh b/dune/istl/paamg/globalaggregates.hh
index 03640a9f8c2a56d795b74d2a4419aeb75259bb46..353899c6034f524a024327dad2de3ec0a442c012 100644
--- a/dune/istl/paamg/globalaggregates.hh
+++ b/dune/istl/paamg/globalaggregates.hh
@@ -16,7 +16,6 @@
 #include "aggregates.hh"
 #include "pinfo.hh"
 #include <dune/common/parallel/indexset.hh>
-#include <dune/common/unused.hh>
 
 namespace Dune
 {
@@ -222,14 +221,10 @@ namespace Dune
       typedef SequentialInformation ParallelInformation;
       typedef typename ParallelInformation::GlobalLookupIndexSet GlobalLookupIndexSet;
 
-      static void publish(AggregatesMap<Vertex>& aggregates,
-                          ParallelInformation& pinfo,
-                          const GlobalLookupIndexSet& globalLookup)
-      {
-        DUNE_UNUSED_PARAMETER(aggregates);
-        DUNE_UNUSED_PARAMETER(pinfo);
-        DUNE_UNUSED_PARAMETER(globalLookup);
-      }
+      static void publish([[maybe_unused]] AggregatesMap<Vertex>& aggregates,
+                          [[maybe_unused]] ParallelInformation& pinfo,
+                          [[maybe_unused]] const GlobalLookupIndexSet& globalLookup)
+      {}
     };
 
   } // end Amg namespace
diff --git a/dune/istl/paamg/graphcreator.hh b/dune/istl/paamg/graphcreator.hh
index 859fbe7a63c231acfbca24824a8b2610b32f4b4f..39e97980d6d979bc03b3cba675031f260f3c034d 100644
--- a/dune/istl/paamg/graphcreator.hh
+++ b/dune/istl/paamg/graphcreator.hh
@@ -10,7 +10,6 @@
 #include "pinfo.hh"
 #include <dune/istl/operators.hh>
 #include <dune/istl/bcrsmatrix.hh>
-#include <dune/common/unused.hh>
 
 namespace Dune
 {
@@ -72,12 +71,10 @@ namespace Dune
       typedef std::tuple<MatrixGraph*,PropertiesGraph*> GraphTuple;
 
       template<class OF, class T>
-      static GraphTuple create(const M& matrix, T& excluded,
-                               const SequentialInformation& pinfo,
+      static GraphTuple create([[maybe_unused]] const M& matrix, T& excluded,
+                               [[maybe_unused]] const SequentialInformation& pinfo,
                                const OF&)
       {
-        DUNE_UNUSED_PARAMETER(excluded);
-        DUNE_UNUSED_PARAMETER(pinfo);
         MatrixGraph* mg = new MatrixGraph(matrix.getmat());
         PropertiesGraph* pg = new PropertiesGraph(*mg, IdentityMap(), IdentityMap());
         return GraphTuple(mg,pg);
diff --git a/dune/istl/paamg/hierarchy.hh b/dune/istl/paamg/hierarchy.hh
index fa205daf82d29b8e3f5e1a6b2a83541b1863eb56..54ad243203dbbcff5f0a14c7c2470c7a9487f322 100644
--- a/dune/istl/paamg/hierarchy.hh
+++ b/dune/istl/paamg/hierarchy.hh
@@ -7,7 +7,6 @@
 #include <memory>
 #include <limits>
 #include <dune/common/stdstreams.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/timer.hh>
 #include <dune/common/bigunsignedint.hh>
 #include <dune/istl/paamg/construction.hh>
diff --git a/dune/istl/paamg/indicescoarsener.hh b/dune/istl/paamg/indicescoarsener.hh
index e486add4d68ed9dd2dc20484684460a46d4c6019..269bf197c70e60c22f1cc0c409ad97aefa109655 100644
--- a/dune/istl/paamg/indicescoarsener.hh
+++ b/dune/istl/paamg/indicescoarsener.hh
@@ -4,7 +4,6 @@
 #define DUNE_AMG_INDICESCOARSENER_HH
 
 #include <dune/common/parallel/indicessyncer.hh>
-#include <dune/common/unused.hh>
 #include <vector>
 #include "renumberer.hh"
 
@@ -123,9 +122,8 @@ namespace Dune
           }
         }
 
-        Vertex operator()(const GlobalIndex& global)
+        Vertex operator()([[maybe_unused]] const GlobalIndex& global)
         {
-          DUNE_UNUSED_PARAMETER(global);
           Vertex current = this->number_;
           this->operator++();
           return current;
@@ -231,9 +229,8 @@ namespace Dune
                                            VM& visitedMap,
                                            AggregatesMap<typename Graph::VertexDescriptor>& aggregates,
                                            ParallelInformation& coarseInfo,
-                                           typename Graph::VertexDescriptor noAggregates)
+                                           [[maybe_unused]] typename Graph::VertexDescriptor noAggregates)
     {
-      DUNE_UNUSED_PARAMETER(noAggregates);
       ParallelAggregateRenumberer<Graph,typename ParallelInformation::GlobalLookupIndexSet> renumberer(aggregates, fineInfo.globalLookup());
       buildCoarseIndexSet(fineInfo, fineGraph, visitedMap, aggregates,
                           coarseInfo.indexSet(), renumberer);
@@ -388,19 +385,14 @@ namespace Dune
     template<typename E>
     template<typename Graph, typename VM>
     typename Graph::VertexDescriptor
-    IndicesCoarsener<SequentialInformation,E>::coarsen(const SequentialInformation& fineInfo,
-                                                       Graph& fineGraph,
-                                                       VM& visitedMap,
-                                                       AggregatesMap<typename Graph::VertexDescriptor>& aggregates,
-                                                       SequentialInformation& coarseInfo,
-                                                       typename Graph::VertexDescriptor noAggregates)
+    IndicesCoarsener<SequentialInformation,E>::coarsen(
+      [[maybe_unused]] const SequentialInformation& fineInfo,
+      [[maybe_unused]] Graph& fineGraph,
+      [[maybe_unused]] VM& visitedMap,
+      [[maybe_unused]] AggregatesMap<typename Graph::VertexDescriptor>& aggregates,
+      [[maybe_unused]] SequentialInformation& coarseInfo,
+      [[maybe_unused]] typename Graph::VertexDescriptor noAggregates)
     {
-      DUNE_UNUSED_PARAMETER(fineInfo);
-      DUNE_UNUSED_PARAMETER(fineGraph);
-      DUNE_UNUSED_PARAMETER(visitedMap);
-      DUNE_UNUSED_PARAMETER(aggregates);
-      DUNE_UNUSED_PARAMETER(coarseInfo);
-      DUNE_UNUSED_PARAMETER(noAggregates);
       return noAggregates;
     }
 
diff --git a/dune/istl/paamg/kamg.hh b/dune/istl/paamg/kamg.hh
index 5a0c5b69dd536032671ad732910c748a95863dc6..a6490d30229c691f992018453da1a5af18f0338c 100644
--- a/dune/istl/paamg/kamg.hh
+++ b/dune/istl/paamg/kamg.hh
@@ -53,16 +53,12 @@ namespace Dune
       {}
 
       /**  \copydoc Preconditioner::pre(X&,Y&) */
-      void pre(typename AMG::Domain& x, typename AMG::Range& b)
-      {
-        DUNE_UNUSED_PARAMETER(x); DUNE_UNUSED_PARAMETER(b);
-      }
+      void pre([[maybe_unused]] typename AMG::Domain& x, [[maybe_unused]] typename AMG::Range& b)
+      {}
 
       /**  \copydoc Preconditioner::post(X&) */
-      void post(typename AMG::Domain& x)
-      {
-        DUNE_UNUSED_PARAMETER(x);
-      }
+      void post([[maybe_unused]] typename AMG::Domain& x)
+      {}
 
       /** \copydoc Preconditioner::apply(X&,const Y&) */
       void apply(typename AMG::Domain& v, const typename AMG::Range& d)
diff --git a/dune/istl/paamg/matrixhierarchy.hh b/dune/istl/paamg/matrixhierarchy.hh
index 6f594325228a83ed9a31cdcddbad8677e4e2da6e..cfe83e3cc873dc4f8988c198aa964321a565deb1 100644
--- a/dune/istl/paamg/matrixhierarchy.hh
+++ b/dune/istl/paamg/matrixhierarchy.hh
@@ -230,10 +230,8 @@ namespace Dune
         /**
          * @brief Print matrix statistics.
          */
-        static void stats(const Matrix& matrix)
-        {
-          DUNE_UNUSED_PARAMETER(matrix);
-        }
+        static void stats([[maybe_unused]] const Matrix& matrix)
+        {}
       };
 
       template<class Matrix>
@@ -310,20 +308,14 @@ namespace Dune
     };
 
     template<typename M, typename C1>
-    bool repartitionAndDistributeMatrix(const M& origMatrix,
-                                        std::shared_ptr<M> newMatrix,
-                                        SequentialInformation& origComm,
-                                        std::shared_ptr<SequentialInformation>& newComm,
-                                        RedistributeInformation<SequentialInformation>& ri,
-                                        int nparts, C1& criterion)
+    bool repartitionAndDistributeMatrix([[maybe_unused]] const M& origMatrix,
+                                        [[maybe_unused]] std::shared_ptr<M> newMatrix,
+                                        [[maybe_unused]] SequentialInformation& origComm,
+                                        [[maybe_unused]] std::shared_ptr<SequentialInformation>& newComm,
+                                        [[maybe_unused]] RedistributeInformation<SequentialInformation>& ri,
+                                        [[maybe_unused]] int nparts,
+                                        [[maybe_unused]] C1& criterion)
     {
-      DUNE_UNUSED_PARAMETER(origMatrix);
-      DUNE_UNUSED_PARAMETER(newMatrix);
-      DUNE_UNUSED_PARAMETER(origComm);
-      DUNE_UNUSED_PARAMETER(newComm);
-      DUNE_UNUSED_PARAMETER(ri);
-      DUNE_UNUSED_PARAMETER(nparts);
-      DUNE_UNUSED_PARAMETER(criterion);
       DUNE_THROW(NotImplemented, "Redistribution does not make sense in sequential code!");
     }
 
diff --git a/dune/istl/paamg/pinfo.hh b/dune/istl/paamg/pinfo.hh
index 8ed3b3fb7e6380a2d69c6dbaf5d0d54d070a344c..1575e747be41c86993bcae055d7ddcd1aaa21082 100644
--- a/dune/istl/paamg/pinfo.hh
+++ b/dune/istl/paamg/pinfo.hh
@@ -61,17 +61,12 @@ namespace Dune
       }
 
       template<class V>
-      void copyOwnerToAll(V& v, V& v1) const
-      {
-        DUNE_UNUSED_PARAMETER(v);
-        DUNE_UNUSED_PARAMETER(v1);
-      }
+      void copyOwnerToAll([[maybe_unused]] V& v, [[maybe_unused]] V& v1) const
+      {}
 
       template<class V>
-      void project(V& v) const
-      {
-        DUNE_UNUSED_PARAMETER(v);
-      }
+      void project([[maybe_unused]] V& v) const
+      {}
 
       template<class T1, class T2>
       void dot (const T1& x, const T1& y, T2& result) const
diff --git a/dune/istl/paamg/smoother.hh b/dune/istl/paamg/smoother.hh
index d161538512df56fdd25c8efd0dc4a933c1ac5060..75a3d19b4cbf15adcb9362984b698d0b9c544e20 100644
--- a/dune/istl/paamg/smoother.hh
+++ b/dune/istl/paamg/smoother.hh
@@ -9,7 +9,6 @@
 #include <dune/istl/schwarz.hh>
 #include <dune/istl/novlpschwarz.hh>
 #include <dune/common/propertymap.hh>
-#include <dune/common/unused.hh>
 
 namespace Dune
 {
@@ -103,9 +102,8 @@ namespace Dune
       {
         matrix_=&matrix;
       }
-      virtual void setMatrix(const Matrix& matrix, const AggregatesMap& amap)
+      virtual void setMatrix(const Matrix& matrix, [[maybe_unused]] const AggregatesMap& amap)
       {
-        DUNE_UNUSED_PARAMETER(amap);
         setMatrix(matrix);
       }
 
@@ -121,10 +119,8 @@ namespace Dune
       }
 
       template<class T1>
-      void setComm(T1& comm)
-      {
-        DUNE_UNUSED_PARAMETER(comm);
-      }
+      void setComm([[maybe_unused]] T1& comm)
+      {}
 
       const SequentialInformation& getComm()
       {
@@ -191,10 +187,8 @@ namespace Dune
       }
 
       template<class T1>
-      void setComm(T1& comm)
-      {
-        DUNE_UNUSED_PARAMETER(comm);
-      }
+      void setComm([[maybe_unused]] T1& comm)
+      {}
 
       const SequentialInformation& getComm()
       {
diff --git a/dune/istl/paamg/test/anisotropic.hh b/dune/istl/paamg/test/anisotropic.hh
index 6c4fcc5c034c75929ea9d5cc53fbefc8c1ad1eaf..d9e2a928d9708f4ffc2243fc70e7f199e02d09cc 100644
--- a/dune/istl/paamg/test/anisotropic.hh
+++ b/dune/istl/paamg/test/anisotropic.hh
@@ -3,7 +3,6 @@
 #ifndef ANISOTROPIC_HH
 #define  ANISOTROPIC_HH
 #include <dune/common/fmatrix.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/parallel/indexset.hh>
 #include <dune/common/parallel/plocalindex.hh>
 #include <dune/common/parallel/communication.hh>
@@ -73,9 +72,8 @@ void setupPattern(int N, M& mat, Dune::ParallelIndexSet<G,L,s>& indices, int ove
 }
 
 template<class M, class T>
-void fillValues(int N, M& mat, int overlapStart, int overlapEnd, int start, int end, T eps)
+void fillValues([[maybe_unused]] int N, M& mat, int overlapStart, int overlapEnd, int start, int end, T eps)
 {
-  DUNE_UNUSED_PARAMETER(N);
   typedef typename M::block_type Block;
   Block dval(0), bone(0), bmone(0), beps(0);
 
diff --git a/dune/istl/paamg/test/parallelamgtest.cc b/dune/istl/paamg/test/parallelamgtest.cc
index ca0b0458ed15c45e7b0d6bf257e373eb680c7d82..d62dcbd06af2f954b6d2e7d01eca514b13828d91 100644
--- a/dune/istl/paamg/test/parallelamgtest.cc
+++ b/dune/istl/paamg/test/parallelamgtest.cc
@@ -6,7 +6,6 @@
 #endif
 #include "anisotropic.hh"
 #include <dune/common/timer.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/parallel/indexset.hh>
 #include <dune/common/parallel/mpicommunication.hh>
 #include <dune/istl/paamg/amg.hh>
@@ -60,8 +59,8 @@ public:
   int errorcode;
 };
 
-void MPI_err_handler(MPI_Comm *comm, int *err_code, ...){
-  DUNE_UNUSED_PARAMETER(comm);
+void MPI_err_handler([[maybe_unused]] MPI_Comm *comm, int *err_code, ...)
+{
   char *err_string=new char[MPI_MAX_ERROR_STRING];
   int err_length;
   MPI_Error_string(*err_code, err_string, &err_length);
diff --git a/dune/istl/paamg/transfer.hh b/dune/istl/paamg/transfer.hh
index 7041e65697662dd6c80c297341811a11f402474e..b42aded044ee307fc5f6da59417b2fd493cab976 100644
--- a/dune/istl/paamg/transfer.hh
+++ b/dune/istl/paamg/transfer.hh
@@ -9,7 +9,6 @@
 #include <dune/istl/owneroverlapcopy.hh>
 #include <dune/istl/paamg/aggregates.hh>
 #include <dune/common/exceptions.hh>
-#include <dune/common/unused.hh>
 
 namespace Dune
 {
@@ -95,14 +94,12 @@ namespace Dune
     template<typename T>
     inline void
     Transfer<V,V1,SequentialInformation>::prolongateVector(const AggregatesMap<Vertex>& aggregates,
-                                                           Vector& coarse, Vector& fine, Vector& fineRedist,
+                                                           Vector& coarse, Vector& fine,
+                                                           [[maybe_unused]] Vector& fineRedist,
                                                            T damp,
-                                                           const SequentialInformation& comm,
-                                                           const Redist& redist)
+                                                           [[maybe_unused]] const SequentialInformation& comm,
+                                                           [[maybe_unused]] const Redist& redist)
     {
-      DUNE_UNUSED_PARAMETER(fineRedist);
-      DUNE_UNUSED_PARAMETER(comm);
-      DUNE_UNUSED_PARAMETER(redist);
       prolongateVector(aggregates, coarse, fine, damp);
     }
     template<class V, class V1>
@@ -111,9 +108,8 @@ namespace Dune
     Transfer<V,V1,SequentialInformation>::prolongateVector(const AggregatesMap<Vertex>& aggregates,
                                                            Vector& coarse, Vector& fine,
                                                            T damp,
-                                                           const SequentialInformation& comm)
+                                                           [[maybe_unused]] const SequentialInformation& comm)
     {
-      DUNE_UNUSED_PARAMETER(comm);
       typedef typename Vector::iterator Iterator;
 
       Iterator end = coarse.end();
@@ -136,9 +132,8 @@ namespace Dune
     Transfer<V,V1,SequentialInformation>::restrictVector(const AggregatesMap<Vertex>& aggregates,
                                                          Vector& coarse,
                                                          const Vector& fine,
-                                                         const SequentialInformation& comm)
+                                                         [[maybe_unused]] const SequentialInformation& comm)
     {
-      DUNE_UNUSED_PARAMETER(comm);
       // Set coarse vector to zero
       coarse=0;
 
@@ -173,12 +168,11 @@ namespace Dune
 
     template<class V, class V1, class T1, class T2>
     template<typename T3>
-    inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(const AggregatesMap<Vertex>& aggregates,
-                                                                                       Vector& coarse, Vector& fine,
-                                                                                       T3 damp,
-                                                                                       OwnerOverlapCopyCommunication<T1,T2>& comm)
+    inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(
+      const AggregatesMap<Vertex>& aggregates,
+      Vector& coarse, Vector& fine, T3 damp,
+      [[maybe_unused]] OwnerOverlapCopyCommunication<T1,T2>& comm)
     {
-      DUNE_UNUSED_PARAMETER(comm);
       Transfer<V,V1,SequentialInformation>::prolongateVector(aggregates, coarse, fine, damp);
     }
     template<class V, class V1, class T1, class T2>
diff --git a/dune/istl/paamg/twolevelmethod.hh b/dune/istl/paamg/twolevelmethod.hh
index abdfcab6801a97327ae672612d388eab3aef3c54..b0fd7d2744f9e32f297971b00c6f79ddc5f32452 100644
--- a/dune/istl/paamg/twolevelmethod.hh
+++ b/dune/istl/paamg/twolevelmethod.hh
@@ -10,8 +10,6 @@
 #include"galerkin.hh"
 #include<dune/istl/solver.hh>
 
-#include<dune/common/unused.hh>
-
 /**
  * @addtogroup ISTL_PAAMG
  * @{
@@ -273,10 +271,8 @@ private:
       : amg_(op, crit,args), first_(true)
     {}
 
-    void apply(X& x, X& b, double reduction, InverseOperatorResult& res)
+    void apply(X& x, X& b, [[maybe_unused]] double reduction, [[maybe_unused]] InverseOperatorResult& res)
     {
-      DUNE_UNUSED_PARAMETER(reduction);
-      DUNE_UNUSED_PARAMETER(res);
       if(first_)
       {
         amg_.pre(x,b);
@@ -435,10 +431,8 @@ public:
     smoother_->pre(x,b);
   }
 
-  void post(FineDomainType& x)
-  {
-    DUNE_UNUSED_PARAMETER(x);
-  }
+  void post([[maybe_unused]] FineDomainType& x)
+  {}
 
   void apply(FineDomainType& v, const FineRangeType& d)
   {
diff --git a/dune/istl/preconditioners.hh b/dune/istl/preconditioners.hh
index 27efc8f57ce90069e605e3a1d51914c1e8b5913a..0267f2fbe891bf003aa0688ff2c34d70277866d9 100644
--- a/dune/istl/preconditioners.hh
+++ b/dune/istl/preconditioners.hh
@@ -11,7 +11,6 @@
 #include <string>
 
 #include <dune/common/simd/simd.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/parametertree.hh>
 
 #include <dune/istl/solverregistry.hh>
@@ -200,12 +199,8 @@ namespace Dune {
 
        \copydoc Preconditioner::pre(X&,Y&)
      */
-    virtual void pre (X& x, Y& b)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-      DUNE_UNUSED_PARAMETER(b);
-
-    }
+    virtual void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b)
+    {}
 
     /*!
        \brief Apply the preconditioner
@@ -225,10 +220,8 @@ namespace Dune {
 
        \copydoc Preconditioner::post(X&)
      */
-    virtual void post (X& x)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-    }
+    virtual void post ([[maybe_unused]] X& x)
+    {}
 
     //! Category of the preconditioner (see SolverCategory::Category)
     virtual SolverCategory::Category category() const
@@ -324,11 +317,8 @@ namespace Dune {
 
        \copydoc Preconditioner::pre(X&,Y&)
      */
-    virtual void pre (X& x, Y& b)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-      DUNE_UNUSED_PARAMETER(b);
-    }
+    virtual void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b)
+    {}
 
     /*!
        \brief Apply the preconditioner.
@@ -366,10 +356,8 @@ namespace Dune {
 
        \copydoc Preconditioner::post(X&)
      */
-    virtual void post (X& x)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-    }
+    virtual void post ([[maybe_unused]] X& x)
+    {}
 
     //! Category of the preconditioner (see SolverCategory::Category)
     virtual SolverCategory::Category category() const
@@ -478,11 +466,8 @@ namespace Dune {
 
        \copydoc Preconditioner::pre(X&,Y&)
      */
-    virtual void pre (X& x, Y& b)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-      DUNE_UNUSED_PARAMETER(b);
-    }
+    virtual void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b)
+    {}
 
     /*!
        \brief Apply the preconditioner.
@@ -501,10 +486,8 @@ namespace Dune {
 
        \copydoc Preconditioner::post(X&)
      */
-    virtual void post (X& x)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-    }
+    virtual void post ([[maybe_unused]] X& x)
+    {}
 
     //! Category of the preconditioner (see SolverCategory::Category)
     virtual SolverCategory::Category category() const
@@ -650,11 +633,8 @@ namespace Dune {
 
        \copydoc Preconditioner::pre(X&,Y&)
      */
-    virtual void pre (X& x, Y& b)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-      DUNE_UNUSED_PARAMETER(b);
-    }
+    virtual void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b)
+    {}
 
     /*!
        \brief Apply the preconditioner.
@@ -683,10 +663,8 @@ namespace Dune {
 
        \copydoc Preconditioner::post(X&)
      */
-    virtual void post (X& x)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-    }
+    virtual void post ([[maybe_unused]] X& x)
+    {}
 
     //! Category of the preconditioner (see SolverCategory::Category)
     virtual SolverCategory::Category category() const
@@ -760,11 +738,8 @@ namespace Dune {
 
        \copydoc Preconditioner::pre(X&,Y&)
      */
-    virtual void pre (X& x, Y& b)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-      DUNE_UNUSED_PARAMETER(b);
-    }
+    virtual void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b)
+    {}
 
     /*!
        \brief Apply the precondioner.
@@ -782,10 +757,8 @@ namespace Dune {
 
        \copydoc Preconditioner::post(X&)
      */
-    virtual void post (X& x)
-    {
-      DUNE_UNUSED_PARAMETER(x);
-    }
+    virtual void post ([[maybe_unused]] X& x)
+    {}
 
     //! Category of the preconditioner (see SolverCategory::Category)
     virtual SolverCategory::Category category() const
@@ -913,11 +886,8 @@ namespace Dune {
     }
 
     /** \copydoc Preconditioner::pre(X&,Y&) **/
-    void pre ( X &x, Y &b ) override
-    {
-      DUNE_UNUSED_PARAMETER( x );
-      DUNE_UNUSED_PARAMETER( b );
-    }
+    void pre ([[maybe_unused]] X &x, [[maybe_unused]] Y &b) override
+    {}
 
     /** \copydoc Preconditioner::apply(X&,const Y&) **/
     void apply ( X &v, const Y &d ) override
@@ -927,10 +897,8 @@ namespace Dune {
     }
 
     /** \copydoc Preconditioner::post(X&) **/
-    void post ( X &x ) override
-    {
-      DUNE_UNUSED_PARAMETER( x );
-    }
+    void post ([[maybe_unused]] X &x) override
+    {}
 
     /** \copydoc Preconditioner::category() **/
     SolverCategory::Category category () const override { return SolverCategory::sequential; }
diff --git a/dune/istl/repartition.hh b/dune/istl/repartition.hh
index ccafd6ea22849ce97b0814c40ff4ef0b3f592331..5c5dda96551ce4ee7fb7047da9c578a5d336ac9e 100644
--- a/dune/istl/repartition.hh
+++ b/dune/istl/repartition.hh
@@ -19,7 +19,6 @@ extern "C"
 #endif
 
 #include <dune/common/timer.hh>
-#include <dune/common/unused.hh>
 #include <dune/common/enumset.hh>
 #include <dune/common/stdstreams.hh>
 #include <dune/common/parallel/mpitraits.hh>
@@ -586,9 +585,8 @@ namespace Dune
     }
 
     template<class T, class I>
-    void my_push_back(std::vector<T>& ownerVec, const I& index, int proc)
+    void my_push_back(std::vector<T>& ownerVec, const I& index, [[maybe_unused]] int proc)
     {
-      DUNE_UNUSED_PARAMETER(proc);
       ownerVec.push_back(index);
     }
 
@@ -626,9 +624,8 @@ namespace Dune
      */
     template<class OwnerSet, class G, class IS, class T, class GI>
     void getOwnerOverlapVec(const G& graph, std::vector<int>& part, IS& indexSet,
-                            int myPe, int toPe, std::vector<T>& ownerVec, std::set<GI>& overlapSet,
+                            [[maybe_unused]] int myPe, int toPe, std::vector<T>& ownerVec, std::set<GI>& overlapSet,
                             RedistributeInterface& redist, std::set<int>& neighborProcs) {
-      DUNE_UNUSED_PARAMETER(myPe);
       //typedef typename IndexSet::const_iterator Iterator;
       typedef typename IS::const_iterator Iterator;
       for(Iterator index = indexSet.begin(); index != indexSet.end(); ++index) {
@@ -967,7 +964,7 @@ namespace Dune
                             vtxdist[oocomm.communicator().size()],
                             noNeighbours, xadj, adjncy, false));
 
-        DUNE_UNUSED Metis::idx_t wgtflag=0;
+        [[maybe_unused]] Metis::idx_t wgtflag=0;
         Metis::idx_t numflag=0;
         Metis::idx_t edgecut;
 #ifdef USE_WEIGHTS
diff --git a/dune/istl/spqr.hh b/dune/istl/spqr.hh
index 7fa3d8b642d57ffce40329135a233110f27fc45d..24b965ab11892c5b5f7dcd7741009efda56f1c2f 100644
--- a/dune/istl/spqr.hh
+++ b/dune/istl/spqr.hh
@@ -11,7 +11,6 @@
 #include <SuiteSparseQR.hpp>
 
 #include <dune/common/exceptions.hh>
-#include <dune/common/unused.hh>
 
 #include <dune/istl/bccsmatrixinitializer.hh>
 #include <dune/istl/solvers.hh>
@@ -181,17 +180,13 @@ namespace Dune {
     }
 
     /** \copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&) */
-    virtual void apply (domain_type& x, range_type& b, double reduction, InverseOperatorResult& res)
+    virtual void apply (domain_type& x, range_type& b, [[maybe_unused]] double reduction, InverseOperatorResult& res)
     {
-      DUNE_UNUSED_PARAMETER(reduction);
       apply(x, b, res);
     }
 
-    void setOption(unsigned int option, double value)
-    {
-      DUNE_UNUSED_PARAMETER(option);
-      DUNE_UNUSED_PARAMETER(value);
-    }
+    void setOption([[maybe_unused]] unsigned int option, [[maybe_unused]] double value)
+    {}
 
     /** @brief Initialize data from given matrix. */
     void setMatrix(const Matrix& matrix)
diff --git a/dune/istl/superlu.hh b/dune/istl/superlu.hh
index 4bc8fc5ef9f41f1d20c50a9d3603f5a500a5d384..2f5c463987ad838a8254e781494ac5b40d025310 100644
--- a/dune/istl/superlu.hh
+++ b/dune/istl/superlu.hh
@@ -337,9 +337,8 @@ namespace Dune
     /**
      *  \copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&)
      */
-    void apply (domain_type& x, range_type& b, double reduction, InverseOperatorResult& res)
+    void apply (domain_type& x, range_type& b, [[maybe_unused]] double reduction, InverseOperatorResult& res)
     {
-      DUNE_UNUSED_PARAMETER(reduction);
       apply(x,b,res);
     }
 
diff --git a/dune/istl/test/bcrsbuild.cc b/dune/istl/test/bcrsbuild.cc
index 47bdbe54d383a62cf553dddd034c1d75ec841e73..9029fe3dec2898afb704c5b3469fec809725bfbf 100644
--- a/dune/istl/test/bcrsbuild.cc
+++ b/dune/istl/test/bcrsbuild.cc
@@ -5,7 +5,6 @@
 #include <dune/common/fmatrix.hh>
 #include <dune/common/exceptions.hh>
 #include <dune/common/test/testsuite.hh>
-#include <dune/common/unused.hh>
 #include <dune/istl/io.hh>
 
 template<class M>
@@ -13,7 +12,7 @@ std::size_t computeNNZ(M&& matrix)
 {
   std::size_t nnz = 0;
   for (auto&& row : matrix)
-    for (DUNE_UNUSED auto&& entry : row)
+    for ([[maybe_unused]] auto&& entry : row)
       ++nnz;
   return nnz;
 }
diff --git a/dune/istl/test/matrixtest.cc b/dune/istl/test/matrixtest.cc
index ca7c3a8664e6a4d24a3f734e2b04608d840e858d..5d27c29e39c156ba8a4cb1912450a4061da93148 100644
--- a/dune/istl/test/matrixtest.cc
+++ b/dune/istl/test/matrixtest.cc
@@ -9,7 +9,6 @@
 
 #include <dune/common/fmatrix.hh>
 #include <dune/common/diagonalmatrix.hh>
-#include <dune/common/unused.hh>
 #include <dune/istl/blocklevel.hh>
 #include <dune/istl/bcrsmatrix.hh>
 #include <dune/istl/matrix.hh>
@@ -42,7 +41,7 @@ void testSuperMatrix(MatrixType& matrix)
 
   typedef typename MatrixType::size_type size_type;
 
-  typedef typename MatrixType::allocator_type allocator_type DUNE_UNUSED;
+  using allocator_type [[maybe_unused]] = typename MatrixType::allocator_type;
 
   size_type n = matrix.N();
   size_type m = matrix.M();
@@ -64,19 +63,19 @@ void testMatrix(MatrixType& matrix, X& x, Y& y)
 
   typedef typename FieldTraits<field_type>::real_type real_type;
 
-  typedef typename MatrixType::block_type block_type DUNE_UNUSED;
+  using block_type [[maybe_unused]] = typename MatrixType::block_type;
 
-  typedef typename MatrixType::row_type row_type DUNE_UNUSED;
+  using row_type [[maybe_unused]] = typename MatrixType::row_type;
 
   typedef typename MatrixType::size_type size_type;
 
-  typedef typename MatrixType::RowIterator RowIterator DUNE_UNUSED;
+  using RowIterator [[maybe_unused]] = typename MatrixType::RowIterator;
 
-  typedef typename MatrixType::ConstRowIterator ConstRowIterator DUNE_UNUSED;
+  using ConstRowIterator [[maybe_unused]] = typename MatrixType::ConstRowIterator;
 
-  typedef typename MatrixType::ColIterator ColIterator DUNE_UNUSED;
+  using ColIterator [[maybe_unused]] = typename MatrixType::ColIterator;
 
-  typedef typename MatrixType::ConstColIterator ConstColIterator DUNE_UNUSED;
+  using ConstColIterator [[maybe_unused]] = typename MatrixType::ConstColIterator;
 
   static_assert(maxBlockLevel<MatrixType>() >= 0, "Block level has to be at least 1 for a matrix!");
 
@@ -201,7 +200,7 @@ void testMatrix(MatrixType& matrix, X& x, Y& y)
   matrix = 0;
 
   // The copy constructor
-  DUNE_UNUSED MatrixType thirdMatrix(matrix);
+  [[maybe_unused]] MatrixType thirdMatrix(matrix);
 
   // ///////////////////////////////////////////////////////
   //   Test component-wise operations
diff --git a/dune/istl/test/scaledidmatrixtest.cc b/dune/istl/test/scaledidmatrixtest.cc
index 2258db23ae79acdd6903667fb4cebc3753fa86ad..3687a79217731fbf7aa253882586a769c48985ac 100644
--- a/dune/istl/test/scaledidmatrixtest.cc
+++ b/dune/istl/test/scaledidmatrixtest.cc
@@ -46,7 +46,7 @@ void test_matrix()
   std::cout << f << std::endl;
 
   // Construction of FieldMatrix from ScaledIdentityMatrix
-  FieldMatrix<K,n,n> AFM DUNE_UNUSED = FieldMatrix<K,n,n>(A);
+  [[maybe_unused]] FieldMatrix<K,n,n> AFM = FieldMatrix<K,n,n>(A);
 }
 
 int main()
diff --git a/dune/istl/umfpack.hh b/dune/istl/umfpack.hh
index 989c80e5c6da436d151d97debb897bec27e8e439..ead3da04dedb051cce16c15fba1a954e1fc8a411 100644
--- a/dune/istl/umfpack.hh
+++ b/dune/istl/umfpack.hh
@@ -13,7 +13,6 @@
 #include<dune/common/exceptions.hh>
 #include<dune/common/fmatrix.hh>
 #include<dune/common/fvector.hh>
-#include<dune/common/unused.hh>
 #include<dune/istl/bccsmatrixinitializer.hh>
 #include<dune/istl/bcrsmatrix.hh>
 #include<dune/istl/solvers.hh>
@@ -385,9 +384,8 @@ namespace Dune {
     /**
      *  \copydoc InverseOperator::apply(X&,Y&,double,InverseOperatorResult&)
      */
-    virtual void apply (domain_type& x, range_type& b, double reduction, InverseOperatorResult& res)
+    virtual void apply (domain_type& x, range_type& b, [[maybe_unused]] double reduction, InverseOperatorResult& res)
     {
-      DUNE_UNUSED_PARAMETER(reduction);
       apply(x,b,res);
     }