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

Differences between 1.3 and version 1.4
Log of other versions for file ai12s/ai12-0432-1.txt

--- ai12s/ai12-0432-1.txt	2021/06/03 02:16:53	1.3
+++ ai12s/ai12-0432-1.txt	2021/06/08 05:46:03	1.4
@@ -1,6 +1,8 @@
-!standard 3.2.4(31/5)                                  21-06-02  AI12-0432-1/02
+!standard 3.2.4(31/5)                                  21-06-04  AI12-0432-1/03
 !standard 4.6(51.1/5)
-!class Amendment 21-05-28
+!class binding interpretation 21-06-03
+!status Amendment 1-2012 21-06-04
+!status ARG Approved 14-0-0  21-06-03
 !status work item 21-05-28
 !status received 21-05-28
 !priority Low
@@ -11,14 +13,8 @@
 Exclude view conversions of targets of assignment_statements from predicate
 checks.
 
-[Editor's note: This was classified as an Amendment, since the previous AI that
-created the 4.6 rule that is modified here, AI12-0333-1, was an Amendment. I'm
-not sure why the previous AI was an Amendment (it would seem that we don't
-want such checks in Ada 2012, either), but in the absence of a change to that
-we can't have this one be a Binding Interpretation.]
+!question
 
-!problem
-
 We have decided that no predicate checks should be performed "on the way in"
 for an OUT parameter. It seems the same should apply to a view conversion 
 applied to the LHS of a (tagged) assignment. If the specified subtype has a 
@@ -31,8 +27,10 @@
 
    Is_Boiling(X) := (Temp_In_Celsius => 101, ...);
       -- should be OK even if X.Temp_In_Celsius < 100 before the assignment.
+
+Should this be changed? (Yes.)
 
-!proposal
+!recommendation
 
 (See Summary.)
 
@@ -42,16 +40,8 @@
 
    [Redundant: On a subtype conversion, a check is performed that the operand 
    satisfies the predicates of the target subtype, [unless it is a conversion 
-   for] {except for certain view conversions applied to the target of an 
-   assignment or} an actual parameter of mode out (see 4.6).] ...
-
-[Editor's note: I'd prefer to simplify this more, as the important thing is
-not to lie, rather than repeat rules defined elsewhere. I'd suggest:
-
-   On a subtype conversion, a check is performed that the operand 
-   satisfies the predicates of the target subtype, except for certain view
-   conversions (see 4.6). ...
-End Editor's note.]
+   for an actual parameter of mode out] {except for certain view conversions}
+   (see 4.6). ...
 
 Modify 4.6(51.1/5):
 
@@ -65,6 +55,57 @@
 it would be unusual if it didn't meet the predicate of its nominal subtype.
 But there's no need for the object being written to meet the predicate (only
 the source expression needs to do that).
+
+!corrigendum 3.2.4(31/5)
+
+@drepl
+@xindent<On a subtype conversion, a check is performed that the operand
+satisfies the predicates of the target subtype, unless it is a conversion for 
+an actual parameter of mode @b<out> (see 4.6). In addition, after normal 
+completion and leaving of a
+subprogram, for each @b<in out> or @b<out> parameter that is passed by reference,
+a check is performed that the value of the parameter satisfies the predicates
+of the subtype of the actual. For an object created by an @fa<object_declaration>
+with no explicit initialization @fa<expression>, or by an uninitialized
+@fa<allocator>, if the types of any parts have specified Default_Value or 
+Default_Component_Value aspects, or any subcomponents have 
+@fa<default_expression>s, a check is performed that the value of the created 
+object satisfies the predicates of the nominal subtype.>
+@dby
+@xindent<On a subtype conversion, a check is performed that the operand
+satisfies the predicates of the target subtype, except for certain view
+conversions (see 4.6). In addition, after normal completion and leaving of a
+subprogram, for each @b<in out> or @b<out> parameter that is passed by reference,
+a check is performed that the value of the parameter satisfies the predicates
+of the subtype of the actual. For an object created by an @fa<object_declaration>
+with no explicit initialization @fa<expression>, or by an uninitialized
+@fa<allocator>, if the types of any parts have specified Default_Value or 
+Default_Component_Value aspects, or any subcomponents have 
+@fa<default_expression>s, a check is performed that the value of the created 
+object satisfies the predicates of the nominal subtype.>
+
+!corrigendum 4.6(51/4)
+
+@drepl
+After conversion of the value to the target type, if the target subtype is constrained,
+a check is performed that the value satisfies this constraint. If the target subtype
+excludes null, then a check is made that the value is not null. If predicate checks
+are enabled for the target subtype (see 3.2.4), a check is performed that the value
+satisfies the predicates of the target subtype.
+@dby
+After conversion of the value to the target type, if the target
+subtype is constrained, a check is performed that the value satisfies
+this constraint. If the target subtype excludes null, then a check is
+made that the value is not null. If predicate checks are enabled for
+the target subtype (see 3.2.4), a check is performed that the value
+satisfies the predicates of the target subtype, unless the conversion is:
+
+@xbullet<a view conversion that is the target of an assignment statement and 
+is not referenced with a @fa<target_name>, or an actual parameter of mode 
+@b<out>; or>
+
+@xbullet<an implicit subtype conversion of an actual parameter of mode @b<out>
+to the nominal subtype of its formal parameter.>
 
 !ASIS
 

Questions? Ask the ACAA Technical Agent