From 6651fa50ab58752ddd372a89645be86c94765866 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Thu, 2 May 2024 13:01:47 -0700 Subject: [PATCH] fix: work around ifx impure function-ref bug According to the Fortran 2023 interpretation document requirement R1520 and R1521, a function-reference contains non-optional parentheses, which makes it standard-conforming to reference the user-defined generic operator(==) that is bound to the derived type test_description_t. For now, however, we make the operator impure to work around a compiler bug. --- ...est_description_m.f90 => sourcery_test_description_m.F90} | 5 ++++- src/sourcery/sourcery_test_description_s.f90 | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) rename src/sourcery/{sourcery_test_description_m.f90 => sourcery_test_description_m.F90} (96%) diff --git a/src/sourcery/sourcery_test_description_m.f90 b/src/sourcery/sourcery_test_description_m.F90 similarity index 96% rename from src/sourcery/sourcery_test_description_m.f90 rename to src/sourcery/sourcery_test_description_m.F90 index 9f2764cd..33e6a4fa 100644 --- a/src/sourcery/sourcery_test_description_m.f90 +++ b/src/sourcery/sourcery_test_description_m.F90 @@ -64,6 +64,9 @@ impure elemental module function contains_text(self, substring) result(match) logical match end function +#ifdef __INTEL_COMPILER + impure & +#endif elemental module function equals(lhs, rhs) result(lhs_eq_rhs) !! The result is .true. if the components of the lhs & rhs are equal implicit none @@ -73,4 +76,4 @@ elemental module function equals(lhs, rhs) result(lhs_eq_rhs) end interface -end module sourcery_test_description_m \ No newline at end of file +end module sourcery_test_description_m diff --git a/src/sourcery/sourcery_test_description_s.f90 b/src/sourcery/sourcery_test_description_s.f90 index 4f5d070e..4e7a19bc 100644 --- a/src/sourcery/sourcery_test_description_s.f90 +++ b/src/sourcery/sourcery_test_description_s.f90 @@ -22,4 +22,4 @@ module procedure equals lhs_eq_rhs = (lhs%description_ == rhs%description_) .and. associated(lhs%test_function_, rhs%test_function_) end procedure -end submodule sourcery_test_description_s \ No newline at end of file +end submodule sourcery_test_description_s