Hi Thomas,
there are already lots of places that check for do variables,
gfc_check_do_variable() does the hard work. Couldn't the same result be
achieved in a much simpler way during resolution?
Cheers,
- Tobi
On 2012-11-01 13:58, Thomas Koenig wrote:
Hello world,
after the dicsussion on c.l.f, it become clear that passing a DO loop
variable to an INTENT(OUT) or INTENT(INOUT) dummy argument is an error.
The attached patch throws an error for both cases.
I chose to issue the errors as a front-end pass because we cannot check
for formal arguments during parsing (where the other checks are
implemented).
Regression-tested. OK for trunk?
Thomas
2012-11-01 Thomas Koenig <[email protected]>
PR fortran/30146
* frontend-passes.c (do_warn): New function.
(do_list): New static variable.
(do_size): New static variable.
(do_list): New static variable.
(gfc_run_passes): Call do_warn.
(do_code): New function.
(do_function): New function.
(gfc_code_walker): Keep track fo DO level.
2012-11-01 Thomas Koenig <[email protected]>
PR fortran/30146
* gfortran.dg/do_check_6.f90: New test.