[Patch, fortran] PR20903 - types shouldn't propagate into interfaces
Paul Thomas
paulthomas2@wanadoo.fr
Tue Jul 11 14:20:00 GMT 2006
:ADDPATCH fortran:
To quote the standard:
"An interface body specifies all of the procedure's characteristics and
these
shall be consistent with those specified in the procedure definition, except
that the interface may specify a procedure that is not pure if the procedure
is defined to be pure(12.3.2)."
At present, gfortran violates this by allowing derived types to be
declared outside of the scope of the interface body. The patch does not
need any further description. The testcase checks both the error and
that nothing is broken; specifically, it checks that internally declared
and use associated derived types are accepted.
Regtested on FC5/Athlon. OK for trunk and 4.1?
Paul
2006-07-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20903
* decl.c (variable_decl): Add error if a derived type is not
from the current namespace if the namespace is an interface
body.
2006-07-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20903
* gfortran.dg/interface_derived_type_1.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr20903.diff
Type: text/x-patch
Size: 1119 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060711/19e19100/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interface_derived_type_1.f90
Type: text/x-fortran
Size: 1372 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060711/19e19100/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Change.Logs
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060711/19e19100/attachment.ksh>
More information about the Fortran
mailing list