The following error should not happen:

$ cat substr_3.f 
      implicit none
      character(len=10) :: s, t
      integer :: i, j

      s = "abcdefghij"
      t(:10) = s(1:)
      s(16:15) = "foo"
      if (s /= t) call abort
      end
$ gfortran substr_3.f
 In file substr_3.f:9

      s(16:15) = "foo"                                                  
       1
Error: Substring end index at (1) is out of bounds


-- 
           Summary: Undue compile-time error for zero-sized substring
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: fxcoudert at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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

Reply via email to