CVS difference for ai05s/ai05-0188-1.txt
--- ai05s/ai05-0188-1.txt 2010/10/13 04:22:42 1.9
+++ ai05s/ai05-0188-1.txt 2010/10/19 03:00:44 1.10
@@ -1,7 +1,11 @@
-!standard 4.5.7(0) 10-07-26 AI05-0188-1/06
+!standard 3.10.2(9/2) 10-10-18 AI05-0188-1/07
+!standard 3.10.2(19.2/3)
+!standard 4.5.7(0)
!standard 4.5.8(0)
!standard 4.9(12)
!standard 4.9(33)
+!standard 6.2(10)
+!standard 6.5(5.5/2)
!class amendment 09-11-03
!status Amendment 2012 10-07-26
!status work item 09-11-03
@@ -85,6 +89,28 @@
!wording
+Add immediately after 3.10.2(9/2), as a separate bulleted item:
+
+ The accessibility level of a conditional_expression is the
+ accessibility level of the evaluated dependent_expression.
+
+Add after 3.10.2(19.2/3), as a separate bulleted item:
+
+ If a given accessibility level is statically deeper than the
+ levels of each of the dependent_expressions of a
+ conditional_expression, then the given level is statically deeper than
+ that of the conditional_expression. Similarly, if the accessibility
+ level of each dependent_expression of a conditional_expression is
+ statically deeper than some given level, then the accessibility
+ level of the conditional_expression is statically deeper than
+ the given level.
+
+ AARM note: Roughly speaking, a "statically deeper than"
+ relation involving a conditional_expression holds if and
+ only if the same relation would hold for every
+ dependent_expression of the conditional_expression.
+
+
Rename 4.5.7 as added by AI05-0147-1 to If Expressions
Modify the syntax rules in 4.5.7 added by AI05-0147-1:
@@ -197,10 +223,59 @@
The existing bullet is changed to discuss if_expressions rather than
conditional_expression.
+Append to the end of 6.2(10):
+ For a conditional_expression, this object is the one associated with
+ the evaluated dependent_expression.
+
+Replace 6.5(5.5/2) and AARM 6.5(5.c/2): [Note: This paragraph was renumbered
+to 5.6/3 by AI05-0032-1]
+
+ If the result subtype of the function is limited, then the expression
+ of the return statement (if any) shall be an aggregate, a function
+ call (or equivalent use of an operator), or a qualified_expression or
+ parenthesized expression whose operand is one of these.5.c/2
+
+ Discussion: In other words, if limited, the expression must produce a
+ “new” object, rather than being the name of a preexisting object
+ (which would imply copying).
+
+with
+
+ Redundant [If the result subtype of the function is limited, then the
+ expression of the return statement (if any) shall meet the restrictions
+ described in 7.5.]
+
!discussion
-(See !problem.)
+The changes to 3.10.2, 6.2, and 6.5 are needed to close minor holes in the
+original AI05-0147-1; they equally apply to this AI.
+
+Defining the accessibility level of a conditional expression to be that of the
+evaluated expression may preclude making a copy in some cases. Consider
+
+ type R is record F : aliased Integer; end record;
+ X, Y : R;
+ Type Ref is access constant Integer;
+ Ptr : Ref;
+
+ procedure Foo (Flag : Boolean) is
+ begin
+ Ptr := R'(if Flag then X else Y).F'Access;
+ end Foo;
+
+It would be incorrect to assign into Ptr a reference to a copy that will cease
+to exist when Foo is exited.
+
+This non-copying is required for an immutably limited type and seems desirable for
+a by-reference type, For a conditional expression of a by-copy type or of a
+neither-by-copy-nor-by-reference type, the situation seems less clear. However,
+the given wording is consistent with the treatment of parenthesized expressions,
+qualified expressions, etc. Note also that the accessibility level of a
+conditional expression is completely irrelevant in most cases; in those cases,
+this rule would have no bearing on whether an implementation would be allowed to
+make a copy.
+
!examples
(See !problem.)
@@ -209,6 +284,42 @@
ACATS B and C tests are needed.
+!corrigendum 3.10.2(9/2)
+
+@dinsa
+@xbullet<The accessibility level of a view conversion, @fa<qualified_expression>,
+or parenthesized expression, is the same as that of the operand.>
+@dinst
+@xbullet<The accessibility level of a @fa<conditional_expression> is the
+accessibility level of the evaluated @i<dependent_>@fa<expression>.>
+
+
+!comment Mostly in the conflict file.
+!corrigedum 3.10.2(19/2)
+
+@drepl
+@xbullet<The statically deeper relationship does not apply to the accessibility
+level of the anonymous type of an access parameter specifying an
+access-to-object type; that is, such an accessibility level is not
+considered to be statically deeper, nor statically shallower, than
+any other.>
+@dby
+@xbullet<The statically deeper relationship does not apply to the accessibility
+level of the anonymous type of an access parameter specifying an
+access-to-object type nor does it apply to a descendant of a generic
+formal type; that is, such an accessibility level is not
+considered to be statically deeper, nor statically shallower, than
+any other.>
+
+@xbullet<If a given accessibility level is statically deeper than the
+levels of each of the @i<dependent_>@fa<expression>s of a
+@fa<conditional_expression>, then the given level is statically deeper than
+that of the @fa<conditional_expression>. Similarly, if the accessibility
+level of each @i<dependent_>@fa<expression> of a @fa<conditional_expression>
+is statically deeper than some given level, then the accessibility
+level of the @fa<conditional_expression> is statically deeper than
+the given level.>
+
!corrigendum 4.5.7
@dinsc
@@ -293,6 +404,32 @@
Rest of the wording is found in the conflict file.
+!corrigendum 6.2(10)
+
+@drepl
+A parameter of a by-reference type is passed by reference. Each value of a
+by-reference type has an associated object. For a parenthesized expression,
+@fa<qualified_expression>, or @fa<type_conversion>, this object is the one associated
+with the operand.
+@dby
+A parameter of a by-reference type is passed by reference. Each value of
+a by-reference type has an associated
+object. For a parenthesized expression, @fa<qualified_expression>,
+or @fa<type_conversion>, this object is the one associated with the
+operand. For a @fa<conditional_expression>, this object is the one associated
+with the evaluated @i<dependent_>@fa<expression>.
+
+!corrigendum 6.5(5.5/2)
+
+@drepl
+If the result subtype of the function is limited, then the @fa<expression> of the
+return statement (if any) shall be an @fa<aggregate>, a function call (or
+equivalent use of an operator), or a @fa<qualified_expression> or parenthesized
+expression whose operand is one of these.
+@dby
+If the result subtype of the function is limited, then the
+@fa<expression> of the return statement (if any) shall meet the restrictions
+described in 7.5.
!appendix
Questions? Ask the ACAA Technical Agent