CVS difference for ais/ai-00416.txt

Differences between 1.8 and version 1.9
Log of other versions for file ais/ai-00416.txt

--- ais/ai-00416.txt	2005/05/10 04:15:17	1.8
+++ ais/ai-00416.txt	2005/06/16 23:47:42	1.9
@@ -1,4 +1,4 @@
-!standard 3.2.3(01)                                     05-05-05  AI95-00416/07
+!standard 3.2.3(01)                                     05-05-09  AI95-00416/08
 !standard 3.3(10)
 !standard 3.7(27)
 !standard 3.9.2(02)
@@ -15,7 +15,7 @@
 !standard 3.10.2(13)
 !standard 3.10.2(14)
 !standard 4.8(05)
-!standard 4.8(07)
+!standard 4.8(10)
 !standard 6.5(05)
 !standard 6.5(06)
 !standard 6.5(20)
@@ -217,7 +217,7 @@
     * An entity or view [created by a declaration] {defined by a declaration and
       created as part of its elaboration} has the same accessibility
       level as the innermost [enclosing] master that elaborates the
-      declaration {(} other than the declaration itself{)} except in the
+      declaration [other than] {of} the declaration [itself] except in the
       cases of renaming and derived access types described below. A
       parameter of a master has the same accessibility level as the
       master.
@@ -245,13 +245,14 @@
 
 Change 3.10.2(9) as follows:
 
-    * The accessibility level of a view conversion{, qualified expression,
-      or parenthesized_expression,} is the same as that of the operand.
+    * The accessibility level of a view conversion{, qualified_expression,
+      or parenthesized expression,} is the same as that of the operand.
 
 Replace 3.10.2(10) with:
 
     * The accessibility level of the result of a function call that is
-      used as a prefix of a name or as the actual parameter in a call
+      used as a prefix of a name, as the actual parameter in a call,
+      or as the expression of an assignment_statement,
       is that of the immediately enclosing master. In other contexts, the
       accessibility level is that of the object being initialized from
       the function result.
@@ -323,7 +324,7 @@
       anonymous access type that defines the value of an access
       parameter or an access discriminant. For an allocator defining the
       value of an access parameter, the accessibility level is that of
-      the master immediately enclosing the call. For one defining an
+      the innermost master of the call. For one defining an
       access discriminant, the accessibility level is determined as
       follows:
 
@@ -339,16 +340,25 @@
       In this last case, the allocated object is said to be a *coextension*
       of the object whose discriminant designates it, as well as of any
       object of which the discriminated object is itself a coextension or
-      subcomponent.  All coextensions of an object are finalized
+      subcomponent. All coextensions of an object are finalized
       when the object is finalized (see 7.6.1).
 
       AARM NOTE: The rules of access discriminants are such that
       when the space for an object with a coextension is reclaimed,
-      the space for the coextensions can be reclaimed.  Hence, there
+      the space for the coextensions can be reclaimed. Hence, there
       is implementation advice (see 13.11) that an object and its coextensions
       all be allocated from the same storage pool (or stack frame,
       in the case of a declared object).
 
+Add after 3.10.2(16):
+
+For determining whether an expression is used in a certain context, the
+operand of a view conversion, parenthesized expression or qualified_expression
+is considered to be used in a context if the view conversion,
+parenthesized expression or qualified_expression itself is used in that
+context.
+
+
 Add after the paragraph inserted by AI95-00344 after 4.8(5):
 
     If the designated subtype of the type of the allocator has one or
@@ -358,9 +368,14 @@
     allocator, shall not be statically deeper than that of the type of
     the allocator (see 3.10.2).
 
-Change 4.8(7) as amended by AI95-00344:
+Move the text added to 4.8(7) by AI95-00344 to after 4.8(10), and modify
+it as follows:
 
