From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27170 invoked by alias); 9 Feb 2013 20:34:18 -0000 Received: (qmail 26705 invoked by uid 48); 9 Feb 2013 20:34:00 -0000 From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51976] [F2003] Support deferred-length character components of derived types (allocatable string length) Date: Sat, 09 Feb 2013 20:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pault at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-02/txt/msg00937.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51976 --- Comment #7 from Paul Thomas 2013-02-09 20:33:56 UTC --- Created attachment 29406 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29406 Draft patch for the PR This turned out to be easier than I expected. It obviously needs a bit of cleaning up; deferred character length variables should be made consistent with their variable cousins. This will not take much doing and I expect to submit the patch tomorrow. Bootstraps and regtests on trunk. Proto-testcase: type t character(len=:), allocatable :: str_comp end type t type(t) :: x allocate (x%str_comp, source = "abc") print *, len (x%str_comp), x%str_comp deallocate (x%str_comp) allocate (x%str_comp, source = "abcdefghijklmnop") print *, len (x%str_comp), x%str_comp x%str_comp = "xyz" print *, len (x%str_comp), x%str_comp x%str_comp = "abcdefghijklmnop" call foo (x%str_comp) contains subroutine foo (chr) character (*) :: chr print *, len (chr), chr end subroutine end Cheers Paul