[Patch, Fortran] PR39850: Too strict checking for procedures as actual argument

Janus Weil janus@gcc.gnu.org
Sat Jun 20 16:58:00 GMT 2009


Hi all,

the attached patch loosens the checking for function/subroutine
attributes in procedure actual arguments (and procedure pointer
assignments). Now this is done only if both the actual and the formal
arg have an explicit interface (and are not just declared with
EXTERNAL). It was done wrongly in two test cases in the testsuite
(interface_21.f90 and proc_decl_8.f90).

Moreover the patch includes a small bugfix, which I discovered just by
reading through the code in gfc_compare_interface. Fixing this also
revealed an error in the test case proc_ptr_11.f90.

Regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2009-06-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39850
	* interface.c (gfc_compare_interfaces): Only check attr.function and
	attr.subroutine if both interfaces are explicit. Plus another bugfix.


2009-06-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39850
	* gfortran.dg/interface_19.f90: Add 'cleanup-modules'.
	* gfortran.dg/interface_20.f90: Ditto.
	* gfortran.dg/interface_21.f90: Fix invalid test case.
	* gfortran.dg/interface_22.f90: Add 'cleanup-modules'.
	* gfortran.dg/interface_30.f90: New.
	* gfortran.dg/proc_decl_8.f90: Fix invalid test case.
	* gfortran.dg/proc_ptr_11.f90: Ditto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr39850.diff
Type: text/x-patch
Size: 4168 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090620/4eda42e1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interface_30.f90
Type: text/x-fortran
Size: 470 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090620/4eda42e1/attachment-0001.bin>


More information about the Fortran mailing list