-    ... is not deeper than that of the type of the allocator. {If the
+    {For any allocator,} if the designated type of the type of the
+    allocator is class-wide, then a check is made that the accessibility
+    level of the type determined by the subtype_indication,
+    or by the tag of the value of the qualified_expression,
+    is not deeper than that of the type of the allocator. {If the
     designated subtype of the allocator has one or more unconstrained
     access discriminants, then a check is made that the accessibility
     level of the anonymous access type of each access discriminant is
@@ -369,14 +384,15 @@
 
 Add after the third paragraph inserted by AI95-00318 after 6.5(5):
 
-    If the result type is class-wide, the accessibility level of the
-    type of the return_expression shall not be statically deeper than
-    that of the master that elaborated the function body. If the result
-    subtype has one or more unconstrained access discriminants, the
-    accessibility level of the anonymous access type of each access
-    discriminant, as determined by the return_subtype_indication or the
-    return expression, shall not be statically deeper than that of the
-    master that elaborated the function body.
+    If the result subtype of the function is class-wide, the accessibility
+    level of the type of the expression of the return statement shall not be
+    statically deeper than that of the master that elaborated the function body.
+    If the result subtype has one or more unconstrained access discriminants,
+    the accessibility level of the anonymous access type of each access
+    discriminant, as determined by the expression of the
+    simple_return_statement or the return_subtype_indication, shall not be
+    statically deeper than that of the master that elaborated the function
+    body.
 
   AARM NOTE:
     We know that if the result type is class wide, then there must be
@@ -384,13 +400,13 @@
     then either the return_subtype_indication (if any) is constrained,
     or there must be a return expression.
 
-Add the paragraph inserted before 6.5(6) by AI95-00318:
+Modify the paragraph inserted before 6.5(6) by AI95-00318:
 
 	For the execution of an extended_return_statement, the
 	subtype_indication or access_definition is elaborated. This creates
 	the nominal subtype of the return object. If there is a return
 	expression, it is evaluated and converted to the nominal subtype
-	(which might raise Constraint_Error  see 4.6){; the return object
+	(which might raise Constraint_Error - see 4.6){; the return object
 	is created} and {the converted value} becomes the initial value of
 	the return object; otherwise, the return object is {created and}
 	initialized by default as for a stand-alone object of its nominal
@@ -406,10 +422,10 @@
     with no call on Adjust).
 
     If the return statement exits without resulting in a return (for example,
-    due to an exception propagated from the return expression or the
-    handled sequence of statements, or a goto out of the handled sequence
-    of statements), the return object is finalized prior to leaving the
-    return statement.
+    due to an exception propagated from the expression or the
+    handled_sequence_of_statements, or a goto out of the
+    handled_sequence_of_statements), the return object is finalized prior to
+    leaving the return statement.
 
 Add after 6.5(6):
 
@@ -433,9 +449,9 @@
     is not deeper than that of the master that elaborated the function
     body. {If the result subtype has one or more unconstrained access
     discriminants, a check is made that the accessibility level of the
-    anonymous access type of each access discriminant, as determined by
-    the return_subtype_indication or return expression, is not deeper
-    than that of the master that elaborated the function body.}
+    anonymous access type of each access discriminant, as determined by the
+    expression of the simple_return_statement or the return_subtype_indication,
+    is not deeper than that of the master that elaborated the function body.}
     If [this] {either} check fails, Program_Error is raised.
 
 Add after 6.5(22/2):
@@ -448,9 +464,9 @@
      an object with a constrained nominal subtype, Constraint_Error may
      be raised at the point of the call (after abandoning the
      execution of the function body) if, while elaborating a
-     return_subtype_indication or evaluating a return expression within
-     the function, it is determined that the value of the result will
-     violate the constraint of this object's subtype.
+     return_subtype_indication or evaluating the expression of a return
+     statement within the function, it is determined that the value of the
+     result will violate the constraint of this object's subtype.
 
    AARM NOTE: Without such a permission, it would be very difficult
      to implement "build-in-place" semantics. Such an exception is not
@@ -467,10 +483,9 @@
 Change 7.6.1(3) as amended by AI95-00162:
 
      ... except in the case of a master: the execution of a body other
-     than a package_body; the elaboration of a declaration other than
-     the declaration of a package {or of a type}; the execution of [an
-     accept_statement, a block_statement, or a simple_statement]
-     {a statement};
+     than a package_body; [the elaboration of a declaration other than
+     the declaration of a package; ] the execution of [an accept_statement,
+     a block_statement, or a simple_statement] {a statement};
 
 Add after 7.6.1(9):
 
@@ -599,8 +614,8 @@
 for the discriminants, or perhaps to preeinitialize them in the space
 for the return object. There should be an implementation permission to
 allow raising Constraint_Error at the beginning of the return statement,
