This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] Calling type-bound procedures


Hi Daniel,

> this is the cleaned-up version of my patch to allow for calling
> type-bound procedures posted yesterday including a ChangeLog.

As a small thing: I think one should update dump-parse-tree.c; I think
everyone tends to forget it and it is almost never used.

 * * *

I like your patch. However - thanks to NAG f95 - I just realized that we
currently cannot implement PASS in a standard conforming matter. The
reason is:

C453 The passed-object dummy argument shall be a scalar, nonpointer,
     nonallocatable dummy data object with the same declared type as
     the type being defined; all of its length type parameters
     shall be assumed; it shall be polymorphic (5.1.1.2) if and only
     if the type being defined is extensible.

The problem with PASS for all type-bound procedures and for procedure-
pointer components in non-SEQUENCE, non-BIND(C) procedures is the
following: The type needs to by polymorphic, i.e. instead of

  TYPE(mytype) :: dummy_arg
one needs
  CLASS(mytype):: dummy_arg

Thinking about it, it makes sense: Unless the procedure is overwritten,
the type%inherited_proc() won't work. (I have not checked what happends
currently.)

The big question is now how to handle this? For proc pointer comps with
SEQUENCE and BIND(C) [assuming PASS is allowed for them, I have not
checked] the current machinary can be used, but for an ordinary,
extensible type? Shall we abort in this case with "Sorry, not
implemented"? Too bad that Paul has not managed to recreate his CLASS
patch :-(

Somehow type-bound procedures without PASS loose a lot of their
usefulness. Except for this point I think the patch is OK.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]