!standard 3.9.2(17/2)                                         22-06-15  AI22-0043-1/01

!standard 3.9.2(18/2)

!standard 3.9.2(18.1/2)

!standard 3.9.2(19)

!class Binding Interpretation 22-06-15

!status work item 22-06-15

!status received 22-06-09

!priority Medium

!difficulty Medium

!qualifier Omission

!subject Look through more than parens and qualified exprs to get tag for tag-indeterminate call


The wording in 3.9.2(18) and in 3.9.2(18.1) talks about parenthesized expressions and qualified expressions, but fails to mention other similar cases (e.g., conditional expressions, declare

expressions). This was an oversight.


For purposes of determining whether a tag-indeterminate call takes its tag from its enclosing context, should an enclosing conditional expression or an enclosing declare expression be treated similarly to an enclosing qualified expression or an enclosing parenthesized expression? (Yes.)

In this example,


package Pkg;
  type T is tagged null record;
  function F return T;
  procedure Op (X1, X2 : T);
end Pkg;
  Pkg.Op (X1 => Pkg.T'Class (...), X2 => (if Blah then Pkg.F else ...));
  Pkg.Op (X1 => Pkg.T'Class (...), X2 => Pkg.T'Class (Pkg.F));


should the controlling tag in the first call to Pkg.F be determined by the other parameter in the enclosing call to Pkg.Op? (Yes.) What about the controlling tag in the second call to Pkg.F? (No.)


Treat conditional expressions and declare expressions similarly to qualified expressions and parenthesized expressions in determining the tag of a tag-indeterminate call. Ada already defines the term “operative constituent”. That term should be used in resolving this issue in order to avoid repetition.


Replace 3.9.2(17/2 - 19) with:


No change is intended for the case of a tag-indeterminate call that occurs as the operand of a view conversion. If the term “operative constituent” is to be used in any new wording, then care is needed to accomplish this goal because a view conversion is treated like a qualified expression or a parenthesized expression in the definition of that term.

The use of “tag-indeterminate controlling operand” in the wording as opposed to just “controlling operand” is important because of the case of a tag-indeterminate call that is the operand of a view conversion. Similarly for the use of “tag-indeterminate expression” as opposed to just “expression”. Thanks to Tuck for suggesting this.


(See Issue.)

!ACATS test

An executable test could be written to confirm that the desired new program behavior is implemented for tag-indeterminate calls within conditional expressions and within declare expressions, and that program behavior is unchanged for tag-indeterminate calls within view conversions.