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: unassig...@gcc.gnu.org
        ReportedBy: ja...@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

Reply via email to