CVS difference for ais/ai-00161.txt

Differences between 1.10 and version 1.11
Log of other versions for file ais/ai-00161.txt

--- ais/ai-00161.txt	2002/04/26 20:15:16	1.10
+++ ais/ai-00161.txt	2002/05/25 03:42:17	1.11
@@ -1,8 +1,23 @@
-!standard 10.02.01 (09)                               01-10-17  AI95-00161/06
+!standard 10.02.01 (04)                               02-05-14  AI95-00161/07
+!standard 10.02.01 (09)
 !standard 10.02.01 (11)
+!standard  7.06 (05)
+!standard  7.06 (07)
+!standard  9.06 (10)
+!standard 13.07 (12)
+!standard 13.11 (06)
+!standard 13.13.1 (03)
+!standard A.04.02 (04)
+!standard A.04.02 (20)
+!standard A.04.05 (04)
+!standard A.04.07 (04)
+!standard A.04.07 (20)
+!standard B.03.01 (05)
 !standard C.04 (04)
+!standard G.01.01 (04)
 !class binding interpretation 99-02-23
-!status ARG approved 7-0-1  01-10-07
+!status Amendment 200Y 02-05-14
+!status ARG Approved 7-0-1  01-10-07
 !status work item 98-04-16
 !status received 96-09-10
 !priority Medium
@@ -12,28 +27,28 @@
 !summary
 
 The creation of an object whose type has preelaborable initialization is allowed
-in a preelaborable unit.  This makes it possible to declare objects of some
+in a preelaborable unit. This makes it possible to declare objects of some
 private types in preelaborable units.
 
-The notion of a type having "preelaborable initialization" is defined by
-this AI.
+The notion of a type having "preelaborable initialization" and the pragma
+Preelaborable_Initialization are defined by this AI.
 
 !question
 
-The paragraphs RM95 10.2.1(5-9) list a number of constructs which are
-forbidden in preelaborable units.  In particular, RM95 10.2.1(9) states that:
+The paragraphs 10.2.1(5-9) list a number of constructs which are
+forbidden in preelaborable units. In particular, 10.2.1(9) forbids:
 "The creation of a default-initialized object (including a component) of a
-descendant of a private type, private extension, controlled type, task type
-or protected type with entry declarations."
+descendant of a private type, private extension, controlled type, task type,
+or protected type with entry_declarations;".
 
 1. In this rule, what is the meaning of "default-initialized object"?
 
-2. This rule seems extremely restrictive.  For instance, if (as recommended)
-System.Address is a private type, the declaration:
+2. This rule seems extremely restrictive. For instance, if (as recommended
+by the standard) System.Address is a private type, the declaration:
 
         A : System.Address;
 
-makes the enclosing unit non-preelaborable.  As another example, the
+makes the enclosing unit non-preelaborable. As another example, the
 implementation of Ada.Strings.Unbounded suggested in the Rationale is
 impossible because the initial value for the deferred constant
 Null_Unbounded_String would have to include an extension aggregate for
@@ -45,7 +60,7 @@
 
 !wording
 
-Change the RM95 10.2.1(9) to read:  "The creation of an object (including a
+Change the 10.2.1(9) to read:  "The creation of an object (including a
 component) of a type which does not have preelaborable initialization.
 Similarly the evaluation of an extension_aggregate with an ancestor
 subtype_mark denoting a subtype of such a type."
@@ -54,7 +69,7 @@
 private type, a private extension, a generic formal private type, a generic
 formal derived type, or a descendant of such a type."
 
-Add the following after RM95 10.2.1(11):
+Add the following after 10.2.1(11/1):
 
 "The following rules specify which entities have preelaborable initialization:
 
@@ -63,19 +78,16 @@
 formal derived type, have preelaborable initialization if and only if the pragma
 Preelaborable_Initialization has been applied to them.
 
-- Protected types with entry_declarations and task types do not have
-preelaborable initialization.
-
 - A component (including a discriminant) of a record or protected type has
 preelaborable initialization if its declaration includes a default_expression
-whose execution does not perform any of the actions listed in RM95 10.2.1(6-9),
+whose execution does not perform any of the actions listed in 10.2.1(6-9),
 or if its declaration does not include a default expression and its type has
 preelaborable initialization.
 
 - A derived type has preelaborable initialization if its parent type has
 preelaborable initialization and (in the case of a derived record or protected
 type) if the non-inherited components all have preelaborable initialization.
-Moreover, a user-defined controlled type with a local override for the
+Moreover, a user-defined controlled type with an overriding
 Initialize procedure does not have preelaborable initialization.
 
 - A view of a type has preelaborable initialization if it is an elementary
@@ -83,7 +95,7 @@
 or a record type whose components all have preelaborable initialization.
 
 A pragma Preelaborable_Initialization specifies that a type has preelaborable