-prior to fully evaluating the return expression or executing the handled
-sequence of statements. Something analogous to a 'Constrained bit can
+prior to fully evaluating the expression of a simple return or executing the
+handled sequence of statements. Something analogous to a 'Constrained bit can
 be provided, to indicate whether the discriminant values are preinitialized.
 
 -----------------
@@ -648,31 +663,31 @@
 !corrigendum 3.2.3(01)
 
 @drepl
-An operation @i<operates on a type T> if it yields a value of type @i<T>, if it
-has an operand whose expected type (see 8.6) is @i<T>, or if it has an access
-parameter (see 6.1) designating @i<T>. A predefined operator, or other
+An operation @i<operates on a type> @i<T> if it yields a value of type @i<T>,
+if it has an operand whose expected type (see 8.6) is @i<T>, or if it has an
+access parameter (see 6.1) designating @i<T>. A predefined operator, or other
 language-defined operation such as assignment or a membership test, that
 operates on a type, is called a @i<predefined operation> of the type. The
 @i<primitive operations> of a type are the predefined operations of the type,
 plus any user-defined primitive subprograms.
 @dby
-An operation @i<operates on a type T> if it yields a value of type @i<T>, if it
-has an operand whose expected type (see 8.6) is @i<T>, or if it has an access
-parameter or access result type (see 6.1) designating @i<T>. A predefined
-operator, or other language-defined operation such as assignment or a
-membership test, that operates on a type, is called a @i<predefined operation>
-of the type. The @i<primitive operations> of a type are the predefined
-operations of the type, plus any user-defined primitive subprograms.
+An operation @i<operates on a type> @i<T> if it yields a value of type @i<T>,
+if it has an operand whose expected type (see 8.6) is @i<T>, or if it has an
+access parameter or access result type (see 6.1) designating @i<T>. A
+predefined operator, or other language-defined operation such as assignment or
+a membership test, that operates on a type, is called a @i<predefined
+operation> of the type. The @i<primitive operations> of a type are the
+predefined operations of the type, plus any user-defined primitive subprograms.
 
 
 !corrigendum 3.3(10)
 
 @drepl
 @xbullet<the result of evaluating
-a function_call (or the equivalent operator invocation - see 6.6);>
+a @fa<function_call> (or the equivalent operator invocation @emdash see 6.6);>
 @dby
 @xbullet<the return object created as the result of evaluating
-a function_call (or the equivalent operator invocation - see 6.6);>
+a @fa<function_call> (or the equivalent operator invocation @emdash see 6.6);>
 
 
 !corrigendum 3.7(27)
@@ -807,7 +822,7 @@
 @dby
 @xbullet<An entity or view defined by a declaration and created as part of
 its elaboration has the same accessibility
-level as the innermost master (other than the declaration itself),
+level as the innermost master of the declaration,
 except in the cases of renaming and derived access types described below. A
 parameter of a master has the same accessibility level as the master.>
 
@@ -818,8 +833,8 @@
 @xbullet<The accessibility level of a view conversion is the same as that of
 the operand.>
 @dby
-@xbullet<The accessibility level of a view conversion, qualified expression,
-or parenthesized_expression, is the same as that of the operand.>
+@xbullet<The accessibility level of a view conversion, @fa<qualified_expression>,
+or parenthesized expression, is the same as that of the operand.>
 
 
 !corrigendum 3.10.2(10)
@@ -831,7 +846,8 @@
 of the result object is that of the execution of the called function.>
 @dby
 @xbullet<The accessibility level of the result of a function call that is
-used as a prefix of a name or as the actual parameter in a call
+used as a @fa<prefix> of a @fa<name>, as the actual parameter in a call, or
+as the @fa<expression> of an @fa<assignment_statement>,
 is that of the immediately enclosing master. In other contexts, the
 accessibility level is that of the object being initialized from
 the function result.>
@@ -841,7 +857,8 @@
 return statement completes normally by returning from the
 function, prior to leaving the function, the accessibility level
 of the return object changes to be a level determined by the point
-of call.>
+of call, as does the level of any coextensions (see below) of the
+return object.>
 
 !comment !corrigendum 3.10.2(11)
 !comment Since we want no change, we commented out the change in AI-385.
