This is a problem very similar to this one:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42008

gfortran rejects the attached code because:

gfortran -c err.f90 
err.f90:6.20:

    integer :: i = 0
                    1
Error: Initialization of variable at (1) is not allowed in a PURE procedure

However, I think that the program is fine.


module mod_xyz
 implicit none
contains
 pure subroutine psub()
  type ilist
    integer :: i = 0
  end type ilist
 end subroutine psub
end module mod_xyz


-- 
           Summary: Wrongly rejected derived types with default initializers
                    in PURE procedures 2
           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 20100125 (experimental)


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

Reply via email to