-initialization.  The form of this pragma is as follows:
+initialization. The form of this pragma is as follows:
 
         pragma Preelaborable_Initialization (direct_name);
 
@@ -91,68 +103,72 @@
 
 If the pragma appears in the first list of declarative_items of a
 package_specification, then the direct_name shall denote the first subtype of a
-protected type without entry_declarations, private type or private extension
-declared within the same package as the pragma.  If the pragma is applied to a
+private type, private extension, or protected type without entry_declarations,
+and the type shall be declared within the same package as the pragma. If the
+pragma is applied to a private type or a private extension, the full view of
+the type shall have preelaborable initialization. If the pragma is applied to a
 protected type, each component of the protected type shall have preelaborable
-initialization.  If the pragma is applied to a private type or a private
-extension, the full view of the type shall have preelaborable initialization.
-In addition to the places where Legality Rules normally apply, these rules apply
-also in the private part of an instance of a generic unit.
+initialization. In addition to the places where Legality Rules normally apply,
+these rules apply also in the private part of an instance of a generic unit.
 
 If the pragma appears in a generic_formal_part, then the direct_name shall
 denote a generic formal private type or a generic formal derived type declared
-in the same generic_formal_part as the pragma.  In a generic_instantiation the
+in the same generic_formal_part as the pragma. In a generic_instantiation the
 corresponding actual type shall have preelaborable initialization."
 
+AARM Note: Protected types with entry_declarations and task types do not have
+preelaborable initialization, and cannot have pragma
+Preelaborable_Initialization applied to them.
+
 !discussion
 
 1. A "default-initialized object" is an object for which the implicit
-initialization described in RM95 3.3.1(10-14) takes place.  Examples of
+initialization described in 3.3.1(10-14) takes place. Examples of
 default-initialized objects include an object_declaration without an
 initialization expression, and the (anonymous) object created by the
 evaluation of an extension_aggregate whose ancestor_part is a subtype name.
 
 Note that an object of a task type or of a protected type is always default-
-initialized.  Also note that for a private type or a private extension,
+initialized. Also note that for a private type or a private extension,
 providing an initialization expression always requires a reference to the
 name of an object, or a call to a non-static function, which are forbidden by
-other rules.  Finally note that for a controlled type, an initialization
+other rules. Finally note that for a controlled type, an initialization
 expression may also be provided by an extension aggregate (if visibility
 allows), which must have a controlled subtype name as the ancestor part,
 which is forbidden.
 
 The conclusion is that the phrase "default-initialized" can be removed from
-RM95 10.2.1(9).
+10.2.1(9).
 
-2. RM95 10.2.1(9) is indeed too restrictive.  For preelaboration to be usable
+2. 10.2.1(9) is indeed too restrictive. For preelaboration to be usable
 (in particular in the context of distributed systems) we must loosen up the
-rules dramatically.  However, we do not want to impose an additional burden
+rules dramatically. However, we do not want to impose an additional burden
 on implementations which support annex C and have to comply with the
-requirements of RM95 C.4.  Therefore, each time we remove a restriction from
-RM95 10.2.1(9), we must add a corresponding restriction to RM95 C.4.
+requirements of C.4. Therefore, each time we remove a restriction from
+10.2.1(9), we must add a corresponding restriction to C.4.
 
-Clearly we must keep task objects and protected objects with entries in RM95
-10.2.1(9).  Note that the current wording seems to allow the creation of
+Clearly we must keep task objects and protected objects with entries in
+10.2.1(9). Note that the current wording seems to allow the creation of
 objects of entry-less protected types, which is strange since the
 component_declarations may include default_expressions which execute non-
 trivial code.
 
 To precisely specify which object declarations are acceptable in a
 preelaborable unit, we introduce the notion of a type having preelaborable
-initialization.  In order to take advantage of the fact that some two-part
+initialization. In order to take advantage of the fact that some two-part
 types (such as private types and private extensions) may have preelaborable
 initialization, without breaking the privacy of private types, we introduce
-the pragma Preelaborable_Initialization.  This pragma is applied to the
+the pragma Preelaborable_Initialization. This pragma is applied to the
 partial view, and it promises that the full view will have preelaborable
-initialization.  This pragma is applied to some of the predefined private
+initialization. This pragma is applied to some of the predefined private
 types, to make it easier for users to write preelaborable units.
 
 The following table lists all the private types and private extensions
-declared in preelaborated predefined packages.  For each such type, the table
+declared in preelaborated predefined packages. For each such type, the table
 specifies if a pragma Preelaborable_Initialization is applied to the type
-(yes) or not (no).  For those packages that have a Wide_ variant, the types
+(yes) or not (no). For those packages that have a Wide_ variant, the types
 declared in the Wide_ variant have the same classification as the types
