flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
230 stars 48 forks source link

Substring are transformed into reference to the whole string #1091

Closed jeanPerier closed 4 years ago

jeanPerier commented 4 years ago
  character(5) :: c = "abcde"
  print *, c(2:3)
end

f18 -funparse:

 CHARACTER(LEN=5_4) :: c = "abcde"
 PRINT *, c
END PROGRAM

If I add PARAMETER to c, the output becomesPRINT *, "abcde" which is also wrong.

klausler commented 4 years ago

PR #1093.

klausler commented 4 years ago

Should now be fixed; please close when convenient if so.

jeanPerier commented 4 years ago

Thanks ! I could test that the fix solved my issue.