CVS difference for ai12s/ai12-0157-1.txt

Differences between 1.1 and version 1.2
Log of other versions for file ai12s/ai12-0157-1.txt

--- ai12s/ai12-0157-1.txt	2015/03/24 00:21:09	1.1
+++ ai12s/ai12-0157-1.txt	2015/03/28 05:47:28	1.2
@@ -1,9 +1,10 @@
-!standard 3.10.2(19.2/4)                               15-03-23  AI05-0157-1/01
+!standard 3.10.2(19.2/4)                               15-03-27  AI05-0157-1/02
 !standard 3.10.2(19.3/4)
 !standard 4.3.3(11/2)
 !standard 6.8(2/3)
 !standard 6.8(3/3)
 !standard 6.8(5/3)
+!standard 6.8(6/3)
 !standard 6.8(7/3)
 !standard 7.5(2.9/3)
 !standard 13.14(5.1/4)
@@ -13,6 +14,8 @@
 !standard 13.14(10.2/3)
 !standard 13.14(10.3/3)
 !class binding interpretation 15-03-23
+!status Corrigendum 2015 15-03-26
+!status ARG Approved 8-0-2  15-03-26
 !status work item 15-03-23
 !status received 15-02-26
 !priority Low
@@ -44,11 +47,11 @@
        (expression)
        [aspect_specification];
 
-and an aggregate is also surrounded by parenthesis.
+and an aggregate is also surrounded by parentheses.
 
 This is ugly, and inconsistent with the rest of Ada. In particular, it is
 inconsistent with the behavior of aggregates in qualified expressions and
-allocators, and the behavior of other things surrounded in parenthesis like
+allocators, and the behavior of other things surrounded in parentheses like
 conditional expressions and raise expressions.
 
 Should aggregates be allowed here? (Yes.)
@@ -78,7 +81,7 @@
 Modify 3.10.2(19.2/4) [as modified by AI12-0089-1]:
 
  * Inside a return statement that applies to a function or generic function
-   F{, or the expression or aggregate of an expression function F}, when
+   F{, or the return expression of an expression function F}, when
    determining whether the accessibility level of an explicitly aliased
    parameter of F is statically deeper than the level of the return object
    of F, the level of the return object is considered to be the same as
@@ -91,8 +94,8 @@
 
  *  For determining whether a level is statically deeper than the level
     of the anonymous access type of an access result of a function, when
-    within a return statement that applies to the function {or the expression
-    or aggregate of an expression function}, the level of
+    within a return statement that applies to the function {or the return
+    expression of expression function @i<F>}, the level of
     the master of the call is presumed to be the same as that of the
     level of the master that elaborated the function body.
 
@@ -106,17 +109,13 @@
 Modify 4.3.3(11/2):
 
  *  For an explicit_actual_parameter, an explicit_generic_actual_parameter,
