This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51589] Modification of loop index variable by intent(out) or intent(inout) procedures


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51589

--- Comment #5 from Walter Spector <w6ws at earthlink dot net> 2011-12-17 19:04:12 UTC ---
It seems like intent information should be available when the procedures are
USE associated, as opposed to the internal procedures.  However gfortran does
not diagnose that case either.  Here is an expanded test case:

module intent_mod
  implicit none

contains

  subroutine submod1 (idx)
    integer, intent(inout) :: idx

    idx = 42

  end subroutine

  subroutine submod2 (idx)
    integer, intent(out) :: idx

    idx = 11

  end subroutine

end module

program intents
  use intent_mod
  implicit none

  integer :: i

  do, i=1,10
    call sub1 (i)
    print *, i
    call sub2 (i)
    print *, i
    call submod1 (i)
    print *, i
    call submod2 (i)
    print *, i
  end do

contains

  subroutine sub1 (idx)
    integer, intent(inout) :: idx

    idx = 42

  end subroutine

  subroutine sub2 (idx)
    integer, intent(out) :: idx

    idx = 11

  end subroutine

end program


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]