https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63932
Bug ID: 63932 Summary: posible problem with allocatable character(:) Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: valeryweber at hotmail dot com Dear All the following code seems to produce the wrong result with 4.9.2. thanks v cat test.f90 module mod type :: t character(:), allocatable :: c integer :: i contains procedure, pass :: get end type t type :: u character(:), allocatable :: c end type u contains subroutine get(this, a) class(t), intent(in) :: this character(:), allocatable, intent(out), optional :: a if(present(a)) a=this%c end subroutine get end module mod program test use mod type(t) :: a type(u) :: b a%c='soemthing' call a%get(a=b%c) write(*,*) b%c end program test gfortran-4.9.2 test.f90 ./a.out