gfortran rejects the following code because

gfortran -c mod_xyz.f90 mod_xyz.f90:9.42:

    type(ilist), pointer :: next => null()
                                          1
Error: Initialization of pointer at (1) is not allowed in a PURE procedure

My understanding however is that the code is legal (please, see also
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/141265154c2fcc71/628a3487e60395b9?hl=en#628a3487e60395b9
)

gfortran --version
GNU Fortran (GCC) 4.5.0 20091105 (experimental)


module mod_xyz

 implicit none

contains

 pure subroutine psub()
  type ilist
    type(ilist), pointer :: next => null()
    integer :: i
  end type ilist

 end subroutine psub

end module mod_xyz


-- 
           Summary: default initialization of derived type component not
                    allowed in pure subroutine
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrestelli at gmail dot com
 GCC build triplet: GNU Fortran (GCC) 4.5.0 20091105 (experimental)
  GCC host triplet: x86_64 AMD Turion(tm) 64 Mobile Technology ML-32
                    AuthenticAMD GN


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

Reply via email to