(j3.2006) Structure constructors that look like generic function references

Lionel, Steve steve.lionel
Tue Jun 28 04:30:52 EDT 2011

F2003 allows derived types and generic interfaces to have the same name (F2008 16.3.1, 440p3)  I presume that this was to allow the use of a generic function as a form of executable constructor for a derived type.  Indeed, note 4.58 (F2008 p80) says:

The form 'name(...)' is interpreted as a generic function-reference if possible; it is interpreted as a structure-
constructor only if it cannot be interpreted as a generic function-reference.

However, elsewhere on p80 is the following constraint on structure constructors:

C496 (R455) If derived-type-spec is a type name that is the same as a generic name, the component-spec-list
shall not be a valid actual-arg-spec-list for a function reference that is resolvable as a generic reference
to that name (

My reading is that this constraint outlaws the very usage note 4.58 proposes, and prevents references to any generic function if the generic shares the name of a derived type, and thus prohibits the use of a generic function as an executable constructor.

What is intended here? I think that C496 should be removed and Note 4.58 promoted to normative wording.

Steve Lionel
Developer Products Division
Software and Services Group
Intel Corporation
Merrimack, NH

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20110628/3e7ba201/attachment.html>

More information about the J3 mailing list