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

            Bug ID: 59060
           Summary: Accepts invalid ? Missing component data value for
                    component "D1" of TYPE("T2")
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch

Testcase:

MODULE M1
 TYPE T1
   INTEGER, PRIVATE :: I=0
 END TYPE T1
 TYPE T2
   TYPE(T1) :: D1
 END TYPE T2
 TYPE(T2), PARAMETER :: D2=T2()
END MODULE M1

gfortran and pgi compile this, while intel, cray and g95 give an error message
along the lines:

ftn-1767 crayftn: ERROR M1, File = bug.f90, Line = 8, Column = 28 
  Missing component data value for component "D1" of TYPE("T2").

Given that T1 has a default initialization, I'm not 100% sure that the bug is
on the gfortran side, however, if I comment out the 'initializer' for D2,
gfortran generates an error, even though all structure components have a value
(so at least, gfortran is not very consistent).

Reply via email to