From c8c362a3639ffa60dd1e95779c236e9742a94e3c Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 3 Nov 2017 16:34:16 +0100 Subject: [PATCH] Avoid taking reference of non-existant static constexpr variables. --- .../fe_evaluation_dofs_per_cell.cc | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/matrix_free/fe_evaluation_dofs_per_cell.cc b/tests/matrix_free/fe_evaluation_dofs_per_cell.cc index 274ca992c2..4e14ff7baf 100644 --- a/tests/matrix_free/fe_evaluation_dofs_per_cell.cc +++ b/tests/matrix_free/fe_evaluation_dofs_per_cell.cc @@ -31,12 +31,20 @@ template void print_info(const FEEval &eval) { - deallog << "FEEvaluation::dimension: " << FEEval::dimension << std::endl; - deallog << "FEEvaluation::n_components: " << FEEval::n_components << std::endl; - deallog << "FEEvaluation::static_n_q_points: " << FEEval::static_n_q_points << std::endl; - deallog << "FEEvaluation::static_dofs_per_component: " << FEEval::static_dofs_per_component << std::endl; - deallog << "FEEvaluation::tensor_dofs_per_cell: " << FEEval::tensor_dofs_per_cell << std::endl; - deallog << "FEEvaluation::static_dofs_per_cell: " << FEEval::static_dofs_per_cell << std::endl; + // copy static variables to int to avoid taking references (with possibly + // undefined references) when inside deallog::operator<< + unsigned int v = FEEval::dimension; + deallog << "FEEvaluation::dimension: " << v << std::endl; + v = FEEval::n_components; + deallog << "FEEvaluation::n_components: " << v << std::endl; + v = FEEval::static_n_q_points; + deallog << "FEEvaluation::static_n_q_points: " << v << std::endl; + v = FEEval::static_dofs_per_component; + deallog << "FEEvaluation::static_dofs_per_component: " << v << std::endl; + v = FEEval::tensor_dofs_per_cell; + deallog << "FEEvaluation::tensor_dofs_per_cell: " << v << std::endl; + v = FEEval::static_dofs_per_cell; + deallog << "FEEvaluation::static_dofs_per_cell: " << v << std::endl; deallog << "FEEvaluation::dofs_per_component: " << eval.dofs_per_component << std::endl; deallog << "FEEvaluation::dofs_per_cell: " << eval.dofs_per_cell << std::endl; deallog << "FEEvaluation::n_q_points: " << eval.n_q_points << std::endl; -- 2.39.5