]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix an unused variable warning. 16375/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 21 Dec 2023 14:46:17 +0000 (09:46 -0500)
committerDavid Wells <drwells@email.unc.edu>
Thu, 21 Dec 2023 14:46:17 +0000 (09:46 -0500)
AFAICT this was fixed in GCC at some point.

source/grid/tria_accessor.cc

index 4c084ea65f0da58439e7153d21eee829747f3d51..b9a9c0cfd524ca06626be6eee9ad682a3d509221 100644 (file)
@@ -2245,6 +2245,10 @@ void
 CellAccessor<dim, spacedim>::set_direction_flag(
   const bool new_direction_flag) const
 {
+  // Some older compilers (GCC 9) print an unused variable warning about
+  // new_direction_flag when it is only used in a subset of 'if constexpr'
+  // statements
+  (void)new_direction_flag;
   Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed());
   if constexpr (dim == spacedim)
     Assert(new_direction_flag == true,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.