CVS difference for ais/ai-00230.txt

Differences between 1.12 and version 1.13
Log of other versions for file ais/ai-00230.txt

--- ais/ai-00230.txt	2003/10/29 22:54:09	1.12
+++ ais/ai-00230.txt	2003/11/27 02:01:12	1.13
@@ -1,20 +1,24 @@
-!standard 03.04.01(06)                               03-10-22  AI95-00230/08
+!standard 03.04.01(06)                               03-11-19  AI95-00230/09
 !standard 03.06(07)
 !standard 03.06(22/1)
 !standard 03.07(10)
 !standard 03.08(18/1)
 !standard 03.10(12)
+!standard 03.10(13)
 !standard 03.10(17)
 !standard 03.10.2(12)
 !standard 04.02(02)
+!standard 04.02(07)
 !standard 04.02(08)
 !standard 04.05.02(07)
 !standard 04.05.02(09)
 !standard 04.06(13)
 !standard 04.06(18)
+!standard 04.06(49)
 !standard 08.05.01(02)
 !standard 08.05.01(03)
 !standard 08.05.01(06)
+!standard 08.06(25)
 !standard 13.11(25)
 !class amendment 00-04-13
 !status work item 00-10-27
@@ -36,6 +40,9 @@
 NOTE: This AI is also related to AI-00231, which allows anonymous access
 types to be specified to be access-to-constant as opposed to
 access-to-variable, and to be either null-allowing or not null-allowing.
+Without null-allowing anonymous access types, anonymous access components
+are rather useless, so this proposal pretty much requires some version of
+AI-231 to be approved.
 
 !problem
 
@@ -159,6 +166,15 @@
 
 !wording
 
+Change 3.4.1(3) as follows:
+
+   Every type is either a specific type, a class-wide type, or a universal
+   type. A specific type is one defined by a type_declaration, a
+   formal_type_declaration, an access_definition, or a full type definition
+   embedded in a declaration for an object. Class-wide and universal types are
+   implicitly defined, to act as representatives for an entire class of types,
+   as follows:
+
 Change 3.4.1(6) as follows:
 
    Universal Types
@@ -198,6 +214,17 @@
 component_definition, and object_renaming_declaration) is awkward. Besides,
 we don't use text to list where subtype_indication [for instance] is allowed.)
 
+Modify 3.10(13) as follows:
+   For each [(named)] access type, other than a specific anonymous access type,
+   there is [a literal NULL which has] a null access value designating no
+   entity at all.  The null value of [a named] {an} access type is the ... in
+   the case of [a named] {an} access-to-object type, an allocator, which
+   returns ...
+
+Note: This allows allocators of anonymous access types (which was intended
+to be allowed in Ada 95, see 13.11(25)), and the literal null for
+universal_access. AI-231 expands this further.
+
 Add the following paragraph before 3.10.2(12):
 
    The accessibility level of the anonymous access type defined by an
@@ -215,6 +242,13 @@
 
 Delete paragraph 4.2(2).
 
+Replace paragraph 4.2(7) by:
+
+   A literal null shall not be of a specific anonymous access type, since such
+   types do not have a null value (see 3.10).
+
+   Note: AI-231 repeals this altogether.
+
 Change paragraph 4.2(8) as follows:
    ... is of type universal_real. {The literal NULL is of type
    universal_access.}
@@ -232,8 +266,12 @@
               Name Resolution Rules
 
    At least one of the operands of the equality operators for universal_access
-   shall be of an anonymous access type.
+   shall be of a specific anonymous access type.
 
+   AARM Note: Universal access types do not count for the purposes of this
+   rule. Otherwise, equality expressions like (X = null) would be ambiguous for
+   normal access types.
+
               Legality Rules
 
    The operands of the equality operators for universal_access shall be
@@ -252,6 +290,13 @@
    shall be {universal_access or} an access-to-subprogram type.  Further{, if
    not universal_access}:
 
+Change paragraph 4.6(49) as follows:
+
+   * If the target type is a specific anonymous access type, a check is made
+     that the value of the operand is not null; if the target is not a specific
+     anonymous access type, then the result is null if the operand value is
+     null.
+
 Change paragraph 8.5.1(2) as follows:
 
    object_renaming_declaration ::=
