Version 1.1.1.1 of ais/ai-00197.txt

Unformatted version of ais/ai-00197.txt version 1.1.1.1
Other versions for file ais/ai-00197.txt

!standard 07.06 (21)          98-03-27 AI95-00197/00
!class binding interpretation 98-03-27
!status received 98-03-27
!priority Medium
!difficulty Medium
!subject Aggregates of a controlled type
!summary 98-03-27
!question 98-03-27
!recommendation 98-03-27
!wording 98-03-27
!discussion 98-03-27
!appendix

!section 7.6(21)
!subject Aggregates of a controlled type
!section 7.6
!reference AI95-00083/02
!reference RM95-7.6(21)
!from Gary Dismukes 97-07-11
!reference 1997-15794.a Gary Dismukes 1997-11-8>>
!discussion

AI-83 requires that a controlled object initialized by an
aggregate be built in place, without the use of the canonical
temporary object.  It seems that this requirement should also
exist for cases involving controlled components with default
initialization given by an aggregate, but it's not clear from
the wording of the AI whether it's intended to apply to such
cases.

For example, building on the example in the AI:

    type Dyn_String is private;
    Null_String : constant Dyn_String;
 ...
 private
    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);

    type Rec_with_String is
      record
        Str : Dyn_String := (Ada.Finalization.Controlled with ...);
      end record;

    RS : Rec_with_String;

Is it intended that the component RS.Str be initialized in place,
without the use of a separate temporary object to hold the value
of the aggregate?  The fact that the summary says "explicitly
initialized" makes it unclear to me whether the AI is intended
to apply to this case (although the end of the !recommendation
does state that the interpretation applies to all object creations).
The question is whether the component's default initialization
is properly considered to be an "explicit initialization" for
purposes of this AI.

****************************************************************

Questions? Ask the ACAA Technical Agent