https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86888

            Bug ID: 86888
           Summary: [F08] allocatable components of indirectly recursive
                    type
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janus at gcc dot gnu.org
  Target Milestone: ---

Test case:


type :: s
   type(t), allocatable :: x
end type

type :: t
   type(s), allocatable :: y
end type

end


gfortran trunk rejects this with:

    type(t), allocatable :: x
                          1
Error: Derived type at (1) has not been previously defined and so cannot appear
in a derived type definition


IIUC this is valid in F08:

C440 (R436) If neither the POINTER nor the ALLOCATABLE attribute is specified,
the declaration-type-spec in the component-def-stmt shall specify an intrinsic
type or a previously defined derived type.

ifort 18 accepts it happily.

Reply via email to