[Bug fortran/85395] [F03] private clause contained in derived type acquires spurious scope
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 7 14:05:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85395
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
CC| |janus at gcc dot gnu.org
--- Comment #3 from janus at gcc dot gnu.org ---
Slightly reduced test case:
module defs
implicit none
type :: base
! this is ok
! private
contains
! This private clause acquires spurious scope
private
end type
type :: options
integer :: i
procedure(), pointer, nopass :: ptr
end type
end module
program p
use defs
implicit none
type(options) :: self
self%i = 0
self%ptr => null()
end
Two observations:
1) The problem only occurs if the PRIVATE statement comes after CONTAINS (not
before).
2) It only affects procedure pointer components, but not normal data
components.
More information about the Gcc-bugs
mailing list