------- Comment #12 from burnus at gcc dot gnu dot org 2010-05-07 16:37 ------- Created an attachment (id=20599) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20599&action=view) Fourth version of the draft patch
And fourth version. I have just realized that the patch is too simplistic and that I might need go back to the drawing board. The following is currently not handled: a) Constraint check (cf. comment 3 [F03: C489, F08: C496]): the component-spec-list has to be different from the interface of any of the generic procedures (i.e. an actual-arg-spec-list matching the component-spec-list shall not match any of the generic functions). Note: This included handling default initializers as they act as optional arguments. b) The algorithm does not handle: Define function in one module,* define type in a different module, and use associate them [including constraint checking, cf. (a)]. Currently, the renaming is only handled if either the generic interface or the derived type is available before the other type is declared. (* That's possible because the functions do not need to return the derived type - even though that's the most common case.) I probably solve this by renaming derived types to <name>@ and automatically generating an associated generic function with the specific name <name>@ and a dummy arg list [including DT parents (plural)]. One needs to modify gfc_typename to print the type without @ and then one has also no problem with the trailing @ sign. -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20592|0 |1 is obsolete| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39427