From: Daniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Date: Wed, 12 Dec 2018 22:51:11 +0000 (+0100)
Subject: Update clang-tidy checks
X-Git-Tag: v9.1.0-rc1~493^2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63c2169edc163ebac32e5f436fb9634a66d457f2;p=dealii.git

Update clang-tidy checks
---

diff --git a/contrib/utilities/run_clang_tidy.sh b/contrib/utilities/run_clang_tidy.sh
index 401f058731..06d1bb66ee 100755
--- a/contrib/utilities/run_clang_tidy.sh
+++ b/contrib/utilities/run_clang_tidy.sh
@@ -47,12 +47,14 @@ ARGS="-D DEAL_II_WITH_MUPARSER=OFF -D DEAL_II_WITH_MPI=ON -D CMAKE_EXPORT_COMPIL
 
 # disable performance-inefficient-string-concatenation because we don't care about "a"+to_string(5)+...
 CHECKS="-*,
-        mpi-*,
-        performance-*,
-        -performance-inefficient-string-concatenation,
+        cppcoreguidelines-pro-type-static-cast-downcast,
+        google-readability-casting,
         modernize-use-emplace,
         modernize-deprecated-headers,
-        modernize-use-using"
+        modernize-use-using,
+        mpi-*,
+        performance-*,
+        -performance-inefficient-string-concatenation"
 
 CHECKS="$(echo "${CHECKS}" | tr -d '[:space:]')"
 echo "$CHECKS"
diff --git a/source/fe/fe_poly.cc b/source/fe/fe_poly.cc
index fc419f181b..2881ef1c85 100644
--- a/source/fe/fe_poly.cc
+++ b/source/fe/fe_poly.cc
@@ -47,7 +47,8 @@ FE_Poly<TensorProductPolynomials<1>, 1, 2>::fill_fe_values(
   // exception if that is not possible
   Assert(dynamic_cast<const InternalData *>(&fe_internal) != nullptr,
          ExcInternalError());
-  const InternalData &fe_data = static_cast<const InternalData &>(fe_internal);
+  const InternalData &fe_data =
+    static_cast<const InternalData &>(fe_internal); // NOLINT
 
   // transform gradients and higher derivatives. there is nothing to do
   // for values since we already emplaced them into output_data when
@@ -115,7 +116,8 @@ FE_Poly<TensorProductPolynomials<2>, 2, 3>::fill_fe_values(
   // exception if that is not possible
   Assert(dynamic_cast<const InternalData *>(&fe_internal) != nullptr,
          ExcInternalError());
-  const InternalData &fe_data = static_cast<const InternalData &>(fe_internal);
+  const InternalData &fe_data =
+    static_cast<const InternalData &>(fe_internal); // NOLINT
 
   // transform gradients and higher derivatives. there is nothing to do
   // for values since we already emplaced them into output_data when
@@ -182,7 +184,8 @@ FE_Poly<PolynomialSpace<1>, 1, 2>::fill_fe_values(
   // exception if that is not possible
   Assert(dynamic_cast<const InternalData *>(&fe_internal) != nullptr,
          ExcInternalError());
-  const InternalData &fe_data = static_cast<const InternalData &>(fe_internal);
+  const InternalData &fe_data =
+    static_cast<const InternalData &>(fe_internal); // NOLINT
 
   // transform gradients and higher derivatives. there is nothing to do
   // for values since we already emplaced them into output_data when
@@ -249,7 +252,8 @@ FE_Poly<PolynomialSpace<2>, 2, 3>::fill_fe_values(
   // exception if that is not possible
   Assert(dynamic_cast<const InternalData *>(&fe_internal) != nullptr,
          ExcInternalError());
-  const InternalData &fe_data = static_cast<const InternalData &>(fe_internal);
+  const InternalData &fe_data =
+    static_cast<const InternalData &>(fe_internal); // NOLINT
 
   // transform gradients and higher derivatives. there is nothing to do
   // for values since we already emplaced them into output_data when
diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc
index c0eba0764a..c6769aa313 100644
--- a/source/lac/trilinos_sparsity_pattern.cc
+++ b/source/lac/trilinos_sparsity_pattern.cc
@@ -462,7 +462,7 @@ namespace TrilinosWrappers
 
       // TODO A dynamic_cast fails here, this is suspicious.
       const auto &range_map =
-        static_cast<const Epetra_Map &>(graph->RangeMap());
+        static_cast<const Epetra_Map &>(graph->RangeMap()); // NOLINT
       int ierr = graph->GlobalAssemble(*column_space_map, range_map, true);
       AssertThrow(ierr == 0, ExcTrilinosError(ierr));
 
@@ -814,7 +814,7 @@ namespace TrilinosWrappers
       {
         // TODO A dynamic_cast fails here, this is suspicious.
         const auto &range_map =
-          static_cast<const Epetra_Map &>(graph->RangeMap());
+          static_cast<const Epetra_Map &>(graph->RangeMap()); // NOLINT
         ierr = graph->GlobalAssemble(*column_space_map, range_map, true);
         AssertThrow(ierr == 0, ExcTrilinosError(ierr));
       }
@@ -1035,7 +1035,7 @@ namespace TrilinosWrappers
   {
     // TODO A dynamic_cast fails here, this is suspicious.
     const auto &domain_map =
-      static_cast<const Epetra_Map &>(graph->DomainMap());
+      static_cast<const Epetra_Map &>(graph->DomainMap()); // NOLINT
     return domain_map;
   }
 
@@ -1045,7 +1045,8 @@ namespace TrilinosWrappers
   SparsityPattern::range_partitioner() const
   {
     // TODO A dynamic_cast fails here, this is suspicious.
-    const auto &range_map = static_cast<const Epetra_Map &>(graph->RangeMap());
+    const auto &range_map =
+      static_cast<const Epetra_Map &>(graph->RangeMap()); // NOLINT
     return range_map;
   }
 
@@ -1055,7 +1056,8 @@ namespace TrilinosWrappers
   SparsityPattern::row_partitioner() const
   {
     // TODO A dynamic_cast fails here, this is suspicious.
-    const auto &row_map = static_cast<const Epetra_Map &>(graph->RowMap());
+    const auto &row_map =
+      static_cast<const Epetra_Map &>(graph->RowMap()); // NOLINT
     return row_map;
   }
 
@@ -1065,7 +1067,8 @@ namespace TrilinosWrappers
   SparsityPattern::col_partitioner() const
   {
     // TODO A dynamic_cast fails here, this is suspicious.
-    const auto &col_map = static_cast<const Epetra_Map &>(graph->ColMap());
+    const auto &col_map =
+      static_cast<const Epetra_Map &>(graph->ColMap()); // NOLINT
     return col_map;
   }