https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80945
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org --- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> --- Created attachment 43438 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43438&action=edit A demo patch for the PR This does the job but sucks stylistically. I will sort out something better. It does regtest fine, though :-) It also fixes: program main implicit none integer:: i integer, parameter:: N = 10 character(len=:), dimension(:),allocatable:: ca character(len=:), dimension(:,:),allocatable:: cb allocate(character(len=N) :: ca(3)) ca(1) = "foo" ca(2) = "bar" ca(3) = "xyzzy" write (*, '(3A5)') ca(1:3) allocate(character(len=N) :: cb(3,2)) cb(1,1) = "foo" cb(2,1) = "bar" cb(3,1) = "xyzzy" write (*, '(3A5)') cb(1:3,1) ! Hence the assignment of the rank! end program Paul