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

            Bug ID: 115265
           Summary: Generic function for constructor not invoked for
                    same-name derived type with procedure pointer
                    component
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mkrupcale at gmail dot com
  Target Milestone: ---

Created attachment 58303
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58303&action=edit
Derived type constructor with or without procedure pointer component test case

The attached code results in a SIGSEGV while trying to assign to y_ when
compiled with gfortran (at least since v5.5) and the type t contains a
procedure pointer component [1]. Instead of calling the generic function
constructor, it seems that the implicit structure constructor is being invoked,
which will not allocate y_. This does not segfault when compiled with Intel ifx
or LLVM flang, with or without the procedure pointer component.

[1] https://godbolt.org/z/Yq81cx4zz

Reply via email to