[Bug fortran/78578] New: character(len=:),allocatable :: CStr

2016-11-28 Thread qingfeng198325 at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78578

Bug ID: 78578
   Summary: character(len=:),allocatable :: CStr
   Product: gcc
   Version: 6.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: qingfeng198325 at 126 dot com
  Target Milestone: ---

program Main
  implicit none
  integer :: ins
  type str
 character(len=:),allocatable :: CStr(:)
   end type
   type(str) ::tstr

   allocate(character(len=20)::tstr%CStr(20))

   tsrt%CStr(1) ="20"
   tsrt%CStr(20) ="30"

   print*,tsrt%CStr(:)   !error


end program

[Bug fortran/78578] character(len=:),allocatable :: CStr(:)

2016-11-28 Thread qingfeng198325 at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78578

--- Comment #2 from zengxiaoqing  ---
Program Main
  implicit none
  integer :: ins
  type str
 character(len=:),allocatable :: CStr(:)
   end type
   type(str) ::tstr

   allocate(character(len=20)::tstr%CStr(20))

   tstr%CStr(1) = "20"
   tstr%CStr(2:19) = " "
   tstr%CStr(20) ="30"

   print*,tstr%CStr(:)   !error
End Program Main