------- Comment #4 from burnus at gcc dot gnu dot org  2007-12-14 17:19 -------
By the way, your patch does not work, unless I messed up locally. For the
example of comment 0 I get "Hayash" and not "Hayashi":

  static character(kind=1)[1:6] * A.1[3]= {&"Takata"[1]{ ...

Test case:

! { dg-do run }
!
! PR fortran/27997
!
! Support array constructors with typespec.
!
program test
  implicit none
  character(15) :: a(3)
  a =  (/ character(len=7) :: 'Takata', 'Tanaka', 'Hayashi' /)
  if ( len([ character(len=7) :: ]) /= 7) call abort()
  if ( size([ integer :: ]) /= 0) call abort()
  if(     a(1) /= 'Takata'  .or. a(1)(7:7)   /= achar(32) &
                            .or. a(1)(15:15) /= achar(32) &
     .or. a(2) /= 'Tanaka'  .or. a(2)(7:7)   /= achar(32) &
                            .or. a(2)(15:15) /= achar(32) &
     .or. a(3) /= 'Hayashi' .or. a(3)(8:8)   /= achar(32))&
                            .or. a(1)(15:15) /= achar(32))&
   call abort()
end program test


-- 


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

Reply via email to