[Patch, Fortran, OOP] PR 48095: Invalid assignment to procedure pointer component not rejected

Janus Weil janus@gcc.gnu.org
Mon Mar 28 22:49:00 GMT 2011


Hi all,

the attached patch fixes a problem with assignments to procedure
pointer components: The checking for such assignments did only work
within one module, but not across modules. The reason for this was
that the "ts.interface" field was not being written to the module
file.

The patch fixes this by writing the field to the mod file. It also
bumps the module version number and takes care of a few regression
introduced by the former change. It fixes comment #3 in the PR, which
is included as a test case. There is a remaining problem in the PR
(related the pointer initialization) which I will take care of
subsequently.

The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2011-03-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/48095
	* decl.c (match_procedure_decl,match_ppc_decl): Set flavor of interface.
	* module.c (MOD_VERSION): Bump.
	(mio_typespec): Read/write 'interface' field.
	* primary.c (match_string_constant,match_logical_constant): Remove
	unneeded code.
	(match_complex_constant): Make sure to clear the typespec.

2011-03-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/48095
	* gfortran.dg/module_md5_1.f90: Modified MD5 sum.
	* gfortran.dg/proc_ptr_comp_32.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr48095.diff
Type: text/x-diff
Size: 3154 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110328/f7394cd0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proc_ptr_comp_32.f90
Type: text/x-fortran
Size: 805 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110328/f7394cd0/attachment-0001.bin>


More information about the Gcc-patches mailing list