From: Daniel Arndt Date: Mon, 25 Mar 2024 17:46:50 +0000 (-0400) Subject: Fix compiler warning for macro usage in TpetraWrappers X-Git-Tag: v9.6.0-rc1~448^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd84f8a950d3d44be468010ccb2b70c5e37af704;p=dealii.git Fix compiler warning for macro usage in TpetraWrappers --- diff --git a/include/deal.II/lac/trilinos_tpetra_vector.templates.h b/include/deal.II/lac/trilinos_tpetra_vector.templates.h index 2da046ba3d..70ded3bbdf 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.templates.h @@ -1032,12 +1032,14 @@ namespace LinearAlgebra const size_type begin = vector->getMap()->getMinGlobalIndex(); const size_type end = vector->getMap()->getMaxGlobalIndex() + 1; - Assert( + [[maybe_unused]] const size_type n_local_elements = # if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0) - end - begin == vector->getMap()->getLocalNumElements(), + vector->getMap()->getLocalNumElements(); # else - end - begin == vector->getMap()->getNodeNumElements(), + vector->getMap()->getNodeNumElements(); # endif + Assert( + end - begin == n_local_elements, ExcMessage( "This function only makes sense if the elements that this " "vector stores on the current processor form a contiguous range. "