@@ -864,13 +881,13 @@
 @xinbull<For an access discriminant whose value is determined by a
 @fa<discriminant_association> in a @fa<subtype_indication>, the
 accessibility level of the object or subprogram designated by
-the associated value (or library level if the value is @b<null>);>
+the associated value (or library level if the value is null);>
 
 @xinbull<For an access discriminant of an object defined by an @fa<aggregate>
 where the value of the discriminant is determined by a
 @fa<component_association> in the @fa<aggregate>, the accessibility
 level of the object or subprogram designated by the associated
-value (or library level if the value is @b<null>);>
+value (or library level if the value is null);>
 
 @xinbull<For an access discriminant of any other object with an unconstrained
 nominal subtype, the accessibility level of the object.>
@@ -891,7 +908,7 @@
 anonymous access type that defines the value of an access parameter or
 an access discriminant. For an @fa<allocator> defining the value of
 an access parameter, the accessibility level is that of the
-master immediately enclosing the call. For one defining an access
+innermost master of the call. For one defining an access
 discriminant, the accessibility level is determined as follows:>
 
 @xinbull<for an @fa<allocator> used to define the constraint in a
@@ -909,6 +926,18 @@
 subcomponent. All coextensions of an object are finalized when the object is
 finalized (see 7.6.1).>
 
+!corrigendum 3.10.2(16)
+
+@dinsa
+@xbullet<The accessibility level of a component, protected subprogram, or entry
+of (a view of) a composite object is the same as that of (the view of) the
+composite object. >
+@dinst
+For determining whether an @fa<expression> is used in a certain context, the
+operand of a view conversion, parenthesized expression or
+@fa<qualified_expression> is considered to be used in a context if the view
+conversion, parenthesized expression or @fa<qualified_expression> itself is
+used in that context.
 
 !corrigendum 04.08(05)
 
@@ -924,25 +953,25 @@
 @fa<allocator>, shall not be statically deeper than that of the type of
 the @fa<allocator> (see 3.10.2).
 
-
-!corrigendum 04.08(07)
+!corrigendum 04.08(10)
 !comment This includes the AI-344 change.
 
-@drepl
-For the evaluation of an @fa<allocator>, the elaboration of the
-@fa<subtype_indication> or the evaluation of the @fa<qualified_expression> is
-performed first. For the evaluation of an initialized allocator, an object of
-the designated type is created and the value of the @fa<qualified_expression>
-is converted to the designated subtype and assigned to the object.
-@dby
-For the evaluation of an @fa<allocator>, the elaboration of the
-@fa<subtype_indication> or the evaluation of the @fa<qualified_expression> is
-performed first. For the evaluation of an initialized allocator, an object of
-the designated type is created and the value of the @fa<qualified_expression>
-is converted to the designated subtype and assigned to the object. If the
+@dinsa
+@xbullet<If the designated type is composite, an object of the designated type
+is created with tag, if any, determined by the @fa<subtype_mark> of the
+@fa<subtype_indication>; any per-object constraints on subcomponents are
+elaborated (see 3.8) and any implicit initial values for the subcomponents
+of the object are obtained as determined by the @fa<subtype_indication>
+and assigned to the corresponding subcomponents. A check is made that the
+value of the object belongs to the designated subtype. Constraint_Error is
+raised if this check fails. This check and the initialization of the object are
+performed in an arbitrary order.>
+@dinst
+For any @fa<allocator>, if the
 designated type of the type of the @fa<allocator> is class-wide, then
-a check is made that the accessibility level of the type identified by
-the tag of the value of the @fa<qualified_expression> is not deeper than that
+a check is made that the accessibility level of the type determined by
+the @fa<subtype_indication>, or by the tag of the value of the
+@fa<qualified_expression>, is not deeper than that
 of the type of the @fa<allocator>. If the
 designated subtype of the @fa<allocator> has one or more unconstrained
 access discriminants, then a check is made that the accessibility
@@ -961,7 +990,7 @@
 @dby
 A function body shall contain at least one @fa<return_statement> that applies
 to the function body, unless the function contains @fa<code_statement>s. A
-@fa<simple_return_statement> shall include a return expression if and only if
+@fa<simple_return_statement> shall include an @fa<expression> if and only if
 it applies to a function body. An @fa<extended_return_statement> shall apply to
 a function body.
 
