To: J3 J3/24-128 From: generics Subject: Miscellaneous edits to incorporate templates Date: 2024-June-10 References: 24-125, 24-126, 24-127 1. Introduction =============== This paper describes many edits to the standard that will be required in order to incorporate the syntax and semantics for templates. this is not intended to be an exhaustive listing, but describes those that have been identified so far. 2. Edits required for deferred arguments ======================================== * Insert new glossary term in 3.7 [deferred argument association] association between an instantiation argument and a deferred argument (????) * Insert new glossary term [deferred argument] named entity that appears in a (????) * Insert new glossary term 3.34.x [deferred constant] named data object with the CONSTANT attribute (????) * Modify glossary term 3.34.2 "named constant" to [named constant] named data object (3.42) with the PARAMETER attribute, or a deferred constant * 7.3.2.1 Type specifier syntax Extend R702 : " <> " Extend C703 from: (R702) The shall not specify an abstract type (7.5.7) To: (R702) The or shall not specify an abstract type (7.5.7) except when used as an . Extend R703 to include: <> TYPE() <> CLASS() Change C706 from: (R703) TYPE() shall not specify an abstract type (7.5.7). To: (R703) In a that uses the TYPE keyword, or shall not specify an abstract type (7.5.7). Extend C705 from: (R703) In a that uses the CLASS keyword, shall specify an extensible type (7.5.7). To: (R703) In a that uses the CLASS keyword, or shall specify an extensible type (7.5.7). * 7.5.2.1 Syntax of a derived-type definition New constraint or R728: " shall not be a . * 8.5.2 Accessibility attribute Change C817 to read as An access-spec shall appear only in the specification-part of a module or template construct. * 8.5.8.1 General Change last entry for From: <> To: <> * 8.5.8.2 Explicit-shape array Note: It may be better to modify to disambiguate for lower and upper bounds. This would make constraint for deferred constants clearer. * 8.5.8.6 Implied-shape array Modify the first sentence from: An implied-shape array is a named constant that takes its shape from the constant-expr in its declaration. To: An implied-shape array is a named constant that takes its shape from a constant expression. If the named constant has the PARAMETER attribute, it takes its shape from the constant-expr in its declaration. Otherwise, if the named constant is a deferred argument, it takes its shape from its corresponding instantiation argument. Modify the first sentence in the last paragraph from: The extent of each dimension of an implied-shape array is the same as the extent of the corresponding dimension of the constant-expr. To: The extent of each dimension of an implied-shape array is the same as the extent of the corresponding dimension of the constant-expr or instantiation argument. * 8.5.8.7 Assumed-rank entity Changes title of section to "Assumed-rank or deferred-rank entity." Delete and add <> .. (Change all throughout the document.) Add new constraint: Constraint: A deferred-rank entity shall be a . * 8.5.17 RANK clause Replace constraint C864 which states: An entity declared with a rank-clause shall be a dummy data object or have the ALLOCATABLE or POINTER attribute. With: An entity declared with a rank-clause shall be a named constant, dummy data object or have the ALLOCATABLE or POINTER attribute. Replace the last paragraph: If the rank is zero the entity is scalar; otherwise, if it has the ALLOCATABLE or POINTER attribute, it specifies that it is a deferred-shape array; otherwise, it specifies that it is an assumed-shape array with all the lower bounds equal to one. With: If the rank is zero the entity is scalar; otherwise, if it has the ALLOCATABLE or POINTER attribute, it specifies that it is a deferred-shape array; otherwise, if it is a named constant, it specifies that it is an implied-shape array with all lower bounds equal to one; otherwise, it specifies that it is an assumed-shape array with all the lower bounds equal to one. * 8.6.1 Accessibility statement Modify C873 to read as An shall appear only in the of a module or template construct. Only one accessibility statement with an omitted is permitted in the of a module or template construct. * 10.1.12 Constant expression Extend list in normative text for "constant expression": "deferred constant" * 10.1 Expressions and Assignment New section 10.1.13 Deferred constant expressions <> An expression is a if one or more of its primaries is a deferred constant. A is not equal to any other unless is syntactically equivalent. * 11.1.11.1 Purpose and form of the SELECT TYPE construct Extend R1156 to R1156 <> TYPE IS ( ) [ ] <> CLASS IS ( ) [ ] <> CLASS IS ( ) [ ] <> CLASS DEFAULT [ ] Add constraint: (R1156) shall specify an extensible type. * 15.5.1 Syntax of a procedure reference Extend R1522 : " <> " " <> " Extend R1524 : " <> " 3. Edits required for templates and instantiation ================================================= * 5.1 High level syntax Extend R508 to include: <>