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

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

--- ai12s/ai12-0333-1.txt	2019/05/09 17:36:30	1.1
+++ ai12s/ai12-0333-1.txt	2019/06/03 23:57:37	1.2
@@ -1,4 +1,4 @@
-!standard 3.2.4(31/5)                                  19-05-07  AI12-0333-1/01
+!standard 3.2.4(31/5)                                  19-05-30  AI12-0333-1/02
 !class Amendment 19-05-07
 !status work item 19-05-07
 !status received 19-05-06
@@ -7,45 +7,57 @@
 !subject Predicate checks on out parameters
 !summary
 
-** TBD.
+Predicate checks are never performed on out parameters.
 
 !problem
 
-The language rules require that a out parameter of a composite type undergoes
+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 out composite objects by talking about view conversions
-of the objects. All subtype conversions make predicate checks, including
-these view conversions.
+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.
 
-However, this means that even uninitialized composite objects are checked.
-This is bizarre.
-
 !proposal
 
 (See Summary.)
 
 !wording
 
-Replace 3.2.4(31/5):
+Modify 3.2.4(31/5) as follows:
 
-On every subtype conversion, other than one prior to the call on the actual
-parameter for an out parameter, a check is performed that the operand
-satisfies the predicates of the target subtype. In addition, after normal
-completion and leaving of a subprogram, for each in out or 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 object_declaration with no explicit initialization
-expression, an object created by an uninitialized allocator, or a formal
-out parameter, if the types of any parts have specified Default_Value or
-Default_Component_Value aspects, or any subcomponents have
-default_expressions, a check is performed that the value of the object
-satisfies the predicates of the nominal subtype.
-
-[Editor's note: The wording that was changed in this proposal was wording
-that was marked "Redundant" here; and no proposal was made to change the
-wording that is actually causing this rule (in 4.6 and 6.4.1). As such,
-this change is broken -- it would result in two conflicting semantics.
-No correct wording proposal was made before the deadline.]
+  [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
+  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
+  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 object_declaration with no explicit initialization
+  expression, or by an uninitialized allocator, if the types of any
+  parts have specified Default_Value or Default_Component_Value aspects,
+  or any subcomponents have default_expressions, a check is performed
+  that the value of the created object satisfies the predicates of the
+  nominal subtype.
+
+Modify 4.6(51/4) as follows:
+
+  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
+  applies to an actual out parameter, prior to the call}.
+
+Modify 6.4.1(14) as follows:
+
+  For a composite type with discriminants or that has implicit initial
+  values for any subcomponents (see 3.3.1), the behavior is as for an in
+  out parameter passed by copy{, except that no predicate check is
+  performed}.
 
 !discussion
 
@@ -403,6 +415,14 @@
 fields.  We prefer consistency between the rule we recently agreed on for
 default-initialized objects, and for checks applying to OUT parameters.  Let's
 leave it at that until we have the ARG meeting.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Thursday, May 30, 2019 3:12 PM
+
+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.]
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent