https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123899
Bug ID: 123899
Summary: Wrong result from SHAPE on assumed-rank dummy with
0-sized actual argument
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: neil.n.carlson at gmail dot com
Target Milestone: ---
The program
call sub([integer::]) ! passing a 0-sized integer array
contains
subroutine sub(x)
integer x(..)
print *, "shape(x) =", shape(x)
end subroutine
end
should print "shape(x) = 0" but is printing "shape(x) = -1" as if x were a
rank-1 assumed-size array.