This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/32928] New: DATA statement with array element as initializer is rejected


Found while debugging PR32315.

program chkdata
    character(len=1), parameter,dimension(4) :: string = 'A'
    character :: a
    data a /string(4)/
end program chkdata

Is rejected:
    data a /string(4)/
                 1
Error: Syntax error in DATA statement at (1)

However, g95, NAG f95, ifort, openf95 accept it.

Note that
   data a /string(5)/
should be rejected:
   First subscript (5) is greater than upper bound (4) for array STRING


-- 
           Summary: DATA statement with array element as initializer is
                    rejected
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid, accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]