This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] Handle GENERIC type-bound procedures
- From: Tobias Burnus <burnus at net-b dot de>
- To: Daniel Kraft <d at domob dot eu>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 30 Aug 2008 23:54:12 +0200
- Subject: Re: [Patch, Fortran] Handle GENERIC type-bound procedures
- References: <48B912CF.4040109@domob.eu>
Hi Daniel,
Daniel Kraft wrote:
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.
Thanks. (Note to others: OPERATOR(...) and ASSIGNMENT(=) do not work yet.)
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...
Deferring to a PR is OK.
(Regression-tested on GNU/Linux-x86-32 without failures.)
+ /* Try the bindings on this type and in the inheritance hierarchie. */
Typo: hierarchy
+/* XXX: Should I incorporate this and match_generic_in_type? */
+
+match
+gfc_match_generic (void)
I would put them in one function; I think it is unlikely that gfc_match_generic will serve any other function then match_generic_in_type and gfc_match_generic is almost empty.
+ /* XXX: Do we have to do access checking here? What's about this code:
[...]
+ Is this valid or invalid? */
Very good question. I would claim it is valid: "An extended type has a scalar, nonpointer, nonallocatable, parent component with the type and type parameters of the parent type. The name of this component is the parent type name. It has the accessibility of the parent type." ("4.5.6.1 Inheritance")
Thus proc should be accessible in t2 and thus it should work. I know that f95 does not agree with me and thus one should maybe ask at c.l.f.
The patch is OK for the trunk; the accessibility part could be deferred. (I would like to see this patch soon checked in as it modifies match_binding_attributes, which is also modified by the proc pointer components patch, I would like to get in before stage3 starts.)
Tobias