This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
equivalence object and use association
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org
- Date: Wed, 1 Nov 2017 12:18:19 -0700
- Subject: equivalence object and use association
- Authentication-results: sourceware.org; auth=none
- Reply-to: sgk at troutmask dot apl dot washington dot edu
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