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

            Bug ID: 122566
           Summary: [PDT] rejects grandparent component access
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at archaeologic dot codes
  Target Milestone: ---

$ cat reproducer.f90 
module double_precision_file_m
  implicit none

  type file_t
  end type

  type, extends(file_t) :: double_precision_file_t
  end type

  type, extends(double_precision_file_t) :: training_configuration_t(m)
    integer, kind :: m = kind(1.)
  end type

contains
  pure module function training_configuration()
    type(training_configuration_t) training_configuration
    training_configuration%file_t = file_t()
  end function
end module

$ gfortran -c reproducer.f90 
reproducer.f90:17:34:

   17 |     training_configuration%file_t = file_t()
      |                                  1
Error: ‘file_t’ at (1) is not a member of the ‘Pdttraining_configuration_t_4’
structure

$ gfortran --version
GNU Fortran (GCC) 16.0.0 20251104 (experimental)

Reply via email to