J3/14-139 To: J3 Subject: Variable definition context and Pointer association context From: Van Snyder Date: 2014 April 03 1. Introduction =============== Everywhere the term "variable definition context" is used, except in subclause 12.7 "Pure procedures," subclause C.4.4 "Pointers in variable-definition contexts," and constraints C1302 and C1303 on LOCK_TYPE, it applies only to nonpointer variables. Items (2) and (3) in the list of variable definition contexts in 16.6.7p1 "Variable definition context" are actually pointer association contexts; they are the first and second items in 16.6.8p1 "Pointer association context". Those items conspire with C1303 and C1304, and C602 and C603 in the coarray TS, to make it nearly pointless to have a pointer of type LOCK_TYPE or EVENT_TYPE, or of a type that has a potential subobject component of one of these types. One cannot allocate or deallocate a pointer of LOCK_TYPE or EVENT_TYPE because these are required to be coarrays, and C526 requires coarrays to be allocatable or to be dummy arguments. One could allocate an object of a type that has a potential subobject component of one of these types if pointer association context were not part of the prohibition against variable definition context in C1303 in 14-007 and C603 in the TS. Item (12) in 16.6.7p1 does not constitute a variable definition context if both the actual and dummy arguments are pointers. The fourth item in 16.6.8p1 "Pointer association context" covers the case when they're both pointers. The fourth item in 16.6.8p1 "Pointer association context" is defective in not mentioning explicit interface, and using "associated" where it ought to use "corresponding". As a consequence, C541 and C554 cannot actually constrain. C.4.4p1 at [488:24] is incorrect, at least until the changes here to 16.6.7 are done, and maybe even then. 2. Edits to 14-007 ================== [316:11+ C1293(1)+] Insert a list item "(1a) in a pointer association context (16.6.8)," {This recovers items (2), (3) and (12) from 16.6.7p1, which are deleted below.} [316:17 C1293(5)] Replace ", or" with "." [316:18-19 C1293(6)] Delete item (6) because it is covered by 16.6.7p1(12) and the fourth list item in 16.6.8p1. The only case not covered thereby is if the actual argument is not a pointer and the dummy argument is. The referenced procedure is required to be pure. It therefore cannot use its pointer dummy argument to do anything impure to the actual argument, even though the dummy argument is a pointer. [463:38-464:1 16.6.7p1(2-3)] Delete the list items because they're not variable definition contexts, and don't apply to nonpointer variables. [464:12 16.6.7p1(12)] Append ", unless both the dummy argument and the actual argument are pointers" at the end of the item, because an actual argument pointer corresponding to a dummy argument pointer is not a variable definition context, and doesn't apply to nonpointer variables. [464:26-27 16.6.8p1, fourth list item] Insert "with explicit interface" after "procedure" and replace "associated" with "corresponding". It is necessary for the interface to be explicit because the only places where "pointer association context" is used are in C541 and C554, which cannot actually constrain if the interface is not explicit. [488:22,24] Delete the hyphens because "variable-definition" does not appear anywhere else (maybe it ought to be "variable-definition context" everywhere, but that would be a bigger edit).