CVS difference for ais/ai-00373.txt

Differences between 1.5 and version 1.6
Log of other versions for file ais/ai-00373.txt

--- ais/ai-00373.txt	2004/08/31 23:06:21	1.5
+++ ais/ai-00373.txt	2004/12/09 19:55:37	1.6
@@ -1,5 +1,10 @@
-!standard 03.03.01(20)                                 04-08-31  AI95-00373/03
+!standard 03.03.01(08)                                 04-12-02  AI95-00373/04
+!standard 03.03.01(18/1)
+!standard 03.03.01(19)
+!standard 03.03.01(20)
 !class binding interpretation 04-02-05
+!status Amendment 200Y 04-12-02
+!status ARG Approved 9-0-1  04-11-21
 !status work item 04-06-07
 !status received 04-01-17
 !priority Low
@@ -46,12 +51,12 @@
   For the third step above, evaluations and assignments are
   performed in an arbitrary order subject to the following restrictions:
       - Assignment to any part of the object is preceded
-        by the evaluation of the value that is to be assigned.
-      - The evaluation of a default_expression that includes the name of
-        a discriminant is preceded by the assigment to that discriminant.
-      - The evaluation of the default_expression for any component that
+        by the evaluation of the value that is to be assigned;
+      - the evaluation of a default_expression that includes the name of
+        a discriminant is preceded by the assigment to that discriminant;
+      - the evaluation of the default_expression for any component that
         depends on a discriminant is preceded by the assignment to that
-        discriminant.
+        discriminant;
       - the assignments to any components, including implicit components,
         not requiring late initialization must precede the initial value
         evaluations for any components requiring late initialization; if two
@@ -111,16 +116,17 @@
 !discussion
 
 An implementation is currently given too much freedom in choosing the order in
-which components are initialized.
-The problem is illustrated by the preceding example (see also Bob Duff's
-initial description of the problem).
+which components are initialized. The problem is illustrated by the preceding
+example (see also Bob Duff's initial description of the problem in the
+Appendix).
 
 This proposal does not completely solve the problem of evaluating uninitialized
 components (e.g. discriminants, access values, tasks, etc), but it greatly
 reduces the chances of inadvertantly introducing such a problem, either by
 writing new Ada source or by compiling exisiting source with another compiler.
 
-If a type has two components which both "require late initialization", then
+The problem cannot be completely solved because a type that has two components
+which both "require late initialization", then necessarily
 one of them is going to be initialized first and problems may arise if
 this initialization involves evaluation of the second component (or any part
 thereof). Portability is improved by nailing down the order in which such
@@ -173,9 +179,74 @@
    clause "and any explicit or default initializations have been performed").
    Still, an AARM note might be appropriate.
 
---!corrigendum
+!corrigendum 3.3.1(8)
 
+@dinsa
+The @fa<subtype_indication> or full type definition of an
+@fa<object_declaration> defines the nominal subtype of the object. The
+@fa<object_declaration> declares an object of the type of the nominal subtype.
+@dinst
+A component of an object is said to @i<require late initialization>
+if it has an access discriminant value constrained by a per-object
+expression, or if it has an initialization expression which includes a name
+denoting the current instance of the type or denoting an access discriminant.
+
+!corrigendum 3.3.1(18/1)
+
+@drepl
+@xhang<@xterm<3.>The object is created, and, if there is not an initialization
+expression, any per-object expressions (see 3.8) are elaborated and any
+implicit initial values for the object or for its subcomponents are obtained
+as determined by the nominal subtype.>
+@dby
+@xhang<@xterm<3.>The object is created, and, if there is not an initialization
+expression, any per-object expressions (see 3.8) are elaborated and any
+implicit initial values for the object or for its subcomponents are obtained as
+determined by the nominal subtype. Any initial values (whether explicit or
+implicit) are assigned to the object or to the corresponding subcomponents. As
+described in 5.2 and 7.6, Initialize and Adjust procedures can be called.>
+
+!corrigendum 3.3.1(19)
+
+@ddel
+@XHang<@xterm<4.>Any initial values (whether explicit or implicit) are assigned
+to the object or to the corresponding subcomponents. As described in 5.2 and
+7.6, Initialize and Adjust procedures can be called.>
+
+!corrigendum 3.3.1(20)
+
+@drepl
+For the third step above, the object creation and any elaborations and
+evaluations are performed in an arbitrary order, except that if the
+@fa<default_expression> for a discriminant is evaluated to obtain its initial
+value, then this evaluation is performed before that of the
+@fa<default_expression> for any component that depends on the discriminant, and
+also before that of any @fa<default_expression> that includes the name of the
+discriminant. The evaluations of the third step and the assignments of the
+fourth step are performed in an arbitrary order, except that each evaluation is
+performed before the resulting value is assigned.
+@dby
+For the third step above, evaluations and assignments are
+performed in an arbitrary order subject to the following restrictions:
+@xbullet<Assignment to any part of the object is preceded
+by the evaluation of the value that is to be assigned;>
+@xbullet<the evaluation of a @fa<default_expression> that includes the name of
+a discriminant is preceded by the assigment to that discriminant;>
+@xbullet<the evaluation of the @fa<default_expression> for any component that
+depends on a discriminant is preceded by the assignment to that
+discriminant;>
+@xbullet<the assignments to any components, including implicit components,
+not requiring late initialization must precede the initial value
+evaluations for any components requiring late initialization; if two
+components both require late initialization, then assignments to parts
+of the component occurring earlier in the order of the component
+declarations must precede the initial value evaluations of the
+component occurring later.>
+
 !ACATS test
+
+Create an ACATS test to check that cases like the example evaluate in the
+correct order.
 
 !appendix
 

Questions? Ask the ACAA Technical Agent