@@ -262,7 +307,7 @@
 
    The type of the object_name shall resolve to the type determined by
    the subtype_mark{, or in the case where the type is defined by an
-   access_definition, to an anonymous access type whose designated type
+   access_definition, to a specific anonymous access type whose designated type
    is the same as that of the access_definition}.
 
 [NOTE: If AI-231 is adopted, then 8.5.1(4) should include a
@@ -276,6 +321,10 @@
    ... any constraint implied by the subtype_mark {or access_definition}
    of the object_renaming_declaration is ignored.
 
+Modify paragraph 8.6(25):
+
+   ...when T is a[n] {specific} anonymous access type ...
+
 Replace paragraph 13.11(25) by:
 
    The storage pool used for an allocator of an anonymous
@@ -291,6 +340,8 @@
       and be reclaimed when the allocated object becomes inaccessible.
 
 
+  AARM: Delete the first sentence of 13.11(17.c); it isn't true even in Ada 95.
+
 !example
 
     package P is
@@ -360,7 +411,7 @@
 the implicit conversion on named general access types that is already available
 for all anonymous general access types.
 
-We have decided to disallow named subtypes of anonymous access types, because
+We have decided to not allow named subtypes of anonymous access types, because
 they seemed to create more problems than they solved, and are not needed
 if we allow anonymous access types in component declarations.
 
@@ -390,6 +441,10 @@
 Similarly, issues relating to supporting access-to-constant and
 null-allowing anonymous access types are in AI-00231.
 
+We also fix an RM bug here; 3.4.1(3) says that all types are either specific,
+class-wide, or universal, but then fails to include access_definition (for
+anonymous access types) in any of those categories.
+
 Implementation Issues:
 
 Object renaming declarations with access_definitions are no harder to
@@ -431,6 +486,22 @@
 as there is no limit to the types that could be constructed (T'Access'Access,
 T'Access'Access'Access, etc.)
 
+!corrigendum 3.4.1(3)
+
+@drepl
+Every type is either a @i<specific> type, a @i<class-wide> type, or a
+@i<universal> type. A specific type is one defined by a @fa<type_declaration>, a
+@fa<formal_type_declaration>, or a full type definition embedded in a declaration
+for an object. Class-wide and universal types are implicitly defined, to act as
+representatives for an entire class of types, as follows:
+@dby
+Every type is either a @i<specific> type, a @i<class-wide> type, or a
+@i<universal> type. A specific type is one defined by a @fa<type_declaration>,
+a @fa<formal_type_declaration>, an @fa<access_definition>, or a full type
+definition embedded in a declaration for an object. Class-wide and universal
+types are implicitly defined, to act as representatives for an entire class of
+types, as follows:
+
 !corrigendum 3.4.1(6)
 
 @drepl
@@ -549,6 +620,27 @@
 An @fa<access_definition> defines an anonymous general access-to-variable type;
 the @fa<subtype_mark> denotes its @i<designated subtype>.
 
+!corrigendum 3.10(13)
+
+@drepl
+For each (named) access type, there is a literal @b<null> which has a null access
+value designating no entity at all. The null value of a named access type is
+the default initial value of the type. Other values of an access type are
+obtained by evaluating an @fa<attribute_reference> for the Access or
+Unchecked_Access attribute of an aliased view of an object or non-intrinsic
+subprogram, or, in the case of a named access-to-object type, an @fa<allocator>,
+which returns an access value designating a newly created object (see 3.10.2).
+@dby
+For each access type, other than a specific anonymous access type, there is a
+null access value designating no entity at all. The null value of an access
+type is the default initial value of the type. Other values of an access type
+are obtained by evaluating an @fa<attribute_reference> for the Access or
+Unchecked_Access attribute of an aliased view of an object or non-intrinsic
+subprogram, or, in the case of an access-to-object type, an @fa<allocator>,
+which returns an access value designating a newly created object (see 3.10.2).
+
+@dby
+
 !corrigendum 3.10(17)
 
 @drepl
@@ -581,6 +673,15 @@
 @ddel
 The expected type for a literal @b<null> shall be a single access type.
 
+!corrigendum 4.2(7)
+
+@drepl
+A literal @fa<null> shall not be of a specific anonymous access type, since
+such types do not have a null value (see 3.10).
+@dby
+A literal @b<null> shall not be of a specific anonymous access type, since such
+types do not have a null value (see 3.10).
+
 !corrigendum 4.2(8)
 
 @drepl
@@ -613,7 +714,7 @@
 @i<@s8<Name Resolution Rules>>
 
 At least one of the operands of the equality operators for @i<universal_access>
-shall be of an anonymous access type.
+shall be of a specific anonymous access type.
 
 @i<@s8<Legality Rules>>
 
@@ -643,6 +744,17 @@
 shall be @i<universal_access> or an access-to-subprogram type. Further, if
 not @i<universal_access>:
 
+!corrigendum 4.6(49)
+
+@drepl
+@xbullet<If the target type is an anonymous access type, a check is made that
+the value of the operand is not null; if the target is not an anonymous access
+type, then the result is null if the operand value is null.>
+@dby
+@xbullet<If the target type is a specific anonymous access type, a check is made
+that the value of the operand is not null; if the target is not a specific
+anonymous access type, then the result is null if the operand value is null.>
+
 !corrigendum 8.5.1(2)
 
 @drepl
@@ -661,8 +773,8 @@
 @dby
 The type of the @fa<object_name> shall resolve to the type determined by
 the @fa<subtype_mark>, or in the case where the type is defined by an
-@fa<access_definition>, to an anonymous access type whose designated type
-is the same as that of the @fa<access_definition>.
+@fa<access_definition>, to a specific anonymous access type whose
+designated type is the same as that of the @fa<access_definition>.
 
 !corrigendum 8.5.1(6)
 
@@ -682,6 +794,13 @@
 constant are unaffected; similarly, the constraints that apply to an object are
 not affected by renaming (any constraint implied by the @fa<subtype_mark> or
 @fa<access_definition> of the @fa<object_renaming_declaration> is ignored).
+
+!corrigendum 8.6(25)
+
+@drepl
+@xbullet<when @i<T> is an anonymous access type (see 3.10) with designated type
+@i<D>, to an access-to-variable type whose designated type is @i<D>'Class or is
+covered by @i<D>.>
 
 !corrigendum 13.11(25)
 

Questions? Ask the ACAA Technical Agent