From e80dee5cecfee5e537b96643d2c2a5fb76f8e818 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Tue, 15 Oct 2024 11:51:02 -0700 Subject: [PATCH 1/2] Fix issue #46: workaround some compile errors with flang-new 19.1.1 I don't really understand why this change works, but it resolves the compile errors in my testing. I suspect this might represent a defect in flang-new. --- example/derived-type_diagnostic.F90 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/example/derived-type_diagnostic.F90 b/example/derived-type_diagnostic.F90 index 740f8ca..4d5feab 100644 --- a/example/derived-type_diagnostic.F90 +++ b/example/derived-type_diagnostic.F90 @@ -43,9 +43,12 @@ pure module function construct(z) result(new_stuff_t) contains - module procedure defined + pure module function defined(self) result(self_defined) + class(stuff_t), intent(in) :: self + logical self_defined + self_defined = self%defined_ - end procedure + end function module procedure construct new_stuff_t%z_ = z @@ -103,12 +106,15 @@ pure module function construct(stuff) result(new_characterizable_stuff) contains - module procedure as_character + pure module function as_character(self) result(character_self) + class(characterizable_stuff_t), intent(in) :: self + character(len=:), allocatable :: character_self + integer, parameter :: max_len=256 character(len=max_len) untrimmed_string write(untrimmed_string,*) self%stuff_%z() character_self = trim(adjustl(untrimmed_string)) - end procedure + end function module procedure construct new_characterizable_stuff%stuff_ = stuff From 6950735b0ab888b96477dccd06421c0811367bac Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Fri, 8 Nov 2024 13:48:00 -0800 Subject: [PATCH 2/2] fix(build): implement STRINGIFY operator for NAG --- include/assert_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/assert_macros.h b/include/assert_macros.h index 4a058a9..63e014b 100644 --- a/include/assert_macros.h +++ b/include/assert_macros.h @@ -14,7 +14,7 @@ ! Deal with stringification issues: ! https://gcc.gnu.org/legacy-ml/fortran/2009-06/msg00131.html #ifndef STRINGIFY -# if defined(__GFORTRAN__) || defined(_CRAYFTN) +# if defined(__GFORTRAN__) || defined(_CRAYFTN) || defined(NAGFOR) # define STRINGIFY(x) "x" # else # define STRINGIFY(x) #x