[Patch, Fortran, F2008] PR 44549: Type-bound procedure: bogus error from list after PROCEDURE

Janus Weil janus@gcc.gnu.org
Wed Jun 16 03:48:00 GMT 2010


Hi all,

my recent patch for PR 40117, implementing type-bound procedure lists,
cf. http://gcc.gnu.org/ml/fortran/2010-06/msg00122.html, had one
problem (which was just discovered by Dominique): When parsing the
list of procedures, it gave the same gfc_typebound_proc structure to
all of them (i.e. a pointer to the same location). This of course
creates serious problems as the test case shows (e.g. when mixing
functions and subroutines in a list). The attached patch fixes this
deficiency by first parsing the common binding flags into one such
structure, and later on putting copies of this one into the symtrees
of the procedures.

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

Cheers,
Janus



2010-06-15  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44549
	* gfortran.h (gfc_get_typebound_proc): Modified Prototype.
	* decl.c (match_procedure_in_type): Give a unique gfc_typebound_proc
	structure to each procedure in a procedure list.
	* module.c (mio_typebound_proc): Add NULL argument to
	'gfc_get_typebound_proc'.
	* symbol.c (gfc_get_typebound_proc): Add a new argument, which is used
	to initialize the new structure.


2010-06-15  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44549
	* gfortran.dg/typebound_proc_16.f03: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr44549.diff
Type: application/octet-stream
Size: 4518 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100616/66b9a43d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typebound_proc_16.f03
Type: application/octet-stream
Size: 1607 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100616/66b9a43d/attachment-0001.obj>


More information about the Gcc-patches mailing list