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/29505] New: Should give an error when using: real :: r; r(j) = ...


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


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