From bd84f8a950d3d44be468010ccb2b70c5e37af704 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 25 Mar 2024 13:46:50 -0400 Subject: [PATCH] Fix compiler warning for macro usage in TpetraWrappers --- include/deal.II/lac/trilinos_tpetra_vector.templates.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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. " -- 2.39.5