The following code is accepted without warning by g77, but rejected by gfortran: ==================================== integer I, A(10) I=A(1.0) end ==================================== In file bug.f:2 I=A(1.0) 1 Error: Array index at (1) must be of INTEGER type But I suppose there's lots of code containing non-integer array indices so IMHO this should only be a warning in gfortran (and an error with -pedantic like in g77). This issue is similar to the non-integer loop variables in PR 16222.
Confirmed.
Subject: Bug 16907 CVSROOT: /cvs/gcc Module name: gcc Changes by: tobi@gcc.gnu.org 2005-03-13 18:46:37 Modified files: gcc/fortran : ChangeLog resolve.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gfortran.dg: real_index_1.f90 Log message: fortran/ PR fortran/16907 * resolve.c (gfc_resolve_index): Allow REAL indices as an extension. testsuite/ PR fortran/16907 * gfortran.dg/real_index_1.f90: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.350&r2=1.351 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.36&r2=1.37 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5155&r2=1.5156 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/real_index_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 16907 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: tobi@gcc.gnu.org 2005-03-13 19:07:49 Modified files: gcc/fortran : resolve.c Added files: gcc/testsuite/gfortran.dg: real_index_1.f90 Log message: fortran/ PR fortran/16907 * resolve.c (gfc_resolve_index): Allow REAL indices as an extension. testsuite/ PR fortran/16907 * gfortran.dg/real_index_1.f90: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.34.2.2&r2=1.34.2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/real_index_1.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
Subject: Bug 16907 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: tobi@gcc.gnu.org 2005-03-13 19:09:31 Modified files: gcc/fortran : ChangeLog gcc/testsuite : ChangeLog Log message: Add ChangeLog entries for previous commit fortran/ PR fortran/16907 * resolve.c (gfc_resolve_index): Allow REAL indices as an extension. testsuite/ PR fortran/16907 * gfortran.dg/real_index_1.f90: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.11&r2=1.335.2.12 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.39&r2=1.5084.2.40
Fixed.