https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98890
Bug ID: 98890
Summary: ICE on reference to module function
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
gfortran ICEs on the following testcase:
module foo
contains
real function bar(x)
real :: x(2,2)
bar=baz*x(1,1)
end function bar
real function baz(x)
real :: x(2,2)
baz=x(1,1)
end function baz
end module foo
Doesn't say anything even with implicit none, so maybe it is ok that baz lookup
gives the module function rather than a local variable, but shouldn't something
complain that it refers to the module function in an invalid way (rather than
say calling it)? Originally this was reported due to a typo (the baz* should
have been bar* ).
If baz returns some incompatible type such as integer, then an error is
diagnosed.