@@ -216,6 +216,10 @@ Modify R818 to disambiguate lower and upper explicit bounds such that it reads:
216
216
its shape from the associated instantiation argument, otherwise it
217
217
takes its shape from the constant expression in its declaration."
218
218
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
+
219
223
Delete the first sentence in the last paragraph which reads:
220
224
221
225
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:
287
291
REAL, PARAMETER, RANK(RANK(C)) :: D ! implied rank
288
292
END TEMPLATE
289
293
290
- << this is where we got on 2025-04-07 >>
291
-
292
294
* 8.5.17 RANK clause
293
295
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
+
294
302
Replace constraint C864 which states:
295
303
C864 An entity declared with a rank-clause shall be a dummy data
296
304
object or have the ALLOCATABLE or POINTER attribute.
297
305
With:
298
306
C864 An entity declared with a rank-clause shall be a named constant,
299
307
dummy data object or have the ALLOCATABLE or POINTER attribute.
300
308
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
308
317
the ALLOCATABLE or POINTER attribute, it specifies that it is a
309
318
deferred-shape array; otherwise, if it is a named constant, it
310
319
specifies that it is an implied-shape array with all lower
311
320
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" .
313
322
314
323
* 8.6.1 Accessibility statement
315
324
316
- Modify C873 to read as
325
+ Modify C873 to include templates such that it reads:
317
326
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
319
328
module or template construct. Only one accessibility statement with
320
329
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."
322
331
323
332
* 10.1.12 Constant expression
324
333
325
- Extend list in normative text for "constant expression":
334
+ Extend list in normative text for "constant expression" to include
326
335
"deferred constant"
327
336
328
- * 10.1 Expressions and Assignment
329
337
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.
331
341
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>
333
345
334
346
An expression is a <deferred-const-expr> if one or more of its
335
347
primaries is a deferred constant.
336
348
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
+
339
366
340
367
* 11.1.11.1 Purpose and form of the SELECT TYPE construct
341
368
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>
344
373
<<is>> TYPE IS ( <type-spec> ) [ <select-construct-name> ]
345
374
<<or>> CLASS IS ( <derived-type-spec> ) [ <select-construct-name> ]
346
375
<<or>> CLASS IS ( <deferred-type> ) [ <select-construct-name> ]
347
- <<or>> CLASS DEFAULT [ <select-construct-name> ]
376
+ <<or>> CLASS DEFAULT [ <select-construct-name> ]"
348
377
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.
351
380
352
381
* 15.5.1 Syntax of a procedure reference
353
382
354
383
UTI: spelling of <inline-instantiate> vs <inline-instantiation>
355
384
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
+
359
406
360
- Extend R1524 <actual-arg> with:
361
- <<or>> <deferred-proc>
362
- <<or>> <inline-instantiate>
407
+ <<< we got to here on 2025-04-14 >>>>>
363
408
364
409
3. Edits required for templates and instantiation
365
410
=================================================
0 commit comments