CVS difference for ais/ai-00083.txt

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

--- ais/ai-00083.txt	1998/09/30 00:17:14	1.1
+++ ais/ai-00083.txt	1999/07/29 00:51:01	1.2
@@ -1,24 +1,25 @@
-!standard 07.06    (21)                               96-06-05  AI95-00083/02
+!standard 07.06    (21)                               99-07-28  AI95-00083/03
 !class binding interpretation 95-07-27
+!status Corrigendum 2000 99-07-28
 !status WG9 approved 95-06-14
 !status work item (letter ballot was 10-1-0) 96-06-05
 !status ARG approved (subject to letter ballot) 7-0-3  95-11-01
 !status received 95-07-27
 !subject Aggregates of a controlled type
 
-!summary 95-07-27
+!summary
 
 When an object of a controlled type is created and explicitly
 initialized with an aggregate, the aggregate is built "in place";
 Finalize and Adjust are not called on the object as a whole.
 
-!question 95-07-27
+!question
 
 If an object of a controlled type is declared in the same package as
 the type, and initialized with an aggregate, is Program_Error raised?
 (No.)
 
-!recommendation 95-07-27
+!recommendation
 
 When an object of a controlled type is created and explicitly
 initialized with an aggregate, the implementation must not create a
@@ -27,24 +28,26 @@
 assignment from the anonymous object to the newly-created object, so the
 Finalize and Adjust that would be done for that assignment are not done.
 
-!wording 95-07-27
+!wording
 
-!discussion 95-07-27
+(See corrigendum.)
 
+!discussion
+
 Consider the following controlled type:
 
     type Dyn_String is private;
     Null_String : constant Dyn_String;
  ...
  private
-    type Dyn_String is new Ada.Finalization.Controlled 
+    type Dyn_String is new Ada.Finalization.Controlled
       with record
         ...
       end record;
     procedure Finalize(X : in out Dyn_String);
     procedure Adjust(X : in out Dyn_String);
 
-    Null_String : constant Dyn_String := 
+    Null_String : constant Dyn_String :=
       (Ada.Finalization.Controlled with ...);
 
 Clearly, at the time when the full constant declaration for Null_String
@@ -79,12 +82,31 @@
 to object_declarations.  Thus, continuing the above example, if we have:
 
     type Dyn_String_Ptr is access all Dyn_String;
-    Null_String_Ptr: Dyn_String_Ptr := 
+    Null_String_Ptr: Dyn_String_Ptr :=
       new Dyn_String'(Ada.Finalization.Controlled with ...);
 
 The aggregate must be build directly in the newly-created heap object.
+
+!corrigendum 7.06.01(20)
+
+@dinsa
+@xbullet<For a Finalize invoked by a transfer of control due to an abort
+or selection of a terminate alternative, the exception is ignored; any other
+finalizations due to be performed are performed.>
+@dinst
+@i<@s8<Implementation Requirement>>@hr
+For an aggregate of a controlled type whose value is assigned to the object
+created by an object declaration or allocator, the implementation must not
+create a separate anonymous object for the aggregate. The aggregate value
+must be constructed directly in the new object. In this case, Finalize and
+Adjust are not called on the object as a whole.
+
+!ACATS test
+
+The annex H ACATS test CXH3002 requires these semantics. However, a core
+C-Test should be created for this case, as this is a critical rule change.
 
-!appendix 95-07-27
+!appendix
 
 !section 7.6(21)
 !subject Aggregates of a controlled type
@@ -100,14 +122,14 @@
     Null_String : constant Dyn_String;
  ...
  private
-    type Dyn_String is new Ada.Finalization.Controlled 
+    type Dyn_String is new Ada.Finalization.Controlled
       with record
         ...
       end record;
     procedure Finalize(X : in out Dyn_String);
     procedure Adjust(X : in out Dyn_String);
 
-    Null_String : constant Dyn_String := 
+    Null_String : constant Dyn_String :=
       (Ada.Finalization.Controlled with ...);
 
 Clearly, at the time when the full constant declaration for
@@ -121,19 +143,19 @@
 to an access-before-elaboration from calling Adjust or Finalize
 before their bodies are elaborated).
 
-In other words, at least parts of 7.6(21) should be moved to 
-an Implementation Requirement (or the Dynamic Semantics).  
-In particular, when a constant is initialized from an aggregate 
-of a controlled type, the aggregate should be built in place, 
-and no Adjust or Finalize on the constant object as a whole 
+In other words, at least parts of 7.6(21) should be moved to
+an Implementation Requirement (or the Dynamic Semantics).
+In particular, when a constant is initialized from an aggregate
+of a controlled type, the aggregate should be built in place,
+and no Adjust or Finalize on the constant object as a whole
 should take place.  Note that no Adjust ever takes place
 on an aggregate as a whole, since there is no assignment
 to the aggregate as a whole (AARM 4.3(5,5b)).
 
 Note that AARM 7.6(21a) talks about this case, and says that
 "only one value adjustment is necessary".  This is misleading.
-It should say that only one adjustment of each controlled *subcomponent* 
-(if any) is necessary in this case.  *No* adjustments of the object as 
+It should say that only one adjustment of each controlled *subcomponent*
+(if any) is necessary in this case.  *No* adjustments of the object as
 a whole are necessary (and as suggested above, such adjustments
 should be disallowed).
 

Questions? Ask the ACAA Technical Agent