-declared in the 'narrow' variant.  The same remark applies to the non-generic
+declared in the 'narrow' variant. The same remark applies to the non-generic
 equivalents of the various generic packages.
 
 Ada.Calendar.Time                                               yes
@@ -173,6 +189,40 @@
 instantiate Generic_Bounded_Length with a non-static expression for the
 parameter Max.
 
+!corrigendum  7.06(05)
+
+@drepl
+@xcode<    @b<type> Controlled @b<is abstract tagged private>;>
+@dby
+@xcode<    @b<type> Controlled @b<is abstract tagged private>;
+    @b<pragma> Preelaborable_Initialization(Controlled);>
+
+!corrigendum  7.06(07)
+
+@drepl
+@xcode<    @b<type> Limited_Controlled @b<is abstract tagged limited private>;>
+@dby
+@xcode<    @b<type> Limited_Controlled @b<is abstract tagged limited private>;
+    @b<pragma> Preelaborable_Initialization(Limited_Controlled);>
+
+!corrigendum  9.06(10)
+
+@drepl
+@xcode<@b<package> Ada.Calendar @b<is>
+    @b<type> Time @b<is private>;>
+@dby
+@xcode<@b<package> Ada.Calendar @b<is>
+    @b<type> Time @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Time);>
+
+!corrigendum 10.02.01(4)
+
+@dinsa
+@xindent<A @fa<pragma> Preelaborate is a library unit pragma.>
+@dinss
+@xindent<The form of @fa<pragma> Preelaborable_Initialization is as follows:@hr
+     @b<pragma> Preelaborable_Initialization (@fa<direct_name>);>
+
 !corrigendum 10.02.01(9)
 
 @drepl
@@ -187,20 +237,19 @@
 @fa<extension_aggregate> with an ancestor @fa<subtype_mark> denoting a subtype
 of such a type.>
 
-!corrigendum 10.02.01(11)
+!corrigendum 10.02.01(11/1)
 
 @dinsa
 If a @fa<pragma> Preelaborate (or @fa<pragma> Pure -- see below) applies to a
-library unit, then it is preelaborated. If a library unit is preelaborated,
+library unit, then it is @i<preelaborated>. If a library unit is preelaborated,
 then its declaration, if any, and body, if any, are elaborated prior to all
 non-preelaborated @fa<library_item>s of the partition. The declaration and body
 of a preelaborated library unit, and all subunits that are elaborated as part
-of elaborating the library unit,All compilation units of a preelaborated
-library unit shall be preelaborable. In addition to the places where Legality
-Rules normally apply (see 12.3), this rule applies also in the private part of
-an instance of a generic unit. In addition, all compilation units of a
-preelaborated library unit shall depend semantically only on compilation units
-of other preelaborated library units.
+of elaborating the library unit, shall be preelaborable. In addition to the
+places where Legality Rules normally apply (see 12.3), this rule applies also
+in the private part of an instance of a generic unit. In addition, all
+compilation units of a preelaborated library unit shall depend semantically
+only on compilation units of other preelaborated library units.
 @dinss
 The following rules specify which entities have preelaborable initialization:
 
@@ -209,9 +258,6 @@
 generic formal derived type, have preelaborable initialization if and only if
 the pragma Preelaborable_Initialization has been applied to them.>
 
-@xbullet<Protected types with @fa<entry_declaration>s and task types do not
-have preelaborable initialization.>
-
 @xbullet<A component (including a discriminant) of a record or protected type
 has preelaborable initialization if its declaration includes a
 @fa<default_expression> whose execution does not perform any actions prohibited
@@ -221,7 +267,7 @@
 @xbullet<A derived type has preelaborable initialization if its parent type has
 preelaborable initialization and (in the case of a derived record or protected
 type) if the non-inherited components all have preelaborable initialization.
-Moreover, a user-defined controlled type with a local override for the
+Moreover, a user-defined controlled type with an overridding
 Initialize procedure does not have preelaborable initialization.>
 
 @xbullet<A view of a type has preelaborable initialization if it is an
@@ -230,22 +276,19 @@
 initialization.>
 
 A @fa<pragma> Preelaborable_Initialization specifies that a type has
-preelaborable initialization. The form of this @fa<pragma> is as follows:
+preelaborable initialization. This pragma shall appear in the visible part
+of a package or generic package.
 
-@xindent<@b<pragma> Preelaborable_Initialization (@fa<direct_name>);
-
-This pragma must appear in the visible part of a package or generic package.
-
 If the pragma appears in the first list of declarative_items of a
