The incorrect code below causes an segmentation fault in the latest gfortran. I am using
gcc version 4.5.0 20091130 (experimental) [trunk revision 154853] (GCC) The program compiles and works if I make the type "time" public. However, an error message would be nice. Code: MODULE run_example_fortran03 IMPLICIT NONE PRIVATE PUBLIC :: I4B, DP, epoch !PUBLIC :: time INTEGER, PARAMETER :: I4B = SELECTED_INT_KIND(9) INTEGER, PARAMETER :: DP = SELECTED_REAL_KIND(15,307) TYPE epoch INTEGER(I4B) :: i = 2451545 REAL(DP) :: f = 0.5_DP END TYPE epoch TYPE, EXTENDS(epoch) :: time REAL(DP) :: t = 0.0_DP END TYPE time END MODULE run_example_fortran03 PROGRAM example_fortran03 USE run_example_fortran03 IMPLICIT NONE CLASS(epoch), ALLOCATABLE :: e4 ! Allocate a class ALLOCATE(epoch::e4) WRITE(*,*) e4%i, e4%f STOP END PROGRAM example_fortran03 -- Summary: Compiler segmentation fault due missing public statement Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: oystein dot olsen at astro dot uio dot no GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42257