http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51976



--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> 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

Reply via email to