Daniel Kraft wrote:
once again a slightly revised version; I converted the warnings back
to errors as suggested by Paul and Tobias. The second change is that
I converted the calls inside resolve_actual_arglist from
resolve_procedure_expression to the general gfc_resolve_expr, so as to
"fix the problem" that this was never called for procedure actual
argument expressions. I believe this is the cleaner solution, but I'm
also fine with using the old version of the patch instead.
No regressions on GNU/Linux-x86-32 for this one, either.
OK. Maybe it is better to change the gfc_error back to a warning as one
can indeed produce valid programs (which do some thing) using procedure
pointers.
At least for proc pointer that would be in line with Dominique's and
Jerry's preference, with James' program (see c.l.f), and I also don't
feel well rejecting valid programs. One could do it context dependent,
i.e. only reject actual arguments and warn for the rest, but that seems
to be more work, which could be deferred to a later patch (if needed).
(I checked with a couple of compilers, for actual arguments ifort and
NAG f95 give an error; for proc pointers: ifort does not support
"procptr => self" at all and NAG does not support proc pointers. g95
(incl. proc pointer), sunf95, openf95, pgf95 and pathf95 print no
diagnostics.)
Tobias