The following program compiles in gfortran. I don't know how easily it could be detected, but defining a scalar and using it as an array should be detectable?
For what it is worth: ifort also does not detect this error. Changing the "integer :: j = 1" into "integer :: j; j = 1" causes gfortran to emit an error: "Unexpected STATEMENT FUNCTION statement" (and also ifort now writes: "This name has not been declared as an array or a function.") ------------------------ program bug implicit none real :: del integer :: j = 1 del(j)=sin(10.0) print *, del(3) end ------------------------ -- Summary: Should give an error when using: real :: r; r(j) = ... Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tobias dot burnus at physik dot fu-berlin dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29505