CVS difference for ai05s/ai05-0148-1.txt
--- ai05s/ai05-0148-1.txt 2009/04/13 23:41:57 1.1
+++ ai05s/ai05-0148-1.txt 2009/04/13 23:53:39 1.2
@@ -1,4 +1,4 @@
-!standard 6.01 (18) 09-04-12 AI05-0148-1/01
+!standard 6.01 (18) 09-04-13 AI05-0148-1/02
!standard 6.06 (03)
!standard 9.5.1 (02)
!class Amendment 09-04-12
@@ -6,7 +6,7 @@
!status received 09-04-12
!priority Medium
!difficulty Medium
-!subject
+!subject Accessibility of anonymous access stand-alone objects
!summary
@@ -108,22 +108,23 @@
* The accessibility level of the operand type shall not be statically
deeper than that of the target type{, unless the target is a
- stand-alone object. If the target is a stand-alone object, the
- accessibility level of the operand type shall not be statically
- deeper than that of the declaration of the stand-alone object}. In
- addition to the places where Legality Rules normally apply (see
- 12.3), this rule applies also in the private part of an instance of
- a generic unit.
+ stand-alone object of an anonymous access type. If the target is
+ such a stand-alone object, the accessibility level of the operand type
+ shall not be statically deeper than that of the declaration of the
+ stand-alone object}. In addition to the places where Legality Rules
+ normally apply (see 12.3), this rule applies also in the private part
+ of an instance of a generic unit.
Change 4.6(48):
* For an access-to-object type, a check is made that the accessibility
level of the operand type is not deeper than that of the target
- type{, unless the target is a stand-alone object}. {If the target
- is a stand-alone object, a check is made that the accessibility
- level of the operand type is not deeper than that of the declaration
- of the stand-alone object. [Redundant: The accessibility level of
- the target type becomes that of the operand type.]}
+ type{, unless the target is a stand-alone object of an anonymous
+ access type}. {If the target is such a stand-alone object, a check is
+ made that the accessibility level of the operand type is not deeper
+ than that of the declaration of the stand-alone object.
+ [Redundant: The accessibility level of the target type becomes that of
+ the operand type.]}
!discussion
@@ -180,6 +181,11 @@
!appendix
+[This idea grew out of the volumnous e-mail threads found in
+AI05-138-1. - Editor.]
+
+****************************************************************
+
From: Tucker Taft
Sent: Sunday, April 12, 2009 8:46 PM
@@ -569,52 +575,6 @@
****************************************************************
From: Randy Brukardt
-Sent: Monday, April 13, 2009 6:06 PM
-
-In Tucker's proposal, I found the following very confusing:
-
-The accessibility level of the operand type shall not be statically
- deeper than that of the target type{, unless the target is a
- stand-alone object. If the target is a stand-alone object, the
- accessibility level of the operand type shall not be statically
- deeper than that of the declaration of the stand-alone object}. In
- addition to the places where Legality Rules normally apply (see
- 12.3), this rule applies also in the private part of an instance of
- a generic unit.
-
- * For an access-to-object type, a check is made that the accessibility
- level of the operand type is not deeper than that of the target
- type{, unless the target is a stand-alone object}. {If the target
- is a stand-alone object, a check is made that the accessibility
- level of the operand type is not deeper than that of the declaration
- of the stand-alone object. [Redundant: The accessibility level of
- the target type becomes that of the operand type.]}
-
-This wording doesn't make it clear that it is only talking about *anonymous*
-access stand-alone objects. Both of these rules apply to any general
-access-to-object type (not just anonymous).
-
-I think the intent is that the only way that you can be converting directly into
-a stand-alone object is if the type is anonymous. But I'm not really sure that
-is true, a subtype conversion is needed for a constrained access subtype:
-
- type Disc (B : Boolean) is record...
- type Acc_Disc is access all Disc;
- subtype True_Disc is access Disc(True);
-
- procedure Foo (Obj : Acc_Disc) is
- Bar : True_Disc := Obj;
- begin
- ...
-
-Surely Bar is a stand-alone object, and surely we're converting directly to it.
-So how come this new rules don't apply? (I surely hope they don't!!) Even if
-some hair-splitting would get the right answer, I think we need to be more
-explicit.
-
-****************************************************************
-
-From: Randy Brukardt
Sent: Monday, April 13, 2009 6:22 PM
...
@@ -671,14 +631,80 @@
****************************************************************
-From: Bob Duff
-Sent: Monday, April 13, 2009 x:xx PM
+From: Randy Brukardt
+Sent: Monday, April 13, 2009 6:06 PM
+
+In Tucker's proposal, I found the following very confusing:
+
+The accessibility level of the operand type shall not be statically
+ deeper than that of the target type{, unless the target is a
+ stand-alone object. If the target is a stand-alone object, the
+ accessibility level of the operand type shall not be statically
+ deeper than that of the declaration of the stand-alone object}. In
+ addition to the places where Legality Rules normally apply (see
+ 12.3), this rule applies also in the private part of an instance of
+ a generic unit.
+ * For an access-to-object type, a check is made that the accessibility
+ level of the operand type is not deeper than that of the target
+ type{, unless the target is a stand-alone object}. {If the target
+ is a stand-alone object, a check is made that the accessibility
+ level of the operand type is not deeper than that of the declaration
+ of the stand-alone object. [Redundant: The accessibility level of
+ the target type becomes that of the operand type.]}
+
+This wording doesn't make it clear that it is only talking about *anonymous*
+access stand-alone objects. Both of these rules apply to any general
+access-to-object type (not just anonymous).
+
+I think the intent is that the only way that you can be converting directly into
+a stand-alone object is if the type is anonymous. But I'm not really sure that
+is true, a subtype conversion is needed for a constrained access subtype:
+
+ type Disc (B : Boolean) is record...
+ type Acc_Disc is access all Disc;
+ subtype True_Disc is access Disc(True);
+
+ procedure Foo (Obj : Acc_Disc) is
+ Bar : True_Disc := Obj;
+ begin
+ ...
+
+Surely Bar is a stand-alone object, and surely we're converting directly to it.
+So how come this new rules don't apply? (I surely hope they don't!!) Even if
+some hair-splitting would get the right answer, I think we need to be more
+explicit.
+
****************************************************************
-From: Bob Duff
-Sent: Monday, April 13, 2009 x:xx PM
+From: Tucker Taft
+Sent: Monday, April 13, 2009 6:32 PM
+
+My bad. I meant to say "a stand-alone object of an anonymous
+access type" in both cases.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Monday, April 13, 2009 6:50 PM
+
+OK, I fixed the AI. That would have been a bit redundant, so I changed the
+wording to:
+
+ * The accessibility level of the operand type shall not be statically
+ deeper than that of the target type{, unless the target is a
+ stand-alone object of an anonymous access type. If the target is
+ such a stand-alone object, the accessibility level of the operand type
+ shall not be statically deeper than that of the declaration of the
+ stand-alone object}. In addition to the places where Legality Rules
+ normally apply (see 12.3), this rule applies also in the private part
+ of an instance of a generic unit.
+
+That is, I added "such" to the second added sentence so we don't have to
+repeat all of the anonymous stuff. I did that for both paragraphs.
+
****************************************************************
+
From: Bob Duff
Sent: Monday, April 13, 2009 x:xx PM
Questions? Ask the ACAA Technical Agent