GNU Fortran (GCC) 4.4.0 20090219 (experimental) [trunk revision 144289] The code below generates the output: T2%A = 42 This is wrong, the output should be: T2%A = 23
PROGRAM X TYPE T INTEGER, POINTER :: P INTEGER, ALLOCATABLE :: A(:) END TYPE T TYPE(T) :: T1,T2 ALLOCATE ( T1%A(1) ) ALLOCATE ( T2%A(1) ) T1%A = 23 T2 = T1 T1%A = 42 PRINT *, 'T2%A = ',T2%A END PROGRAM X -- Summary: bad assignment to type with allocatable component Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gilbert dot scott at easynet dot co dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39519