This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47768] New: ICE: printing a derived-type variable with proc-pointer components
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Feb 2011 17:51:55 +0000
- Subject: [Bug fortran/47768] New: ICE: printing a derived-type variable with proc-pointer components
- Auto-submitted: auto-generated
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