Skip to content

Commit 44ffd76

Browse files
committed
changes from subgroup 2025-04-14
1 parent 01d5ce7 commit 44ffd76

File tree

1 file changed

+75
-30
lines changed

1 file changed

+75
-30
lines changed

J3-Papers/edits/25-112_misc.txt

Lines changed: 75 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ Modify R818 to disambiguate lower and upper explicit bounds such that it reads:
216216
its shape from the associated instantiation argument, otherwise it
217217
takes its shape from the constant expression in its declaration."
218218

219+
{Note that this change is a bit larger than strictly necessary. It is
220+
needed for deferred constants, but it seems natural to include
221+
ordinary constant here.}
222+
219223
Delete the first sentence in the last paragraph which reads:
220224

221225
The extent of each dimension of an implied-shape array is the same
@@ -287,79 +291,120 @@ Modify R818 to disambiguate lower and upper explicit bounds such that it reads:
287291
REAL, PARAMETER, RANK(RANK(C)) :: D ! implied rank
288292
END TEMPLATE
289293

290-
<< this is where we got on 2025-04-07 >>
291-
292294
* 8.5.17 RANK clause
293295

296+
UTI: Do we want to allow RANK(*)? Not strictly necessary given that we have
297+
DIMENSION(..).
298+
299+
UTI: Why do we even need the RANK clause? Probably for generic
300+
procedures at the very least.
301+
294302
Replace constraint C864 which states:
295303
C864 An entity declared with a rank-clause shall be a dummy data
296304
object or have the ALLOCATABLE or POINTER attribute.
297305
With:
298306
C864 An entity declared with a rank-clause shall be a named constant,
299307
dummy data object or have the ALLOCATABLE or POINTER attribute.
300308

301-
Replace the last paragraph:
302-
If the rank is zero the entity is scalar; otherwise, if it has
303-
the ALLOCATABLE or POINTER attribute, it specifies that it is a
304-
deferred-shape array; otherwise, it specifies that it is an
305-
assumed-shape array with all the lower bounds equal to one.
306-
With:
307-
If the rank is zero the entity is scalar; otherwise, if it has
309+
{This change is a bit larger than strictly necessary for generic
310+
programming. We only need to allow it for deferred constants, but it
311+
seems natural to allow for ordinary named constants as well.}
312+
313+
Amend the last sentence of the section to allow for the deferred
314+
constant case, such that the paragraph now reads:
315+
316+
"If the rank is zero the entity is scalar; otherwise, if it has
308317
the ALLOCATABLE or POINTER attribute, it specifies that it is a
309318
deferred-shape array; otherwise, if it is a named constant, it
310319
specifies that it is an implied-shape array with all lower
311320
bounds equal to one; otherwise, it specifies that it is an
312-
assumed-shape array with all the lower bounds equal to one.
321+
assumed-shape array with all the lower bounds equal to one".
313322

314323
* 8.6.1 Accessibility statement
315324

316-
Modify C873 to read as
325+
Modify C873 to include templates such that it reads:
317326

318-
C873 An <access-stmt> shall appear only in the <specification-part> of a
327+
"C873 An <access-stmt> shall appear only in the <specification-part> of a
319328
module or template construct. Only one accessibility statement with
320329
an omitted <access-id-list> is permitted in the <specification-part>
321-
of a module or template construct.
330+
of a module or template construct."
322331

323332
* 10.1.12 Constant expression
324333

325-
Extend list in normative text for "constant expression":
334+
Extend list in normative text for "constant expression" to include
326335
"deferred constant"
327336

328-
* 10.1 Expressions and Assignment
329337

330-
New section 10.1.13 Deferred constant expressions
338+
UTI: The following section was well intended but cast too large of a
339+
shadow. We should elsewhere specify similar sentiments but
340+
restricted to RANK and KIND with regards to TKR resolution.
331341

332-
<deferred-const-expr> <<is>> <constant-expr>
342+
* Insert new section 10.1.12+: Deferred constant expressions
343+
344+
"<deferred-const-expr> <<is>> <constant-expr>
333345

334346
An expression is a <deferred-const-expr> if one or more of its
335347
primaries is a deferred constant.
336348

337-
A <deferred-const-expr> is not equal to any other <expr> unless
338-
<expr> is syntactically equivalent.
349+
A <deferred-const-expr> is not equal to any other <constant-expr> unless
350+
<constant-expr> is syntactically equivalent."
351+
352+
deferred integer, parameter :: C
353+
...
354+
integer :: i
355+
i = 5
356+
do i = 1, 10
357+
if (C == i) ...
358+
if (C == C) ...
359+
end do
360+
361+
deferred integer, parameter :: C1
362+
deferred integer, parameter :: C2 = C1 + 1 - 1
363+
364+
if (C1 == C2) then ...
365+
339366

340367
* 11.1.11.1 Purpose and form of the SELECT TYPE construct
341368

342-
Extend R1156 to
343-
R1156 <type-guard-stmt>
369+
Extend R1156 to include <deferred-type>, such that it now reads:
370+
371+
372+
"R1156 <type-guard-stmt>
344373
<<is>> TYPE IS ( <type-spec> ) [ <select-construct-name> ]
345374
<<or>> CLASS IS ( <derived-type-spec> ) [ <select-construct-name> ]
346375
<<or>> CLASS IS ( <deferred-type> ) [ <select-construct-name> ]
347-
<<or>> CLASS DEFAULT [ <select-construct-name> ]
376+
<<or>> CLASS DEFAULT [ <select-construct-name> ]"
348377

349-
Add constraint:
350-
C116b (R1156) <deferred-type> shall specify an extensible type.
378+
Add constraint to R1156:
379+
C1169b (R1156) <deferred-type> shall specify an extensible type.
351380

352381
* 15.5.1 Syntax of a procedure reference
353382

354383
UTI: spelling of <inline-instantiate> vs <inline-instantiation>
355384

356-
Extend R1522 <procedure-designator> with:
357-
<<or>> <deferred-proc>
358-
<<or>> <inline-instantiate>
385+
Extend R1522 <procedure-designator> with <deferred-proc> and
386+
<inline-instantiate> such that it reads:
387+
388+
"R1522 <procedure-designator> <<is>> <procedure-name>
389+
<<or>> <proc-component-ref>
390+
<<or>> <data-ref> % binding-name
391+
<<or>> <deferred-proc>
392+
<<or>> <inline-instantiate>
393+
394+
Extend R1524 <actual-arg> with <deferred-proc> and
395+
<inline-instantiate> such that it reads:
396+
397+
"R1524 actual-arg <<is>> <expr>
398+
<<or>> <variable>
399+
<<or>> <procedure-name>
400+
<<or>> <proc-component-ref>
401+
<<or>> <conditional-arg>
402+
<<or>> <alt-return-spec>
403+
<<or>> <deferred-proc>
404+
<<or>> <inline-instantiate>
405+
359406

360-
Extend R1524 <actual-arg> with:
361-
<<or>> <deferred-proc>
362-
<<or>> <inline-instantiate>
407+
<<< we got to here on 2025-04-14 >>>>>
363408

364409
3. Edits required for templates and instantiation
365410
=================================================

0 commit comments

Comments
 (0)