SUBROUTINE a
abstract interface
subroutine abc(x)
real x
end subroutine
end interface
procedure(abc) :: abc2
entry abc2(x)
real x
x = 0
end subroutine
end
This program also crashes with my latest patch. My first thought would
be that the solution is as easy as adding a line
conf (procedure, entry)
in symbol.c (check_conflict). At least this does the job for the above
code, giving an error message a la "PROCEDURE attribute conflicts with
ENTRY attribute", thereby preventing the ICE.
But still I'm not completely sure if this solves all possible problems
with "ENTRY" and if it would reject any legal code. At least sth like
the following works fine:
function f(x) result(r)
implicit none
real r,x
r=2.*x
return
entry g(x) result(r)
r=3.*x
return
end function
program prog
procedure(real):: f,g
!real,external:: f,g
print *,f(5.)
print *,g(5.)
end program
It works with EXTERNAL as well as PROCEDURE, and my
"conf(procedure,entry)"-check does no harm since the main program just
doesn't know it the external symbols f and g are implemented as a
FUNCTION or an ENTRY.
I will post a new patch with this fix, a test case for it and a
"gfc_add_proc" function soon, provided you don't find any further
issues with ENTRY. And maybe we need some more conflict checks with
other attributes? Up to now I really only checked for those with are
accepted by "match_attr_spec". Any ideas?