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

            Bug ID: 128764
           Summary: [OOP] ICE in gfc_get_derived_type for an IMPLICIT
                    CLASS allocatable
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jvdelisle at gcc dot gnu.org
  Target Milestone: ---

Given:

module m
  implicit none
  type :: t
    integer :: c
  end type
end module
program prog
  use m
  implicit class(t) (x)
  allocatable :: x
  x = t(1)
end program

internal compiler error: Segmentation fault
  gfc_get_derived_type (trans-types.cc)

With "class(t), allocatable :: x" instead of the IMPLICIT statement it
compiles.  flang accepts it.

The class container __class_m_T_a built for the implicitly typed x has
a _vptr component whose ts.u.derived is NULL, and gfc_get_derived_type
dereferences it when the declaration of x is translated.
  • [Bug fortran/128764] New: [OOP] ... jvdelisle at gcc dot gnu.org via Gcc-bugs

Reply via email to