http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40453
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Enhanced argument checking: |[F95] Enhanced (recursive) | |argument checking --- Comment #1 from janus at gcc dot gnu.org 2012-10-06 14:39:48 UTC --- (In reply to comment #0) > I think some other checks should still be added, e.g. > > a) PUREness check (see example below); passing/assigning > a pure to a non-pure dummy/proc-pointer is OK; doing vice versa > is not. > > [...] > > b) Similarly for ELEMENTAL. For proc-pointer assignments, use the > first example with PURE changed to ELEMENTAL. That non-intrinsic > elementals are not allowed as actual argument, is already checked > for (cf. C1228). Except of the remark in parentheses I could not > find in F2003/F2008 anything which prohibits ELEMENTAL for the > dummy argument; however, the parentheses is normative. Maybe one > should re-check the standard before adding an error check (see > example below). Both checks for PURE and ELEMENTAL have been implemented in r179080 for PR41733. > c) One needs to go recursively over the arguments as the second > example below shows. > > [...] > > program RecursiveInterface > interface > subroutine a(x) > real :: x > end subroutine a > subroutine b(a) > integer :: a > end subroutine b > subroutine c(f) > procedure(a) :: f > end subroutine c > subroutine d(f) > procedure(b) :: f > end subroutine d > subroutine e(f) > procedure(c) :: f > end subroutine e > end interface > call e(d) ! Argument (dummy subroutine) d has an integer argument > ! but e's f expects a real argument > end program RecursiveInterface In fact this is still accepted without error.