Skip to content

Commit e80dee5

Browse files
committed
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.
1 parent 768b019 commit e80dee5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

example/derived-type_diagnostic.F90

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ pure module function construct(z) result(new_stuff_t)
4343

4444
contains
4545

46-
module procedure defined
46+
pure module function defined(self) result(self_defined)
47+
class(stuff_t), intent(in) :: self
48+
logical self_defined
49+
4750
self_defined = self%defined_
48-
end procedure
51+
end function
4952

5053
module procedure construct
5154
new_stuff_t%z_ = z
@@ -103,12 +106,15 @@ pure module function construct(stuff) result(new_characterizable_stuff)
103106

104107
contains
105108

106-
module procedure as_character
109+
pure module function as_character(self) result(character_self)
110+
class(characterizable_stuff_t), intent(in) :: self
111+
character(len=:), allocatable :: character_self
112+
107113
integer, parameter :: max_len=256
108114
character(len=max_len) untrimmed_string
109115
write(untrimmed_string,*) self%stuff_%z()
110116
character_self = trim(adjustl(untrimmed_string))
111-
end procedure
117+
end function
112118

113119
module procedure construct
114120
new_characterizable_stuff%stuff_ = stuff

0 commit comments

Comments
 (0)