This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/63932] New: posible problem with allocatable character(:)
- From: "valeryweber at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Nov 2014 11:27:40 +0000
- Subject: [Bug fortran/63932] New: posible problem with allocatable character(:)
- Auto-submitted: auto-generated
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