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

            Bug ID: 84122
           Summary: Incorrect statement sequence in PDT definition
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: neil.n.carlson at gmail dot com
  Target Milestone: ---

Here's yet another case of where the PDT implementation has not correctly
distinguished derived type parameters from the components of the type.
(c.f. PR84119 and PR84120)

R425 (F08) defines the sequence of statements in a derived type. First come
type parameter definitions, then optionally the PRIVATE statement, followed by
the definition of the type components.

So this is valid code

module mod
type foo(dim)
  integer,len :: dim
  private
  integer :: array(dim)
end type
end module

But gfortran rejects it with this error:

   private
         1
Error: PRIVATE statement at (1) must precede structure components

as it incorrectly considers the type parameters structure components.

Reply via email to