Hi all, here is a patch for an accepts-invalid problem: The Fortran standard demands that a procedure with a polymorphic dummy arguments can only be referenced with an explicit interface (see F08:12.4.2.2).
It is nontrivial to detect this in every case (e.g. passing a TYPE actual to a CLASS formal arg), but at least we can easily detect it if a polymorphic *actual* argument is involved (which means that the corresponding formal arg must also be polymorphic). The patch adds a check for this, and it also restricts the check we already have for global procedures (in order to avoid double diagnostics for these). Regtested on x86_64-unknown-linux-gnu. Ok for trunk? Cheers, Janus 2013-04-07 Janus Weil <ja...@gcc.gnu.org> PR fortran/56261 * interface.c (gfc_procedure_use): Error on polymorphic actual arguments passed to implicit interface. * resolve.c (resolve_global_procedure): Don't error on polymorphic actual arguments passed to implicit interface (to avoid double diagnostics). 2013-04-07 Janus Weil <ja...@gcc.gnu.org> PR fortran/56261 * gfortran.dg/abstract_type_6.f03: Add dg-error. * gfortran.dg/whole_file_20.f03: Check one additional case (and modified error for another). * gfortran.dg/proc_ptr_40.f90: New.
pr56261_v2.diff
Description: Binary data
proc_ptr_40.f90
Description: Binary data