J3/16-106 To: J3 From: Dan Nagle Subject: attempting UTI 015 Date: 2016 January 07 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 strategy here is that the inappropriate attribute simply goes missing from the construct entity (the outer name has it, the construct one doesn't). I propose to straw vote the questionable attributes. I make an attempt at repairing the inconsistencies below. UTI 015 is on pages 180-181 of 16-007. Straw Votes: +++ SV 1 ALLOCATABLE The Editor asserts that ALLOCATABLE is workable, but has an unfavorable cost-benefit. Besides, a BLOCK construct just within the DO CONCURRENT construct might declare one. SV Should a LOCAL or LOCAL_INIT variable have the ALLOCATABLE attribute if the same name in the innermost scope containing the DO CONCURRENT does? Y-N-U +++ SV 2 ASYNCHRONOUS VOLATILE The Editor asks why the ASYNCHRONOUS attribute should be allowed, and remarks that the VOLATILE attribute seems pointless. Either attribute could be added by a BLOCK just within the DO CONCURRENT construct. If so, the ASYNCHRONOUS-ness or VOLATILE-ness disappears at the end of the BLOCK anyway. SV Should a LOCAL or LOCAL_INIT variable have the ASYNCHRONOUS or VOLATILE attribute if the same name in the innermost scope containing the DO CONCURRENT does? Y-N-U +++ SV 3 TARGET The Editor remarks that TARGET is problematic, since any pointer will be dangling when the construct variable goes out of scope. If a variable with the TARGET attribute is really needed, it could be declared in a BLOCK just within the DO CONCURRENT. If the restriction proves onerous, it may be relaxed later. SV Should a LOCAL or LOCAL_INIT variable have the TARGET attribute if the same name in the innermost scope containing the DO CONCURRENT does? Y-N-U +++ SV 4 FINAL The Editor remarks that a finalisable type implies executing the final procedure for each iteration, and there seems to be few use-cases where this is required. SV Should a LOCAL or LOCAL_INIT variable be of finalisable type? Y-N-U +++ SV 5 definable? This is not part of UTI 015, but I thought of it while pondering deeply what should happen with the rest of it. If the variable outside the loop has INTENT(IN) or PROTECTED attributes, it cannot appear in a variable definition context. If the inner variable is defined, it may be surprising. I can't think of a use-case where this really helps. SV Should a LOCAL or LOCAL_INIT variable be definable if the variable in the outer scope is not? Y-N-U === Edits (assuming SV results are N-N-N-N-N) {individual attributes may be moved from one list to the other if the straw votes so indicate . . . also the edits at [181:5] and [181:7] might then need adjustment} [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 new sentences "A variable that has LOCAL or LOCAL_INIT locality has the CONTIGUOUS and POINTER attribute(s) if and only if the variable with the same name in the innermost executable construct that includes the DO CONCURRENT construct has them. A variable that has LOCAL or LOCAL_INIT locality does not have a <> or the INTENT, PROTECTED, VALUE, SAVE, ALLOCATABLE, ASYNCHRONOUS, VOLATILE, or TARGET attributes, even if the variable with the same name in the innermost executable construct that includes the DO CONCURRENT construct has them. If the variable in the innermost executable construct containing the DO CONCURRENT has the ALLOCATABLE attribute, it shall be allocated when the DO CONCURRENT construct is entered. A variable that has LOCAL or LOCAL_INIT locality shall not be of finalisable type. If the variable in the innermost executable construct containing the DO CONCURRENT cannot appear in a variable definition context, the LOCAL or LOCAL_INIT variable shall not appear in a variable definition context." {list the allowable and problematic attributes separately} [181:5] delete "is allocatable it is unallocated, if it" from the bullet item. [181:6] optionally delete the comma after "status" {make bullet item agree with preceding paragraph} [181:7] change "allocation, pointer association, and definition" to "pointer association and definition" {make bullet item agree with preceding paragraph}