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.
From-SVN: r96385
2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+ PR fortran/16907
+ * resolve.c (gfc_resolve_index): Allow REAL indices as an extension.
+
+2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
PR fortran/20323
* resolve.c (gfc_resolve): Check if character lengths are
specification expressions.
PR fortran/20323
* resolve.c (gfc_resolve): Check if character lengths are
specification expressions.
if (gfc_resolve_expr (index) == FAILURE)
return FAILURE;
if (gfc_resolve_expr (index) == FAILURE)
return FAILURE;
- if (index->ts.type != BT_INTEGER)
+ if (check_scalar && index->rank != 0)
- gfc_error ("Array index at %L must be of INTEGER type", &index->where);
+ gfc_error ("Array index at %L must be scalar", &index->where);
- if (check_scalar && index->rank != 0)
+ if (index->ts.type != BT_INTEGER && index->ts.type != BT_REAL)
- gfc_error ("Array index at %L must be scalar", &index->where);
+ gfc_error ("Array index at %L must be of INTEGER type",
+ &index->where);
- if (index->ts.kind != gfc_index_integer_kind)
+ if (index->ts.type == BT_REAL)
+ if (gfc_notify_std (GFC_STD_GNU, "Extension: REAL array index at %L",
+ &index->where) == FAILURE)
+ return FAILURE;
+
+ if (index->ts.kind != gfc_index_integer_kind
+ || index->ts.type != BT_INTEGER)
{
ts.type = BT_INTEGER;
ts.kind = gfc_index_integer_kind;
{
ts.type = BT_INTEGER;
ts.kind = gfc_index_integer_kind;
+2003-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/16907
+ * gfortran.dg/real_index_1.f90: New test.
+
2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/20323
2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/20323
--- /dev/null
+! { dg-do run }
+! PR 16907 : We didn't support REAL array indices as an extension
+ integer I, A(10)
+ A = 2
+ I=A(1.0) ! { dg-warning "Extension" }
+ if (i/=2) call abort ()
+ end