https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85130

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #4 from anlauf at gcc dot gnu.org ---
F2018 has the following changed text in 9.4.1  Substrings:

... If the starting point is greater than the ending point, the substring
has length zero; otherwise, both the starting point and the ending point
shall be within the range 1, 2, ..., n. ...

Thus the following code would be legal:

character(5), parameter :: c0(1) = [ "12345" ]
print *, c0(1)(-5:-8)
end

and print an empty string, while it currently prints junk.

It does the right thing with current trunk when parameter is removed, though.

Reply via email to