From: Wolfgang Bangerth Date: Tue, 20 Jun 2023 18:02:47 +0000 (-0600) Subject: Try to work around an Intel compiler issue. X-Git-Tag: v9.5.0-rc1~66^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f86ac4236738fc9a8b55066fcd4ca16c7f2a8a9c;p=dealii.git Try to work around an Intel compiler issue. --- diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index f4519e50c1..8dd4147212 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -3529,14 +3529,18 @@ namespace internal cell->active_fe_index(), DoFAccessorImplementation::Implementation:: DoFIndexProcessor(), - [&complete](auto &stored_index, auto received_index) { - if (*received_index != numbers::invalid_dof_index) + + // Intel ICC 19 and earlier for some reason believe that + // numbers::invalid_dof_index is not a valid object + // inside the lambda function. Fix this by creating a + // local variable initialized by the global one. + [&complete, invalid_dof_index = numbers::invalid_dof_index]( + auto &stored_index, const auto received_index) { + if (*received_index != invalid_dof_index) { -# if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900 - Assert((stored_index == (numbers::invalid_dof_index)) || + Assert((stored_index == (invalid_dof_index)) || (stored_index == *received_index), ExcInternalError()); -# endif stored_index = *received_index; } else