-    the expression of a return statement {or the expression or aggregate of
+    the expression of a return statement{, the return expression of
     an expression function}, the initialization expression in an
     object_declaration, or a default_expression [(for a parameter or a
     component)], when the nominal subtype of the corresponding formal
-    parameter, generic formal parameter, function return object, object, or
-    component is a constrained array subtype, the applicable index constraint
-    is the constraint of the subtype;
-
-[Note: The weird "or" is needed so that the five items in the first list
-match up with the five items in the second list. An alternative would be to
-add a sixth item to the second list as well.]
+    parameter, generic formal parameter, function return object{, expression
+    function return object}, object, or component is a constrained array
+    subtype, the applicable index constraint is the constraint of the subtype;
 
 Replace 6.8(2/3) by:
 
@@ -132,42 +131,51 @@
 
 Modify 6.8(3/3):
 
-The expected type for the expression {or aggregate} of an
+The expected type for the expression or aggregate of an
 expression_function_declaration is the result type (see 6.5) of the function.
 
 Modify 6.8(5/3):
 
 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 {or aggregate} of the expression function,
+as determined by the expression {or aggregate} of the
+{expression_function_declaration}[expression function],
 shall not be statically deeper than that of the master that elaborated the
 expression_function_declaration.
 
+Modify 6.8(6/3):
+
+An expression_function_declaration declares an *expression function*.
+{The *return expression* of an expression function is the expression or
+aggregate of the expression_function_declaration.}
+A completion is not allowed for an expression_function_declaration; however,
+an expression_function_declaration can complete a previous declaration.
+
 Modify 6.8(7/3):
 
 The execution of an expression function is invoked by a subprogram call. For
 the execution of a subprogram call on an expression function, the execution
 of the subprogram_body executes an implicit function body containing only a
-simple_return_statement whose expression is [that]{the expression or
-aggregate} of the expression function.
+simple_return_statement whose expression is [that]{the return expression}
+of the expression function.
 
 Modify 7.5(2.9/3):
 
-  * the expression {or aggregate} of an expression_function_declaration
-    (see 6.8)
+  * the {return} expression of an {expression
+    function}[expression_function_declaration] (see 6.8)
 
 [Editor's note: AARM 8.3(29.ee/3) also needs a similar update.]
 
 Modify 13.14(5.1/4) [added by AI12-0103-1]:
 
  * At the occurrence of an expression_function_declaration that is a
-   completion, the expression {or aggregate} of the expression function causes
+   completion, the {return} expression of the expression function causes
    freezing.
 
 Modify 13.14(5.2/4) [added by AI12-0132-1]:
 
   * At the occurrence of a renames-as-body whose callable_entity_name denotes
-    an expression function, the expression {or aggregate} of the expression
+    an expression function, the {return} expression of the expression
     function causes freezing.
 
 Modify 13.14(8/3):
@@ -175,7 +183,7 @@
 A static expression (other than within an aspect_specification) causes freezing
 where it occurs. An object name or nonstatic expression causes freezing where
 it occurs, unless the name or expression is part of a default_expression, a
-default_name, the expression {or aggregate} of an expression function, an
+default_name, the {return} expression of an expression function, an
 aspect_specification, or a per-object expression of a component's constraint,
 in which case, the freezing occurs later as part of another construct or at
 the freezing point of an associated entity.
@@ -185,7 +193,7 @@
   * At the place where a function call causes freezing, the profile of the
     function is frozen. Furthermore, if a parameter of the call is defaulted,
     the default_expression for that parameter causes freezing. If the function
-    call is to an expression function, the expression {or aggregate} of the
+    call is to an expression function, the {return} expression of the
     expression function causes freezing.
 
 [Editor's note: AARM 13.14(10.g/4) also needs a similar update.]
@@ -196,13 +204,13 @@
     entity, the profile of that entity is frozen unless the formal subprogram
     corresponding to the callable entity has a parameter or result of a formal
     untagged incomplete type; if the callable entity is an expression function,
-    the expression {or aggregate} of the expression function causes freezing.
+    the {return} expression of the expression function causes freezing.
 
 Modify 13.14(10.3/3):
 
   * At the place where a use of the Access or Unchecked_Access attribute whose
-    prefix denotes an expression function causes freezing, the expression {or
-    aggregate} of the expression function causes freezing.
+    prefix denotes an expression function causes freezing, the {return} expression
+    of the expression function causes freezing.
 
 !discussion
 
@@ -212,19 +220,6 @@
 this AI and that that test-writer are one and the same). It seems natural, and
 it's best if the syntax of Ada follows that as much as possible.
 
-An alternative to the changes noted here would be to define (as in 4.4(1))
-that *expression of an expression function* is the expression or aggregate
-of an expression_function_declaration. The latter uses of expression and
-aggregate being in the syntax font. Note that doing that would still require
-all of the changes noted here, as "expression" is in the syntax font in all
-12 places noted here [10 normative, two AARM notes], which would have to be
-changed to the normal font. In addition, some of the text uses "expression
-of an expression_function_declaration", and that would have to be changed to
-"expression of an expression function" (no syntax font). Since no work is
-saved by introducing the term, and there doesn't seem to be a readability
-advantage to having another term that not quite the same as the equivalent
-syntax, we didn't do that.
-
 (2) It appears that a strict reading of 4.3.3 says that
 
     function Cool return Some_Array is ((others => 1));
@@ -256,12 +251,232 @@
 body. (Bar here is similar to the construction of function Reference in the
 containers; we would want it to be possible for an expression function to be
 used in place of a full body for these routines.)
+
+!corrigendum 3.10.2(19.2/4)
+
+@drepl
+@xbullet<Inside a return statement that applies to a function or
+generic function @i<F>, when
+determining whether the accessibility level of an explicitly
+aliased parameter of @i<F> is statically deeper than the level of the
+return object of @i<F>, the level of the return object is considered to
+be the same as that of the level of the explicitly aliased
+parameter; for statically comparing with the level of other
+entities, an explicitly aliased parameter of @i<F> is considered to have
+the accessibility level of the body of @i<F>.>
+@dby
+@xbullet<Inside a return statement that applies to a function or generic
+function @i<F>, or the return expression of an expression function @i<F>, when
+determining whether the accessibility level of an explicitly
+aliased parameter of @i<F> is statically deeper than the level of the
+return object of @i<F>, the level of the return object is considered to
+be the same as that of the level of the explicitly aliased
+parameter; for statically comparing with the level of other
+entities, an explicitly aliased parameter of @i<F> is considered to have
+the accessibility level of the body of @i<F>.>
+
+!corrigendum 3.10.2(19.3/4)
+
+@drepl
+@xbullet<For determining whether a level is statically deeper than the
+level of the anonymous access type of an access result of a function
+or generic function @i<F>, when within a return statement that applies
+to @i<F>, the level of the master of the call is presumed to be the same
+as that of the level of the master that elaborated the body of @i<F>.>
+@dby
+@xbullet<For determining whether a level is statically deeper than the
+level of the anonymous access type of an access result of a function
+or generic function @i<F>, when within a return statement that applies
+to @i<F> or the return expression of expression function @i<F>, the
+level of the master of the call is presumed to be the same
+as that of the level of the master that elaborated the body of @i<F>.>
+
+!corrigendum 4.3.3(11/2)
+
+@drepl
+For an @fa<explicit_actual_parameter>, an
+@fa<explicit_generic_actual_parameter>, the
+@fa<expression> of a return statement, the initialization expression in an
+@fa<object_declaration>, or a @fa<default_expression> (for a parameter or a
+component), when the nominal subtype of the corresponding formal parameter,
+generic formal parameter, function return object, object, or component is a
+constrained array subtype, the applicable index constraint is the constraint of
+the subtype;
+@dby
+For an @fa<explicit_actual_parameter>, an
+@fa<explicit_generic_actual_parameter>, the
+@fa<expression> of a return statement, the return expression of
+an expression function, the initialization expression in an
+@fa<object_declaration>, or a @fa<default_expression> (for a parameter or a
+component), when the nominal subtype of the corresponding formal parameter,
+generic formal parameter, function return object, expression
+function return object, object, or component is a constrained array subtype,
+the applicable index constraint is the constraint of the subtype;
+
+!corrigendum 6.8(2/3)
+
+@drepl
+@xcode<@fa<expression_function_declaration ::=
+   [overriding_indicator]
+   function_specification >@b<@ft<is>>@fa<
+      (expression)
+      [aspect_specification];>>
+@dby
+@xcode<@fa<expression_function_declaration ::=
+   [overriding_indicator]
+   function_specification >@b<@ft<is>>@fa<
+      (expression)
+      [aspect_specification];
+ | [overriding_indicator]
+   function_specification >@b<@ft<is>>@fa<
+      aggregate
+      [aspect_specification];>>
+
+!corrigendum 6.8(3/3)
+
+@drepl
+The expected type for the @fa<expression> of an
+@fa<expression_function_declaration> is the result type (see 6.5) of the function.
+@dby
+The expected type for the @fa<expression> or @fa<aggregate> of an
+@fa<expression_function_declaration> is the result type (see 6.5) of the function.
 
---!corrigendum 3.10.2(19.2/4)
---
---@drepl
---@dby
+!corrigendum 6.8(5/3)
 
+@drepl
+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<expression> of the expression function, shall not be
+statically deeper than that of the master that elaborated the
+@fa<expression_function_declaration>.
+@dby
+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<expression> or @fa<aggregate> of the 
+@fa<expression_function_declaration>, shall not be statically deeper
+than that of the master that elaborated the @fa<expression_function_declaration>.
+
+!corrigendum 6.8(6/3)
+
+@drepl
+An @fa<expression_function_declaration> declares an @i<expression function>.
+A completion is not allowed for an @fa<expression_function_declaration>;
+however, an @fa<expression_function_declaration> can complete a previous
+declaration.
+@dby
+An @fa<expression_function_declaration> declares an @i<expression function>.
+The @i<return expression> of an expression function is the @fa<expression> or
+@fa<aggregate> of the @fa<expression_function_declaration>. A completion
+is not allowed for an @fa<expression_function_declaration>; however, an
+@fa<expression_function_declaration> can complete a previous declaration.
+
+!corrigendum 6.8(7/3)
+
+@drepl
+The execution of an expression function is invoked by a subprogram call. For
+the execution of a subprogram call on an expression function, the execution of
+the @fa<subprogram_body> executes an implicit function body containing only a
+@fa<simple_return_statement> whose @fa<expression> is that of the expression
+function.
+@dby
+The execution of an expression function is invoked by a subprogram call. For
+the execution of a subprogram call on an expression function, the execution
+of the @fa<subprogram_body> executes an implicit function body containing only
+a @fa<simple_return_statement> whose @fa<expression> is the return expression
+of the expression function.
+
+
+!corrigendum 7.5(2.9/3)
+
+@drepl
+@xbullet<the @fa<expression> of an @fa<expression_function_declaration>
+(see 6.8)>
+@dby
+@xbullet<the return expression of an expression function (see 6.8)>
+
+!corrigendum 13.14(5.1/4)
+
+@drepl
+@xbullet<At the occurrence of an @fa<expression_function_declaration> that is
+a completion, the @fa<expression> of the expression function causes freezing.>
+@dby
+@xbullet<At the occurrence of an @fa<expression_function_declaration> that is
+a completion, the return expression of the expression function causes freezing.>
+
+!corrigendum 13.14(5.2/4)
+
+@drepl
+@xbullet<At the occurrence of a renames-as-body whose @i<callable_entity_>@fa<name>
+denotes an expression function, the @fa<expression> of the expression function causes
+freezing.>
+@dby
+@xbullet<At the occurrence of a renames-as-body whose @i<callable_entity_>@fa<name>
+denotes an expression function, the return expression of the expression 
+function causes freezing.>
+
+!corrigendum 13.14(8/3)
+
+@drepl
+A static expression (other than within an @fa<aspect_specification>)
+causes freezing where it occurs. An object
+name or nonstatic expression causes freezing where it occurs, unless
+the name or expression is part of a @fa<default_expression>, a
+@fa<default_name>, the @fa<expression> of an expression function,
+an @fa<aspect_specification>,
+or a per-object expression of a component's @fa<constraint>,
+in which case, the freezing occurs later as part of another construct
+or at the freezing point of an associated entity.
+@dby
+A static expression (other than within an @fa<aspect_specification>)
+causes freezing where it occurs. An object
+name or nonstatic expression causes freezing where it occurs, unless
+the name or expression is part of a @fa<default_expression>, a
+@fa<default_name>, the return expression of an expression function,
+an @fa<aspect_specification>,
+or a per-object expression of a component's @fa<constraint>,
+in which case, the freezing occurs later as part of another construct
+or at the freezing point of an associated entity.
+
+!corrigendum 13.14(10.1/3)
+
+@drepl
+@xbullet<At the place where a function call causes freezing, the profile of
+the function is frozen. Furthermore, if a parameter of the call is defaulted,
+the @fa<default_expression> for that parameter causes freezing. If the function
+call is to an expression function, the @fa<expression> of the expression
+function causes freezing.>
+@dby
+@xbullet<At the place where a function call causes freezing, the profile of
+the function is frozen. Furthermore, if a parameter of the call is defaulted,
+the @fa<default_expression> for that parameter causes freezing. If the function
+call is to an expression function, the return expression of the expression
+function causes freezing.>
+
+!corrigendum 13.14(10.2/3)
+
+@drepl
+@xbullet<At the place where a @fa<generic_instantiation> causes freezing of a
+callable entity, the profile of that entity is frozen unless the formal
+subprogram corresponding to the callable entity has a parameter or result of a
+formal untagged incomplete type; if the callable entity is an expression
+function, the @fa<expression> of the expression function causes freezing.>
+@dby
+@xbullet<At the place where a @fa<generic_instantiation> causes freezing of a
+callable entity, the profile of that entity is frozen unless the formal
+subprogram corresponding to the callable entity has a parameter or result of a
+formal untagged incomplete type; if the callable entity is an expression
+function, the return expression of the expression function causes freezing.>
+
+!corrigendum 13.14(10.3/3)
+
+@drepl
+@xbullet<At the place where a use of the Access or Unchecked_Access attribute
+whose @fa<prefix> denotes an expression function causes freezing, the
+@fa<expression> of the expression function causes freezing.>
+@dby
+@xbullet<At the place where a use of the Access or Unchecked_Access attribute
+whose @fa<prefix> denotes an expression function causes freezing, the return
+expression of the expression function causes freezing.>
 
 !ASIS
 

Questions? Ask the ACAA Technical Agent