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

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

--- ai12s/ai12-0333-1.txt	2019/06/03 23:57:37	1.2
+++ ai12s/ai12-0333-1.txt	2019/06/04 00:09:54	1.3
@@ -1,4 +1,4 @@
-!standard 3.2.4(31/5)                                  19-05-30  AI12-0333-1/02
+!standard 3.2.4(31/5)                                  19-05-31  AI12-0333-1/03
 !class Amendment 19-05-07
 !status work item 19-05-07
 !status received 19-05-06
@@ -7,16 +7,17 @@
 !subject Predicate checks on out parameters
 !summary
 
-Predicate checks are never performed on out parameters.
+Predicate checks are never performed on inbound out parameters.
 
 !problem
 
-The language rules require that an out parameter of a composite type undergoes
-a predicate check when passed in. The wording of 6.4.1 triggers predicate
-checks when passing in an OUT parameter of a composite type by talking about
-conversions of the objects. According to the current RM, all conversions
-cause redicate checks. However, this means that even uninitialized composite
-objects are checked. This is bizarre.
+The language rules require that an out parameter of a composite type
+undergoes a predicate check when passed in. The wording of 6.4.1
+triggers predicate checks when passing in an OUT parameter of a
+composite type by talking about conversions of the objects. According to
+the current Standard, all conversions cause predicate checks. However, this
+means that even uninitialized composite objects are checked. This is
+bizarre.
 
 !proposal
 
@@ -28,8 +29,8 @@
 
   [Redundant:On [every] {a} subtype conversion, a check is performed
   that the operand satisfies the predicates of the target subtype{,
-  unless the conversion is applied to an actual out parameter prior to a
-  call}. [This includes all parameter passing, except for certain
+  unless it is a conversion for an actual parameter of mode out (see
+  4.6)}. [This includes all parameter passing, except for certain
   parameters passed by reference, which are covered by the following
   rule: ]] {In addition, after}[After] normal completion and leaving of
   a subprogram, for each in out or out parameter that is passed by
@@ -50,8 +51,13 @@
   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
-  applies to an actual out parameter, prior to the call}.
+  is:
 
+   * a view conversion that is an actual parameter of mode out; or
+
+   * an implicit subtype conversion of an actual parameter of mode out
+     to the nominal subtype of its formal parameter}.
+
 Modify 6.4.1(14) as follows:
 
   For a composite type with discriminants or that has implicit initial
@@ -61,21 +67,22 @@
 
 !discussion
 
+The original Ada 83 model of out parameters is that they are
+uninitialized on input. One can see this in the fact that elementary
+types are never checked for any constraint, exclusion, or predicate.
+
+That model didn't quite work for composite types, as bounds and
+discriminants have to be passed in (and checked). The representation of a
+parameter can depend on the form of constraint it has (for instance,
+statically constrained arrays are usually represented differently than
+unconstrained arrays), so avoiding checks could cause objects with an
+incompatible representation to be passed.
+
+On the other hand, no such issue applies to predicates. As such, it
+makes the most sense to avoid any checking of predicates for inbound out
+parameters (of course, the predicates will be checked when the
+subprogram returns).
 
-The original Ada 83 model of out parameters is that they are uninitialized
-on input. One can see this in the fact that elementary types are never
-checked for any constraint, exclusion, or predicate.
-
-That model didn't quite work for composite types, as bounds and discrimiants
-have to be passed in (and checked). The representation of a parameter can depend
-on the form of constraint it has (for instance, statically constrained arrays
-are usually represented differently than unconstrained arrays), so avoiding
-checks could cause objects with an incompatible representation to be passed.
-
-On the other hand, no such issue applies to predicates. As such, it makes the
-most sense to avoid any checking of predicates for inbound out parameters (of
-course, the predicates will be checked when the subprogram returns).
-
 !ASIS
 
 No new ASIS capabilities.
@@ -83,7 +90,7 @@
 !ACATS test
 
 An ACATS C-Test is needed to check that predicates are not checked when
-passing composite out parameters.
+passing composite out parameters inbound.
 
 !appendix
 
@@ -423,6 +430,51 @@
 
 Here is the updated AI12-0333-1, where we decided to eliminate all predicate
 checks on OUT parameters. [This is version /02 of the AI - Editor.]
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Friday, May 31, 2019 4:07 PM
+
+Randy and Steve had some comments on the wording.  Here is another version.
+[This is version /03 of the AI - Editor.] This one simplifies the wording where
+it is redundant, in 3.2.4, and adds more detail where the normative wording
+appears, in 4.6.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Monday, June 3, 2019 7:08 PM
+
+
+A few editorial-ish fixes to this:
+
+>!summary
+>
+> Predicate checks are never performed on out parameters.
+
+Umm, no, predicate checks are never performed on *inbound* out parameters,
+they're still performed on return.
+
+...
+> conversions of the objects. According to the current RM, all
+
+We say "Standard", not RM, in AIs.
+
+...
+> That model didn't quite work for composite types, as bounds
+> and discrimiants have to be passed in (and checked). The
+
+"discriminants". (Thanks to Steve for pointing this out privately; the error was
+in my original version of this AI, so I can't even blame Tucker for the error.)
+
+...
+> An ACATS C-Test is needed to check that predicates are not
+> checked when passing composite out parameters.
+
+We need "inbound" here, too.
+
+All of these are fixed in the posted version.
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent