To: J3 J3/19-115 From: Steve Lionel Subject: Making note of Statement Entities Date: 2019-January-20 Reference: 18-007r1 Introduction ------------ A recent discussion in comp.lang.fortran involved confusion about whether the appearance of a name as an ac-do-variable in a module created a declaration of the variable in that module. It was reported that more than one current compiler treated an ac-do-variable that way, even though it is expressly prohibited by 19.4p5 (Statement and Construct Entities): "The appearance of a name as a data-i-do-variable of an implied DO in a DATA statement or an ac-do-variable in an array constructor is not an implicit declaration of a variable whose scope is the scoping unit that contains the statement." Unfortunately, someone reading 7.8 (Construction of array values), or 8.6.7 (DATA Statement), is given no clue in nearby text that an ac-do-variable or data-i-do-variable is a statement entity, and might reasonably assume that it follows the normal language rules for implicit declaration and scope. A similar situation could have occurred for index-name in a concurrent-header, but 11.1.7.1p4 says "The scope and attributes of an index-name in a concurrent-header (DO CONCURRENT) are described in 19.4.". No similar text appears in 7.8 nor 8.6.7. The omission is confusing and has led to implementation errors in compilers. It would be beneficial to add appropriate wording to 7.8 and 8.6.7. Suggested Edits --------------- In 7.8 (Construction of array values), add a new paragraph after p1 (88:12+) "The scope and attributes of an ac-do-variable are described in 19.4." In 8.6.7 (DATA statement), add a new paragraph after p4 (110:26+) "The scope and attributes of a data-i-do-variable are described in 19.4" ===END===