[Patch, Fortran] Handle GENERIC type-bound procedures
Daniel Kraft
d@domob.eu
Sat Aug 30 16:31:00 GMT 2008
Hi,
this is a follow-up patch to my recent type-bound procedures
implementation to handle GENERIC bindings and it also includes some
minor tweaks to the general type-bound procedures handling.
GENERIC bindings are stored as gfc_symtree with gfc_typebound_proc
structure as are specific bindings, and their "targets" are kept in a
linked list of gfc_tbp_generic nodes referencing the targetted specific
bindings.
When a call to a GENERIC procedure is found, the target matching the
actual arglist is found and inserted in its stead during resolution.
There are two XXX comments in the source where I'd like to hear your
opinions, and I found a nasty, incomprehensible section in the standard
(16.2.3 Restrictions on generic declarations) that deals with
restrictions in respect to passed-object dummy arguments. This section
is not yet implemented, I currently use the existing routines from
interface.c to check for ambiguous interfaces. As I see it, this can
lead to possible accepts-invalid's in special cases that would allow
that a call to a GENERIC binding might have ambiguous actual arglists.
In such a case a "random one" of the targets would be picked and called.
I suggest to open a PR for this and not handle it directly with this
patch as it is already quite big and I don't think I've understood that
section well enough to do it at the moment...
Apart from these points, the patch should be quite ready; if this gets
reviewed and checked-in before my documentation patch pending, I'll
update that to document GENERIC, too; otherwise I'll submit a new
documentation patch when GENERIC handling is checked in. Ok?
(Regression-tested on GNU/Linux-x86-32 without failures.)
So, and now I'm awaiting your comments...
Daniel
--
Done: Arc-Bar-Cav-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
To go: Hea-Kni-Mon-Pri-Ran-Rog-Tou
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.changelog
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080830/5651fec5/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080830/5651fec5/attachment-0001.ksh>
More information about the Fortran
mailing list