-@fa<package_specification>, then the @fa<direct_name> shall denote the
-first subtype of a protected type without @fa<entry_declaration>s, private
-type, or private extension declared within the same package as the @fa<pragma>.
-If the @fa<pragma> is applied to a protected type, each component of the
-protected type shall have preelaborable initialization. If the @fa<pragma> is
-applied to a private type or a private extension, the full view of the type
-shall have preelaborable initialization. In addition to the places where
-Legality Rules normally apply, these rules apply also in the private part of
-an instance of a generic unit.
+@fa<package_specification>, then the @fa<direct_name> shall denote the first
+subtype of a private type, private extension, or protected type without
+@fa<entry_declaration>s, and the type shall be declared within the same package
+as the @fa<pragma>. If the @fa<pragma> is applied to a private type or a
+private extension, the full view of the type shall have preelaborable
+initialization. If the @fa<pragma> is applied to a protected type, each
+component of the protected type shall have preelaborable initialization. In
+addition to the places where Legality Rules normally apply, these rules apply
+also in the private part of an instance of a generic unit.
 
 If the @fa<pragma> appears in a @fa<generic_formal_part>, then the
 @fa<direct_name> shall denote a generic formal private type or a generic formal
@@ -253,6 +296,90 @@
 In a @fa<generic_instantiation> the corresponding actual type shall have
 preelaborable initialization.
 
+!corrigendum  13.07(12)
+
+@drepl
+@xcode<    @b<type> Address @b<is> @i<implementation-defined>;
+    Null_Address : @b<constant> Address;>
+@dby
+@xcode<    @b<type> Address @b<is> @i<implementation-defined>;
+    @b<pragma> Preelaborable_Initialization(Address);
+    Null_Address : @b<constant> Address;>
+
+!corrigendum  13.11(06)
+
+@drepl
+@xcode<    @b<type> Root_Storage_Pool @b<is>
+        @b<abstract new> Ada.Controlled.Limited_Controlled @b<with private>;>
+@dby
+@xcode<    @b<type> Root_Storage_Pool @b<is>
+        @b<abstract new> Ada.Controlled.Limited_Controlled @b<with private>;
+    @b<pragma> Preelaborable_Initialization(Root_Storage_Pool);>
+
+!corrigendum  13.13.1(03)
+
+@drepl
+@xcode<    @b<type> Root_Stream_Type @b<is abstract tagged limited private>;>
+@dby
+@xcode<    @b<type> Root_Stream_Type @b<is abstract tagged limited private>;
+    @b<pragma> Preelaborable_Initialization(Root_Stream_Type);>
+
+!corrigendum  A.4.2(04)
+
+@drepl
+@xcode<    -- @i<@ft<Representation for a set of character values:>>
+    @b<type> Character_Set @b<is private>;>
+@dby
+@xcode<    -- @i<@ft<Representation for a set of character values:>>
+    @b<type> Character_Set @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Character_Set);>
+
+!corrigendum  A.4.2(20)
+
+@drepl
+@xcode<    -- @i<@ft<Representation for a character to character mapping:>>
+    @b<type> Character_Mapping @b<is private>;>
+@dby
+@xcode<    -- @i<@ft<Representation for a character to character mapping:>>
+    @b<type> Character_Mapping @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Character_Mapping);>
+
+!corrigendum  A.4.5(04)
+
+@drepl
+@xcode<    @b<type> Unbounded_String @b<is private>;>
+@dby
+@xcode<    @b<type> Unbounded_String @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Unbounded_String);>
+
+!corrigendum  A.4.2(04)
+
+@drepl
+@xcode<    -- @i<@ft<Representation for a set of Wide_Character values:>>
+    @b<type> Wide_Character_Set @b<is private>;>
+@dby
+@xcode<    -- @i<@ft<Representation for a set of Wide_Character values:>>
+    @b<type> Wide_Character_Set @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Wide_Character_Set);>
+
+!corrigendum  A.4.2(20)
+
+@drepl
+@xcode<    -- @i<@ft<Representation for a Wide_Character to Wide_Character mapping:>>
+    @b<type> Wide_Character_Mapping @b<is private>;>
+@dby
+@xcode<    -- @i<@ft<Representation for a Wide_Character to Wide_Character mapping:>>
+    @b<type> Wide_Character_Mapping @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Wide_Character_Mapping);>
+
+!corrigendum  B.3.1(05)
+
+@drepl
+@xcode<    @b<type> Chars_Ptr @b<is private>;>
+@dby
+@xcode<    @b<type> Chars_Ptr @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Chars_Ptr);>
+
 !corrigendum C.4(4)
 
 @dinsa
@@ -262,6 +389,14 @@
 @xbullet<No @fa<subtype_mark> denotes a controlled type, a
 private type, a private extension, a generic formal private type, a generic
 formal derived type, or a descendant of such a type;>
+
+!corrigendum  G.1.1(04)
+
+@drepl
+@xcode<    @b<type> Imaginary @b<is private>;>
+@dby
+@xcode<    @b<type> Imaginary @b<is private>;
+    @b<pragma> Preelaborable_Initialization(Imaginary);>
 
 
 !ACATS test

Questions? Ask the ACAA Technical Agent