The following mini program gives an error in other compilers, but not in
gfortran, we should check whether we need to give an error as well.

Cf.
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/1cb58e9fed576fbe

---------------------------
CHARACTER string*1025
INTEGER i
DATA (string(i:i),i=1,1025)/1025*'?'/ 
end
---------------------------

$ g95 foo1.f90
In file foo1.f90:3
DATA (string(i:i),i=1,1025)/1025*'?'/
      1
Error: DATA element inside iterator at (1) must be an array element or a scalar
structure component

$ f95 foo1.f90  # NAG
f95 foo1.f90
Error: foo1.f90, line 3: Substring in data-implied-do
       detected at )@,

$ sunf95 foo1.f90
DATA (string(i:i),i=1,1025)/1025*'?'/
            ^
"foo1.f90", Line = 3, Column = 13: ERROR: A DATA implied-DO target must be an
array element or scalar structure component reference.

(It is accepted with "ifort -stand f95 -warn all".)


At a glance, I cannot find this restriction in the Fortran 2003 standard.
We should also check the corrigenda and F95+corrigenda.
http://gcc.gnu.org/wiki/GFortranStandards


-- 
           Summary: DATA implied-do substring allowed with -std=f95/f2003
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          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=30792

Reply via email to