This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47768] New: ICE: printing a derived-type variable with proc-pointer components


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47768

           Summary: ICE: printing a derived-type variable with
                    proc-pointer components
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: janus@gcc.gnu.org


Test case:


type :: t
  integer :: i = 3
  !type(t), pointer :: p     ! rejected with this line
  procedure(type(t)), pointer, nopass :: ppc
end type 

type(t) :: x

print *,x
end



This segfaults with 4.5 and 4.6. Adding a data pointer component leads to
rejection:

print *,x
         1
Error: Data transfer element at (1) cannot have POINTER components

So I'm guessing the version with proc-pointer is also illegal (haven't checked
the standard).

Changing the proc-pointer to

  procedure(integer), pointer, nopass :: ppc

makes it compile and gives the output:

           3           0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]