From c1bbf564a113e563326e338e31d6d477b0ae14d9 Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth <bangerth@colostate.edu>
Date: Sun, 31 Oct 2021 13:30:35 -0600
Subject: [PATCH] Fix a test.

---
 tests/mpi/data_out_hdf5_02.cc | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/tests/mpi/data_out_hdf5_02.cc b/tests/mpi/data_out_hdf5_02.cc
index e0126fd1d8..5586a4be17 100644
--- a/tests/mpi/data_out_hdf5_02.cc
+++ b/tests/mpi/data_out_hdf5_02.cc
@@ -40,7 +40,23 @@ create_patches(std::vector<DataOutBase::Patch<dim, spacedim>> &patches)
       const unsigned int nsub  = p + 1;
       const unsigned int nsubp = nsub + 1;
 
-      patch.n_subdivisions = nsub;
+#ifdef DEAL_II_HAVE_CXX17
+      if constexpr (dim > 0)
+        patch.n_subdivisions = nsub;
+#else
+      if (dim > 0)
+        const_cast<unsigned int &>(patch.n_subdivisions) = nsub;
+#endif
+
+#ifdef DEAL_II_HAVE_CXX17
+      if constexpr (dim > 0)
+        patch.reference_cell = ReferenceCells::get_hypercube<dim>();
+#else
+      if (dim > 0)
+        const_cast<ReferenceCell &>(patch.reference_cell) =
+          ReferenceCells::get_hypercube<dim>();
+#endif
+
       for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         for (unsigned int d = 0; d < spacedim; ++d)
           patch.vertices[v](d) =
-- 
2.39.5