This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

equivalence object and use association


Anyone notice an issue with the following code? 

module foo
   real x
   integer m, n
   equivalence(m, n)
end module foo
!
! F95, p67: Constraint: The name of an equivalence-object shall
!  not be a name made accessible by use association.
!
! F03:C585 (R556) The name of an equivalence-object shall not
!  be a name made accessible by use association.
!
! F08:C593 (R567) The name of an equivalence-object shall not
!  be a name made accessible by use association.
!
subroutine bar
   use foo
   m = 42         ! Whoops
   print*, n      ! Whoops
end subroutine  bar

subroutine bah
   use foo, only : x
   x = 42         ! OK
   print*, x      ! OK
end subroutine  bah

program main
   call bar
   call bah
   write(*,'(A)') ':-)'
end program main

-- 
Steve


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