@@ -973,7 +1002,7 @@
 @fa<subtype_indication> shall also be constrained and shall statically match
 this result subtype. If the result subtype of the function is unconstrained,
 then the subtype defined by the @fa<subtype_indication> shall be a definite
-subtype, or there shall be a return expression.
+subtype, or there shall be an @nt{expression}.
 
 If the result subtype of the function is defined by an @fa<access_definition>,
 the @fa<return_subtype_indication> shall be an @fa<access_definition>. The
@@ -981,24 +1010,25 @@
 subtype of the function. The accessibility level of this anonymous access
 subtype is that of the result subtype.
 
-If the type of the return expression is limited, then the return expression
-shall be an aggregate, a function call (or equivalent use of an operator),
+If the result subtype of the function is limited, then the @fa<expression>
+shall be an @fa<aggregate>, a function call (or equivalent use of an operator),
 or a @fa<qualified_expression> or parenthesized expression whose operand is one
 of these.
 
-If the result type is class-wide, the accessibility level of the
-type of the return expression shall not be statically deeper than
-that of the master that elaborated the function body. If the result
+If the result subtype of the function is class-wide, the accessibility level of
+the type of the @fa<expression> of the return statement shall not be
+statically deeper than that of the master that elaborated the function
+body. If the result
 subtype has one or more unconstrained access discriminants, the
-accessibility level of the anonymous access type of each access
-discriminant, as determined by the @fa<return_subtype_indication> or the
-return expression, shall not be statically deeper than that of the
+accessibility level of the anonymous access type of each access discriminant,
+as determined by the @fa<expression> of the @fa<simple_return_statement> or the
+@fa<return_subtype_indication>, shall not be statically deeper than that of the
 master that elaborated the function body.
 
 @i<@s8<Static Semantics>>
 
 Within an @fa<extended_return_statement>, the @i<return object> is declared
-with the given identifier, with nominal subtype defined by the
+with the given identifier, with the nominal subtype defined by the
 @fa<return_subtype_indication>.
 
 
@@ -1010,9 +1040,9 @@
 @dby
 For the execution of an @fa<extended_return_statement>, the
 @fa<subtype_indication> or @fa<access_definition> is elaborated. This creates
-the nominal subtype of the return object. If there is a return expression,
+the nominal subtype of the return object. If there is an @fa<expression>,
 it is evaluated and converted
-to the nominal subtype (which might raise Constraint_Error -- see 4.6); the
+to the nominal subtype (which might raise Constraint_Error @emdash see 4.6); the
 return object is created and the converted value
 becomes the initial value of the return object; otherwise, the return object is
 created and
@@ -1040,9 +1070,9 @@
 body. If the result subtype has one or more unconstrained access
 discriminants, a check is made that the accessibility level of the
 anonymous access type of each access discriminant, as determined by
-the @fa<return_subtype_indication> or return expression, is not deeper
-than that of the master that elaborated the function body.
-If either check fails, Program_Error is raised.
+the @fa<expression> of the @fa<simple_return_statement> or the
+@fa<return_subtype_indication>, is not deeper than that of the master that
+elaborated the function body. If either check fails, Program_Error is raised.
 
 
 !corrigendum 6.5(22)
@@ -1052,16 +1082,16 @@
 execution of the construct to which the @fa<return_statement> applies,
 and returns to the caller.
 @dinst
-@i<@s8<Implementation Permission>>
+@i<@s8<Implementation Permissions>>
 
 If the result subtype of a function is unconstrained,
 and a call on the function is used to provide the initial value of
 an object with a constrained nominal subtype, Constraint_Error may
-be raised at the point of the call while elaborating a
-@fa<return_subtype_indication> or evaluating a return expression within
-the function, if it is determined that the value of the result will
-violate the constraint of this object's subtype.
-
+be raised at the point of the call (after abandoning the
+execution of the function body) if, while elaborating a
+@fa<return_subtype_indication> or evaluating the @fa<expression> of a return
+statement within the function, it is determined that the value of the
+result will violate the constraint of this object's subtype.
 
 !corrigendum 7.6.1(03)
 
