https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86277
Harald Anlauf <anlauf at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de --- Comment #2 from Harald Anlauf <anlauf at gmx dot de> --- Actually, the problem is not related to zero length arrays, but to the constructor [integer::]. I think this is related to several other PRs. program test implicit none integer :: m(0) integer, allocatable :: n(:) allocate (n(0)) call i call i(m) call i(n) call i([integer::]) ! expect "optional argument present: T" call i([1]) contains subroutine i(str) integer, dimension(:), optional, intent(in) :: str write(6,*) 'optional argument present:', present(str) end subroutine i end program produces: optional argument present: F optional argument present: T optional argument present: T optional argument present: F optional argument present: T