]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around an Intel18 compiler issue. 15390/head
authorMarc Fehling <mafehling.git@gmail.com>
Tue, 20 Jun 2023 23:30:38 +0000 (18:30 -0500)
committerMarc Fehling <mafehling.git@gmail.com>
Tue, 20 Jun 2023 23:30:38 +0000 (18:30 -0500)
source/dofs/dof_handler_policy.cc

index 8dd414721264457f1d9de42689415d9d58f000d0..0760b9992d9f4e83cdd4289a50abc15bd00d763f 100644 (file)
@@ -3431,11 +3431,21 @@ namespace internal
               0,
               DoFAccessorImplementation::Implementation::
                 MGDoFIndexProcessor<dim, spacedim>(cell->level()),
-              [&complete](auto &stored_index, auto received_index) {
-                if (*received_index != numbers::invalid_dof_index)
+
+              // Intel ICC 18 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.
+              //
+              // Intel ICC 19 and earlier have trouble with our Assert
+              // macros inside the lambda function. We disable the macro
+              // for these compilers.
+              [&complete, invalid_dof_index = numbers::invalid_dof_index](
+                auto &stored_index, 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
@@ -3530,17 +3540,23 @@ namespace internal
               DoFAccessorImplementation::Implementation::
                 DoFIndexProcessor<dim, spacedim>(),
 
-              // Intel ICC 19 and earlier for some reason believe that
+              // Intel ICC 18 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.
+              //
+              // Intel ICC 19 and earlier have trouble with our Assert
+              // macros inside the lambda function. We disable the macro
+              // for these compilers.
               [&complete, invalid_dof_index = numbers::invalid_dof_index](
                 auto &stored_index, const auto received_index) {
                 if (*received_index != invalid_dof_index)
                   {
-                    Assert((stored_index == (invalid_dof_index)) ||
+#    if !defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1900
+                    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.