This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] Calling type-bound procedures
Daniel Kraft wrote:
Committed as rev. 139724. I'll start working on the documentation
stuff tomorrow, hopefully :) GENERIC or PROCEDURE(interface) will be
the next things to follow that (PROCEDURE(interface) can't be
implemented without abstract types, IIRC? Or did I misunderstand this?)
I would start with GENERIC, esp. with "GENERIC :: procname =>" [the
ASSIGNMENT() and OPERATOR() are less useful, but probably quite easy
when procname works]. I see more value in this than in abstract types,
especially as long as CLASS does not work. (Personal opinion, change the
order if you think abstract interfaces are more useful or you like
implementing them more.)
* * *
Abstract types should be rather trivial to implement: One simply does
not allow "TYPE(abstract_type)". When resolving an abstract type, one
needs to check that that type is not BIND(C) or SEQUENCE (because then
it is not extensible, cf. C428).
Any you are right with regards to procedure(interface). The standard has:
C470 (R453) DEFERRED shall appear if and only if interface-name appears.
C427 (R429) If the type definition contains or inherits (4.5.6.1) a
deferred binding (4.5.4), ABSTRACT shall appear.
C470 means that you always need DEFERRED if there is a
"(interface_name)" and then C27 states: if there is DEFERRED, you need
to have an abstract type. (Obviously, NON_OVERRIDABLE does not make
sense for DEFERRED and is thus not allowed, cf. C469.)
Note: A "type, extends(some_abstracttype) :: t" becomes only then valid
when all DEFERRED procedures are overridden - otherwise it have the
"abstract" attribute (C427). Note further that an abstract type may
contain a non-deferred TBP, though without CLASS that is not of much use.
Can you update the GFortran#news, Fortran2003 and Fortran2003status
wiki pages after the check in? (When GCC has entered stage3, I will
post a patch for the official GCC 4.4 changelog, incorporating all
unmentioned changes of the GFortran#news wiki page.)
I'll do so now.
Thanks for your fantastic work!
Tobias