(j3.2006) Variable definition context
Van Snyder
Van.Snyder
Tue Apr 1 18:36:48 EDT 2014
16.6.7p1(12) "Variable definition context" says
"(12) an actual argument in a reference to a procedure with an explicit
interface if the corresponding dummy argument has INTENT (OUT) or INTENT
(INOUT);"
is a variable definition context.
Do we want that to be the case if the actual argument and dummy argument
are both pointers? If not, should this be
"(12) an actual argument in a reference to a procedure with an explicit
interface if the corresponding dummy argument has INTENT (OUT) or INTENT
(INOUT) and the actual and dummy arguments are not both pointers;"
If they are both pointers, the fourth item in the list in 16.6.8p1
"Pointer association context" says it's a pointer association context,
using slightly different words:
"an actual argument in a reference to a procedure if the associated
dummy argument is a pointer with the INTENT (OUT) or INTENT (INOUT)
attribute."
This probably ought to be
"an actual argument in a reference to a procedure with explicit
interface if the corresponding dummy argument is a pointer with the
INTENT (OUT) or INTENT (INOUT) attribute."
The term "associated" is dynamic, depending on actual argument presence
if the dummy argument is optional, so it's difficult to think of
"associated" as a "context".
16.6.7p1 "Variable definition context" also has
"(2) a pointer-object in a nullify-stmt;
"(3) a data-pointer-object or proc-pointer-object in a
pointer-assignment-stmt;"
Are these really variable definition contexts, or are they pointer
association contexts?
That these are now variable definition contexts makes it impossible to
have a meaningful pointer of type EVENT_TYPE or a type that has a
component of type EVENT_TYPE (C602-C603 in the TS), or one of type
LOCK_TYPE or a type that has a component of type LOCK_TYPE (C1303-C1304
in 14-007).
[488:23-24 C.4.4] says "where a pointer appears in a variable-definition
context the variable that is defined is the target of the pointer." This
certainly cannot be the case in 16.6.7p1(2-3). This needs to be
repaired if 16.6.7p1(2-3) are not moved to 16.6.8.
The list in 16.6.7 "Variable definition context" is enumerated. The one
in 16.6.8 "Pointer association context" is itemized. Should they be the
same style? ISO apparently prefers itemized, but enumerated makes for
easier reference.
Here are the places where "variable definition context" appears in
14-007:
[99:24] says "nonpointer", so 16.6.7p1(2-3) do not apply
[102:18] says "nonpointer", so 16.6.7p1(2-3) do not apply
[172:16-17] cannot be a pointer, so 16.6.7p1(2-3) do not apply
[173:22] selector is not a pointer, so 16.6.7p1(2-3) do not apply
[185:13-14] like [172:16-17], cannot be a pointer
[316:11] might need work
[404:1,4] LOCK_TYPE (need xref to 16.6.7), so 16.6.7p1(2-3) ought not to
apply
[464:13-14] selector is not a pointer, so 16.6.7p1(2-3) do not apply
[464:17-18] applies to references to functions with pointer results,
which cannot be the subject of 16.6.7p1(2-3)
[488:23-24] contradicts 16.6.7p1(2-3).
The only one where 16.6.7p1(2-3) might apply is [316:11], which can
probably be changed by mentioning "pointer association context", if
needed. In all other cases, 16.6.7p1(2-3) is not relevant.
"variable definition context" is hyphenated "variable-definition
context" at (and only at) [488:22,24]. Style should be consistent.
More information about the J3
mailing list