J3/14-139r1 To: J3 Subject: Variable definition context and Pointer association context From: Van Snyder Date: 2014 May 29 1. Introduction =============== Everywhere the term "variable definition context" is used, except in subclause 12.7 "Pure procedures," and subclause C.4.4 "Pointers in variable-definition contexts," 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". 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, C545 and C558 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 ================== [314:32+ C1296(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.} [314:38 C1296(5)] Replace ", or" with "." [315:1-2 C1296(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. [477:38-478:1 16.6.7p1(2-3)] Delete the list items because they're not variable definition contexts, and don't apply to nonpointer variables. [478: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. [478: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 C545 and C558 (and now C1296), which cannot actually constrain if the interface is not explicit. [502: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).