From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3296 invoked by alias); 18 Nov 2014 11:27:44 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3268 invoked by uid 48); 18 Nov 2014 11:27:40 -0000 From: "valeryweber at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/63932] New: posible problem with allocatable character(:) Date: Tue, 18 Nov 2014 11:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: valeryweber at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01632.txt.bz2 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