From 91b8103c72ed88d54e8ae703db4ecd103c82d98e Mon Sep 17 00:00:00 2001 From: Tobias Leibner <tobias.leibner@googlemail.com> Date: Wed, 15 Jul 2020 12:02:16 +0200 Subject: [PATCH] [test.configuration] fix warning --- dune/xt/test/common/configuration.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dune/xt/test/common/configuration.cc b/dune/xt/test/common/configuration.cc index 03e0c9199..428354443 100644 --- a/dune/xt/test/common/configuration.cc +++ b/dune/xt/test/common/configuration.cc @@ -285,9 +285,12 @@ struct StaticCheck template <class MatrixType> static void check_matrix_static_size(const Configuration& config) { - typedef MatrixAbstraction<MatrixType> MT; - const auto r = MT::rows(MatrixType()); - const auto c = MT::cols(MatrixType()); + using MT = MatrixAbstraction<MatrixType>; + // r and c are non-const to avoid a warning that the lambda capture is unused + // Maybe we could remove the capture and make r and c const, but then we + // would have to test that it works with all relevant compilers + auto r = MT::rows(MatrixType()); + auto c = MT::cols(MatrixType()); const auto check = [&r, &c](const MatrixType& mat) { for (size_t cc = 0; cc < c; ++cc) { -- GitLab