J3/16-106r2 To: J3 From: Dan Nagle Subject: attempting UTI 015 Date: 2016 February 11 Reference: 16-007 The Editor remarks that the attributes of names listed in LOCAL or LOCAL_INIT clauses are wrong. Specifically, some attributes are inconsistent with being a construct entity. Others may be expensive to implement for little apparent gain, or be so error-prone to use as to outweigh the benefits. The straw votes changed somewhat from those proposed in 16-106. Below is a summary: 1. Allocatable is to be disallowed. 2. Asynchronous and volatile are to be allowed, but transfers must be complete before loop ends. 3. Target is to be allowed, but a clear statement of pointer un-association is needed. 4. Types with final procedures are to be disallowed 5. Undefinable variables are to be disallowed. UTI 015 is on pages 180-181 of 16-007. While pondering deeply the issues raised hereby, we noticed that clause 16 requires statements of various (un)definitions introduced by LOCAL and LOCAL_INIT locality. === Edits {these reflect Wednesday's straw votes} This is all within subclause 8.1.6.5 Additional Semantics for DO CONCURRENT constructs, [180:12-181:11] and concerns paragraph p2. (That is, the discussion of LOCAL and LOCAL_INIT.) [181:1] Replace "attributes" with "type, type parameters (if any), and bounds (if any)" {replace the erroneous attributes with necessary ones} [181:3] After the sentence that ends with "within the construct." add a paragraph break. After the paragraph break, add a new paragraph: "The variable with the same name as a variable with LOCAL or LOCAL_INIT locality that is in the innermost executable construct or scoping unit that includes the DO CONCURRENT construct is the outer variable. Additional rules apply to a variable that has LOCAL or LOCAL_INIT locality: o The variable has the ASYNCHRONOUS, CONTIGUOUS, POINTER, TARGET or VOLATILE attribute(s) if and only if the outer variable has the attribute(s). o The variable does not have the BIND, INTENT, PROTECTED, SAVE or VALUE attribute(s), even if the outer variable has the attribute(s). o The outer variable shall not have the ALLOCATABLE attribute or be of finalizable type. o If the outer variable cannot appear in a variable definition context, it shall not appear in a LOCAL or LOCAL_INIT clause." {list the allowable and problematic attributes separately} [181:3+] add a new paragraph "If a variable that has LOCAL or LOCAL_INIT locality becomes an affector of a pending input/output operation, the operation shall have completed before the end of the iteration. If a variable has LOCAL or LOCAL_INIT locality and has the TARGET attribute, any pointers associated with it become undefined when the iteration of the construct completes execution." {clearly state the consequences of loop-scope variables} [181:5] delete "is allocatable it is unallocated, if it" from the bullet item. [181:6] delete the comma after "status" {make bullet item agree with preceding paragraphs} [181:7] change "allocation, pointer association, and definition" to "pointer association and definition" {make bullet item agree with preceding paragraphs} In 16.5.2.5 Events that cause the association status of pointers to become undefined [497:13+] add a new numbered item to the list "an iteration of a DO CONCURRENT construct completes and the pointer is associated with a LOCAL or LOCAL_INIT variable of that construct," {this is a new way for a pointer to lose association status} In 16.6.5 Events that cause variables to become defined [503:20+] add a new numbered item to the list "when an iteration of a DO CONCURRENT construct begins, a LOCAL_INIT variable of that construct becomes defined with the value of the outer variable," {this is a new way for a variable to become defined} In 16.6.6 Events that cause variables to become undefined [505:10+] add a new numbered item to the list "when an iteration of a DO CONCURRENT completes, a variable that is a construct entity of that construct, and which has LOCAL or LOCAL_INIT locality, becomes undefined." {this is a new way for a variable to become undefined}