]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Try to work around an Intel compiler issue.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 20 Jun 2023 18:02:47 +0000 (12:02 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 20 Jun 2023 18:02:47 +0000 (12:02 -0600)
source/dofs/dof_handler_policy.cc

index f4519e50c134f451082a0b26c34f774f68702920..8dd414721264457f1d9de42689415d9d58f000d0 100644 (file)
@@ -3529,14 +3529,18 @@ namespace internal
               cell->active_fe_index(),
               DoFAccessorImplementation::Implementation::
                 DoFIndexProcessor<dim, spacedim>(),
-              [&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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.