Commit b38b6477 by Tobias Schlüter Committed by Tobias Schlüter

re PR fortran/16404 (should reject invalid code with -pedantic -std=f95 ? (x8))

fortran/
* parse.c (gfc_check_do_variable): Fix error locus.

testsuite/
PR fortran/16404
* gfortran.dg/do_iterator.f90: New test.

From-SVN: r84795
parent c9583ed2
......@@ -20,6 +20,8 @@
(match_io): Reformat error message.
(match_inquire_element): Call match_out_tag where appropriate.
* parse.c (gfc_check_do_variable): Fix error locus.
2004-07-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/15129
......
......@@ -1926,7 +1926,7 @@ gfc_check_do_variable (gfc_symtree *st)
if (s->do_variable == st)
{
gfc_error_now("Variable '%s' at %C cannot be redefined inside "
"loop beginning at %L", st->name, &s->tail->loc);
"loop beginning at %L", st->name, &s->head->loc);
return 1;
}
......
......@@ -5,6 +5,9 @@
* lib/gfortran-dg.exp (gfortran-dg-runtest): Only test with all
of TORTURE_OPTIONS if test contains 'dg-do run'.
PR fortran/16404
* gfortran.dg/do_iterator.f90: New test.
2004-07-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR rtl-optimization/16536
......
! { dg-do compile }
! various checks which verify that we don't change do-iterators
DO I=1,5
I=1 ! { dg-error "cannot be redefined" "changing do-iterator 1" }
READ(5,*) I ! { dg-error "cannot be redefined" "changing do-iterator 2" }
READ(5,*,iostat=i) j ! { dg-error "cannot be redefined" "changing do-iterator 3" }
ENDDO
END
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment