This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/63232] New: Deferred length character field of derived type looses its value when used in subroutine call
- From: "baradi09 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Sep 2014 21:12:50 +0000
- Subject: [Bug fortran/63232] New: Deferred length character field of derived type looses its value when used in subroutine call
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63232
Bug ID: 63232
Summary: Deferred length character field of derived type looses
its value when used in subroutine call
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: baradi09 at gmail dot com
Created attachment 33477
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33477&action=edit
Fortran source file demonstrating the erroneous behavior
Take a deferred length allocatable character component in a derived type. Pass
this to a subroutine, which expects an allocatable deferred length character as
argument. Whatever value is given to it within the subroutine, its value is
lost (empty string) when the program leaves the subroutine.
Attached example demonstrates that. While the first print statement within the
subroutine shows the correct string, the second one in the main program
indicates a character component which is allocated, but has the empty string as
content.