CVS difference for ai12s/ai12-0137-1.txt
--- ai12s/ai12-0137-1.txt 2014/10/14 03:53:10 1.1
+++ ai12s/ai12-0137-1.txt 2014/11/18 06:52:29 1.2
@@ -1,5 +1,7 @@
-!standard 3.10.1(2.2/2) 14-10-10 AI05-0137-1/01
+!standard 3.10.1(2.1/2) 14-11-17 AI05-0137-1/02
!class binding interpretation 14-10-10
+!status Corrigendum 2015 14-11-17
+!status ARG Approved 7-0-1 14-10-19
!status work item 14-10-10
!status received 14-08-26
!priority Low
@@ -8,7 +10,7 @@
!subject 3.10.1 and class-wide types
!summary
-3.10.1(2.2-2.6) apply to access-to-class-wide types.
+3.10.1(2.2-2.6) applies to access-to-class-wide types.
!question
@@ -29,7 +31,7 @@
dereference.
Does this apply to an access-to-class-wide type? (Yes.) A class-wide type
-does not have a declaration, an incomplete view, or a completion.
+does not have an explicit declaration, an incomplete view, or a completion.
!recommendation
@@ -37,38 +39,54 @@
!wording
-Replace 3.10.1(2.2/2) with:
- Given an access type A whose designated type T is an incomplete
- view, or whose designated type is T'Class where T is an incomplete
- view, a dereference of a value of type A also has this incomplete
- view except when:
+Modify 3.10.1(2.1/2):
+An incomplete_type_declaration declares an incomplete view of a type and its
+first subtype; the first subtype is unconstrained if a discriminant_part
+appears. If the incomplete_type_declaration includes the reserved word tagged,
+it declares a tagged incomplete view.{ If T denotes a tagged incomplete view,
+then T'Class denotes a tagged incomplete view.}[Redundant: An incomplete view
+of a type is a limited view of the type (see 7.5).]
-[This is Adam's suggestion; I don't think it works - RLB.]
-
!discussion
+
+The question claims that a class-wide type does not have an incompelete
+view, because it doesn't have an explicit declaration, and thus
+neither 3.10.1(2.1/2) nor 10.1.1(12.3/3) [whichever is appropriate for
+the kind of incomplete view] applies to it.
-The question notes that a class-wide type does not have an incompelete
-view, because it doesn't have a declaration, and thus 10.1.1(12.3/3)
-does not apply to it. This strikes the author as a bug, in that a
-class-wide type should mirror its associated specific type as closely
-as possible.
+This is clearly the problem, in that a class-wide type should mirror its
+associated specific type as closely as possible.
Indeed, there doesn't seem to be any general rule about properties of
specific types being associated with the class-wide type. 3.4.1(4-5) talks
-about components and values. 7.5(5/3) extended limitedness. There probably
-are a few additional explicitly spelled out rules.
+about components and values. 7.5(5/3) extended limitedness. There may be
+others.
-Clearly, 3.10.1(2.2-2.6/2) should apply here. The proposed wording
-looks simple, but it has a fatal flaw: it says that a dereference of
-A has "this incomplete view", but we started out saying that a class-wide
-type never has an incomplete view. So what incomplete view are we talking
-about here? The incomplete view of the specific type has the wrong type,
-so it better not be that.
-
-Thus it seems that to make this wording work at all, a class-wide type
-needs to have an incomplete view whenever the associated specific type
-has one. That looks like a enough of a can of worms that I gave up at
-this point.
+Thus, it appears that this property needs to be explicitly spelled out in
+the Standard. As such, we add a sentence in 3.10.1(2.1/2) to do that, and
+then all is well, as 3.10.1(2.2-2.6/3) then clearly apply.
+
+Alternative approaches of fixing 3.10.1(2.2-2.6/3) to handle this case
+explicitly always ran into the fatal flaw of there being no incomplete view
+of T'Class to talk about. Once that is fixed, there is no need to make any
+changes to 3.10.1(2.2-2.6/3).
+
+!corrigendum 3.10.1(2.1/2)
+
+@drepl
+An @fa<incomplete_type_declaration> declares an @i<incomplete view> of a type
+and its first subtype; the first subtype is unconstrained if a
+@fa<discriminant_part> appears. If the @fa<incomplete_type_declaration>
+includes the reserved word @b<tagged>, it declares a @i<tagged incomplete view>.
+An incomplete view of a type is a limited view of the type (see 7.5).
+@dby
+An @fa<incomplete_type_declaration> declares an @i<incomplete view> of a type
+and its first subtype; the first subtype is unconstrained if a
+@fa<discriminant_part> appears. If the @fa<incomplete_type_declaration>
+includes the reserved word @b<tagged>, it declares a @i<tagged incomplete view>.
+If @i<T> denotes a tagged incomplete view, then @i<T>'Class denotes a
+tagged incomplete view. An incomplete view of a type is a limited view of
+the type (see 7.5).
!ASIS
Questions? Ask the ACAA Technical Agent