CVS difference for ais/ai-00196.txt

Differences between 1.1 and version 1.2
Log of other versions for file ais/ai-00196.txt

--- ais/ai-00196.txt	1998/09/30 00:17:35	1.1
+++ ais/ai-00196.txt	2001/10/09 00:47:09	1.2
@@ -1,26 +1,95 @@
-!standard 03.09.02 (17)                               98-03-27  AI95-00196/00
+!standard 03.09.02 (17)                               01-10-08  AI95-00196/01
 !class binding interpretation 98-03-27
 !status received 98-03-27
 !priority Low
 !difficulty Easy
 !subject assignment and tag-indeterminate calls with controlling results
 
-!summary 98-03-27
+!summary
 
+Paragraphs 3.9.2(17-19) are also intended to apply to dispatching calls
+with no controlling operands. For the case of a dispatching call with
+a controlling result all of whose controlling operands (if any) are
+tag-indeterminate and that appears as the right-hand side of an
+assignment to a class-wide target, the controlling tag value is
+defined by the tag of the target.
 
-!question 98-03-27
+!question
 
+The wording of 3.9.2(17), in the context of the preceding paragraphs,
+makes it unclear that the definition of "controlling tag value" applies
+to a primitive function having controlling operands.
 
-!recommendation 98-03-27
+Was 3.9.2(17) intended to mean "If all of the controlling operands
+(if any) are tag-indeterminate,..."?  (Yes.)
 
+Regardless of whether 3.9.2(17) includes calls to functions having
+no controlling operands, but having a controlling result, it appears that
+3.9.2(19) is at odds with 5.2(9).  The problem arises with any assignment
+whose expression is a call to a function having a tag-indeterminate
+controlling result.
 
-!wording 98-03-27
+Consider the following:
 
+      package p1 is
+         type t is tagged null record ;
+         function func return t ;                  -- (1)
+      end p1 ;
 
-!discussion 98-03-27
+      with p1 ;
+      package p2 is
+         use p1 ;
+         type e is new t with null record ;
+         function func return e ;                  -- (2)
+      end p2 ;
 
+      with p1 ;
+      with p2 ;
+      procedure bummer_dude is
+      --
+         eee : p2.e ;
 
-!appendix 98-03-27
+         procedure crash_and_burn (formal : in p1.t'class) is
+            local : p1.t'class := formal ;
+         begin
+            local := p1.func ;                     -- (3)
+         end crash_and_burn ;
+      begin
+         crash_and_burn (eee) ;                    -- (4)
+      end bummer_dude ;
+
+The tag-indeterminate call to func at (3) is in question.  For the call
+at (4), what is the body that will execute when the call at (3) is made?
+3.9.2(19) says it is p1.func (declared at (1)), and 5.2(9) says that it
+is p2.func (declared at (2)).
+
+3.9.2(19) says that the controlling tag for the call is statically
+determined to be p1.t'tag, because the call is not a controlling operand
+of another call, and p1.func is a dispatching operation of type p1.t.
+
+However, 5.2(9) contradicts this.  The target (local) is class-wide,
+and the expression (call to p1.func) is tag-indeterminate, so the
+controlling tag is taken from the tag of local, which is p2.e'tag.
+
+This dilemma arises when the expression of an assignment statement is a
+call on a function with a tag-indeterminate controlling result.  How is
+this dilemma reconciled?  (The call at (3) will invoke p2.func.)
+
+!recommendation
+
+(See summary.)
+
+!wording
+
+
+!discussion
+
+
+!corrigendum xx.xx.xx
+
+!ACATS test
+
+!appendix
 
 !section 3.9.2(17)
 !subject      assignment and tag-indeterminate calls with controlling results

Questions? Ask the ACAA Technical Agent