From: Timo Heister Date: Sat, 1 Aug 2020 19:08:25 +0000 (-0400) Subject: fix dof_accessor warning X-Git-Tag: v9.3.0-rc1~1223^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ade0b731f9460b240de300a4219dee84a663a1d5;p=dealii.git fix dof_accessor warning fixes: ``` /jenkins/workspace/dealii_PR-10786/include/deal.II/base/exceptions.h:1414:72: error: ‘fe_index_’ may be used uninitialized in this function [-Werror =maybe-uninitialized] /jenkins/workspace/dealii_PR-10786/include/deal.II/dofs/dof_accessor.templates.h:284:22: note: ‘fe_index_’ was declared here ``` --- diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 3b9f963185..8229ac7fd7 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -282,28 +282,28 @@ namespace internal AssertIndexRange(d, dof_handler.object_dof_indices[obj_level].size()); unsigned int fe_index_; + Assert(dof_handler.hp_capability_enabled, ExcInternalError()); - if (dof_handler.hp_capability_enabled) - { - AssertIndexRange(d, dof_handler.hp_object_fe_ptr.size()); - AssertIndexRange(obj_index, dof_handler.hp_object_fe_ptr[d].size()); + { + AssertIndexRange(d, dof_handler.hp_object_fe_ptr.size()); + AssertIndexRange(obj_index, dof_handler.hp_object_fe_ptr[d].size()); - const auto ptr = - std::find(dof_handler.hp_object_fe_indices[d].begin() + - dof_handler.hp_object_fe_ptr[d][obj_index], - dof_handler.hp_object_fe_indices[d].begin() + - dof_handler.hp_object_fe_ptr[d][obj_index + 1], - fe_index); + const auto ptr = + std::find(dof_handler.hp_object_fe_indices[d].begin() + + dof_handler.hp_object_fe_ptr[d][obj_index], + dof_handler.hp_object_fe_indices[d].begin() + + dof_handler.hp_object_fe_ptr[d][obj_index + 1], + fe_index); - Assert(ptr != dof_handler.hp_object_fe_indices[d].begin() + - dof_handler.hp_object_fe_ptr[d][obj_index + 1], - ExcNotImplemented()); + Assert(ptr != dof_handler.hp_object_fe_indices[d].begin() + + dof_handler.hp_object_fe_ptr[d][obj_index + 1], + ExcNotImplemented()); - fe_index_ = - std::distance(dof_handler.hp_object_fe_indices[d].begin() + - dof_handler.hp_object_fe_ptr[d][obj_index], - ptr); - } + fe_index_ = + std::distance(dof_handler.hp_object_fe_indices[d].begin() + + dof_handler.hp_object_fe_ptr[d][obj_index], + ptr); + } AssertIndexRange(dof_handler.hp_capability_enabled ? (dof_handler.hp_object_fe_ptr[d][obj_index] +