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

Differences between 1.11 and version 1.12
Log of other versions for file ai12s/ai12-0075-1.txt

--- ai12s/ai12-0075-1.txt	2018/03/06 04:31:37	1.11
+++ ai12s/ai12-0075-1.txt	2018/04/07 06:17:22	1.12
@@ -1,4 +1,4 @@
-!standard 4.9(21)                                  18-03-05    AI12-0075-1/08
+!standard 4.9(21)                                  18-04-06    AI12-0075-1/09
 !standard 6.8(3/4)
 !standard 6.8(5/4)
 !standard 6.8(6/4)
@@ -6,10 +6,11 @@
 !standard 7.3.2(15/4)
 !standard 7.3.2(16/4)
 !standard 7.3.2(17/4)
-!standard 7.3.2(18/4)
 !standard 7.3.2(19/4)
 !standard 7.3.2(20/5)
 !class Amendment 13-06-09
+!status Amendment 1-2012 18-04-06
+!status ARG Approved 10-0-0  18-04-02
 !status work item 13-06-09
 !status received 13-05-07
 !priority Medium
@@ -41,7 +42,7 @@
   The preceding "statically unevaluated" rule allows
        X : constant := (if True then 37 else (1 / 0))
   but does not allow
-       function If_Then_Else (Flag : Boolean; X, Y : Integer) is
+       function If_Then_Else (Flag : Boolean; X, Y : Integer) return Integer is
           (if Flag then X else Y) with Static; -- see 6.8
        X : constant := If_Then_Else (True, 37, 1 / 0);
   because evaluation of a function call includes evaluation of
@@ -81,13 +82,14 @@
 
    Redundant[A static expression function is a static function; see 4.9.]
 
-Move 6.8(6/4) to this point (after the new text), in order to avoid having
-two Static Semantics sections in this clause.
+Move 6.8(6/4) before the above test, in order to avoid having
+two Static Semantics sections in this clause, and to eliminate forward references to
+the term "expression function".
 
 Add after 6.8(5/4): [In the Legality Rules section].
 
   Aspect Static shall be specified to have the value True only if the
-  associated expression function:
+  associated expression_function_declaration:
     - is not a completion;
     - has an expression that is a potentially static expression;
     - contains no calls to itself;
@@ -95,7 +97,7 @@
       static subtype;
     - has a result subtype that is a static subtype;
     - has no applicable precondition or postcondition expression; and
-    - is not type-invariant enforcing for any type (see 7.3.2).
+    - is not type-invariant preserving for any type (see 7.3.2).
 
 AARM Ramification: Since a string subtype can be static, this allows an
 expression function of a string type to be static.
@@ -103,7 +105,7 @@
 Add after 7.3.2(8.2/5) [as added by AI12-0199-1]
 
 If one or more invariant expressions apply to a nonabstract type T, then
-a subprogram or entry is said to be "type-invariant enforcing" for T if
+a subprogram or entry is said to be *type-invariant preserving* for T if
     - it is declared within the immediate scope of T (or by an instance
       of a generic unit, and the generic is declared within the immediate
       scope of type T), or is the Read or Input stream-oriented attribute
@@ -132,8 +134,8 @@
 
 Replace 7.3.2(15/4-20/5) with: [as modified by AI12-0193-1]
 
-   An invariant check is checked upon successful return from a call on any
-   subprogram or entry which is type-invariant enforcing for T. The check is
+   Upon successful return from a call on any subprogram or entry which is
+   type-invariant preserving for @i<T>, an invariant check is
    performed on each part of type T which is subject to an invariant check
    for T. In the case of a call to a protected operation, the check is
    performed before the end of the protected action. In the case of a call
@@ -162,6 +164,165 @@
       never a static function.
 
 !example
+
+!corrigendum 4.9(21)
+
+@dinsa
+@xbullet<an enumeration literal;>
+@dinst
+@xbullet<a static expression function (see 6.8);>
+
+!corrigendum 6.8(3/4)
+
+@dinsa
+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.
+@dinss
+
+@s8<@i<Static Semantics>>
+
+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.
+
+A @i<potentially static expression> is defined in the same way as a
+static expression except that
+
+@xbullet<a name denoting a formal parameter of an expression function
+is a potentially static expression; and>
+
+@xbullet<each use of "static expression" in
+the definition of "static expression" is replaced with
+a corresponding use of "potentially static expression"
+in the definition of "potentially static expression".>
+
+The following language-defined representation aspect may be specified
+for an expression function:
+
+@xhang<@xterm<Static>The type of aspect Static is Boolean. When aspect Static
+is True for an expression function, the function is a @i<static expression
+function>. If directly specified, the @fa<aspect_definition> shall be a
+static expression.>
+
+@xindent<The Static value for an inherited function is True if some
+corresponding primitive function of the parent or
+progenitor type is a static expression function; otherwise,
+if not directly specified, the aspect is False.>
+
+A static expression function is a static function; see 4.9.
+
+!corrigendum 6.8(5/4)
+
+@dinsa
+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>.
+@dinss
+Aspect Static shall be specified to have the value True only if the
+associated @fa<expression_function_declaration>:
+@xbullet<is not a completion;>
+@xbullet<has an @fa<expression> that is a potentially static expression;>
+@xbullet<contains no calls to itself;>
+@xbullet<each parameter (if any) is of mode @b<in> and is of a static subtype;>
+@xbullet<has a result subtype that is a static subtype;>
+@xbullet<has no applicable precondition or postcondition expression; and>
+@xbullet<is not type-invariant preserving for any type (see 7.3.2).>
+
+!corrigendum 6.8(6/4)
+
+@ddel
+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 7.3.2(8/3)
+
+@drepl
+If the Type_Invariant'Class aspect is specified for a tagged type @i<T>,
+then the invariant expression applies to all descendants of @i<T>.
+@dby
+If the Type_Invariant'Class aspect is specified for a tagged type @i<T>,
+then a @i<corresponding expression> also applies to each nonabstract
+descendant @i<T1> of @i<T> (including @i<T> itself if it is nonabstract).
+The corresponding expression is constructed from the associated expression
+as follows:
+
+If one or more invariant expressions apply to a nonabstract type @i<T>, then
+a subprogram or entry is said to be @i<type-invariant preserving> for @i<T> if
+
+@xbullet<it is declared within the immediate scope of @i<T> (or by an instance
+of a generic unit, and the generic is declared within the immediate
+scope of type @i<T>), or is the Read or Input stream-oriented attribute
+of type @i<T>, and either:>
+
+@xinbull<@i<T> is a private type or a private extension and the subprogram or
+entry is visible outside the immediate scope of type @i<T> or overrides
+an inherited operation that is visible outside the immediate scope
+of @i<T>; or>
+
+@xinbull<@i<T> is a record extension, and the subprogram or entry is a primitive
+operation visible outside the immediate scope of type @i<T> or overrides
+an inherited operation that is visible outside the immediate scope
+of @i<T>.>
+
+@xbullet<and at least one of the following applies to the callable entity:>
+
+@xinbull<has a result with a part of type @i<T>;>
+@xinbull<has one or more @b<out> or @b<in out> parameters with a part of
+type @i<T>;>
+@xinbull<has an access-to-object parameter or result whose designated type has
+a part of type @i<T>; or>
+@xinbull<is a procedure or entry that has an @b<in> parameter with a part of type
+@i<T>.>
+
+@xindent<Each such part of type @i<T> is said to be @i<subject to an invariant
+check> for @i<T>.>
+
+!corrigendum 7.3.2(15/4)
+
+@drepl
+@xbullet<After a successful call on the Read or Input stream attribute of
+the type @i<T>, the check is performed on the object initialized by the
+stream attribute;>
+@dby
+@xbullet<Upon successful return from a call on any subprogram or entry which is
+type-invariant preserving for @i<T>, an invariant check is
+performed on each part of type @i<T> which is subject to an invariant check
+for @i<T>. In the case of a call to a protected operation, the check is
+performed before the end of the protected action. In the case of a call
+to a task entry, the check is performed before the end of the rendezvous;>
+
+!corrigendum 7.3.2(16/4)
+
+@ddel
+@xbullet<An invariant is checked upon successful return from a call on
+any subprogram or entry that:>
+
+!corrigendum 7.3.2(17/4)
+
+@ddel
+@xinbull<is declared within the immediate scope of type @i<T> (or by an
+instance of a generic unit, and the generic is declared within the
+immediate scope of type @i<T>),>
+
+!corrigendum 7.3.2(19/3)
+
+@ddel
+@xinbull<has a result with a part of type @i<T>, or one or more
+parameters with a part of type @i<T>, or an access to variable
+parameter whose designated type has a part of type @i<T>.>
+
+!corrigendum 7.3.2(20/3)
+
+@ddel
+@xindent<The check is performed on each such part of type @i<T>.>
 
 !ASIS
 

Questions? Ask the ACAA Technical Agent