@@ -1069,7 +1099,7 @@
 After execution of a construct or entity is complete, it is @i<left>, meaning
 that execution continues with the next action, as defined for the execution
 that is taking place. Leaving an execution happens immediately after its
-completion, except in the case of a master: the execution of a @fa<task_body>,
+completion, except in the case of a @i<master>: the execution of a @fa<task_body>,
 a @fa<block_statement>, a @fa<subprogram_body>, an @fa<entry_body>, or an
 @fa<accept_statement>. A master is finalized after it is complete, and before
 it is left.
@@ -1077,9 +1107,8 @@
 After execution of a construct or entity is complete, it is @i<left>, meaning
 that execution continues with the next action, as defined for the execution
 that is taking place. Leaving an execution happens immediately after its
-completion, except in the case of a master: the execution of a body other than
-a @fa<package_body>; the elaboration of a declaration other than the
-declaration of a package or of a type; the execution of a @fa<statement>; or
+completion, except in the case of a @i<master>: the execution of a body other than
+a @fa<package_body>; the execution of a @fa<statement>; or
 the evaluation of an @fa<expression> or @fa<range> that is not part of an
 enclosing @fa<expression>, @fa<range>, or @fa<simple_statement>. A master is
 finalized after it is complete, and before it is left.
@@ -1137,17 +1166,17 @@
 For tasks created by the elaboration of @fa<object_declaration>s of a given
 declarative region, the activations are initiated within the context of the
 @fa<handled_sequence_of_statements> (and its associated @fa<exception_handler>s
-if any -- see 11.2), just prior to executing the statements of the
+if any @emdash see 11.2), just prior to executing the statements of the
 @fa<_sequence>. For a package without an explicit body or an explicit
 @fa<handled_sequence_of_statements>, an implicit body or an implicit
 @fa<null_statement> is assumed, as defined in 7.2.
 @dby
 For the tasks of a given declarative region, the activations are initiated
 within the context of the @fa<handled_sequence_of_statements> (and its
-associated @fa<exception_handler>s if any -- see 11.2), just prior to executing
-the statements of the @fa<_sequence>. For a package without an explicit body or
-an explicit @fa<handled_sequence_of_statements>, an implicit body or an
-implicit @fa<null_statement> is assumed, as defined in 7.2.
+associated @fa<exception_handler>s if any @emdash see 11.2), just prior to executing
+the statements of the @fa<handled_sequence_of_statements>. For a package
+without an explicit body or an explicit @fa<handled_sequence_of_statements>, an
+implicit body or an implicit @fa<null_statement> is assumed, as defined in 7.2.
 
 
 !corrigendum 9.2(04)
@@ -1189,12 +1218,12 @@
 !corrigendum 13.11.2(9)
 
 @drepl
-@xhang<@xterm<3.>Free(X), when X is not equal to null first performs
+@xhang<@xterm<3.>Free(X), when X is not equal to @b<null> first performs
 finalization, as described in 7.6. It then deallocates the storage
 occupied by the object designated by X. If
 the storage pool is a user-defined object, then the storage is
 deallocated by calling Deallocate, passing
-access_to_variable_subtype_name'Storage_Pool as the Pool
+@i<access_to_variable_subtype_name>'Storage_Pool as the Pool
 parameter. Storage_Address is the value returned in the
 Storage_Address parameter of the corresponding Allocate call.
 Size_In_Storage_Elements and Alignment are the same values passed
@@ -1202,13 +1231,13 @@
 object being freed contains tasks, the object might not be
 deallocated.
 @dby
-@xhang<@xterm<3.>Free(X), when X is not equal to null first performs
+@xhang<@xterm<3.>Free(X), when X is not equal to @b<null> first performs
 finalization of the object designated by X (and any coextensions of the
 object @emdash see 3.10.2), as described in 7.6.1. It then deallocates the
 storage occupied by the object designated by X (and any coextensions). If
 the storage pool is a user-defined object, then the storage is
 deallocated by calling Deallocate, passing
-access_to_variable_subtype_name'Storage_Pool as the Pool
+@i<access_to_variable_subtype_name>'Storage_Pool as the Pool
 parameter. Storage_Address is the value returned in the
 Storage_Address parameter of the corresponding Allocate call.
 Size_In_Storage_Elements and Alignment are the same values passed

Questions? Ask the ACAA Technical Agent