[Patch, fortran] PR26779 - Internal module procedure may not have private type dummy arguments
Paul Thomas
paulthomas2@wanadoo.fr
Tue Mar 21 23:12:00 GMT 2006
:ADDPATCH fortran:
This error is generated by the example, given at the end of Metcalf, Reid and
Cohen - pointer.f90. The attached testcase, illustrates the problem:
In the absence of a patch, the following error is produced:
In file private.f90:11
call init(root, arg)
1
Error: 'ir' is of a PRIVATE type and cannot be a dummy argument of 'init',
which is PUBLIC at (1)
Being an internal procedure, init is NOT public by 2.2.3.3 of the F95 standard.
It should have access to all the symbols of its host, therefore this error is
wrong on both levels; ir cannot be private to it, nor is init public!
The patch is easy - simply do not do the test for an internal procedure.
Regtested on FC3/Athlon - OK for trunk and 4.1?
Paul
2006-03-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26779
*resolve.c (resolve_fl_procedure): Do not check the access of
components for internal procedures..
2006-03-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26779
* gfortran.dg/private_type_5.f90: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: submit.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060321/4f26edb1/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: private_type_5.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060321/4f26edb1/attachment.f90>
More information about the Fortran
mailing list