CVS difference for ai05s/ai05-0214-1.txt
--- ai05s/ai05-0214-1.txt 2011/02/16 06:15:23 1.6
+++ ai05s/ai05-0214-1.txt 2011/03/17 07:06:30 1.7
@@ -1,6 +1,8 @@
-!standard 3.7(9.1/2) 11-02-10 AI05-0214-1/04
+!standard 3.7(9.1/2) 11-03-11 AI05-0214-1/05
!standard 3.7.2(3)
!class amendment 10-06-12
+!status Amendment 2012 11-03-11
+!status ARG Approved 6-0-2 10-02-18
!status work item 10-06-12
!status received 10-06-12
!priority Medium
@@ -56,6 +58,11 @@
there is no use for this attribute that would justify the overhead
of passing it with all classwide parameters.
+ AARM Discussion: If the type of A is a type derived from an untagged
+ partial view of a tagged type such that it is not a tagged type, then
+ A is not considered a tagged object, and A'Constrained can return
+ either True or False.
+
!discussion
Discriminants for tagged types do not allow defaults as mutable types cause
@@ -92,11 +99,67 @@
but not whether it is tagged, unless there is cooperation from the caller of the
routine).
+There is one unusual case, noted by the AARM note: If the type of an object A
+is a type derived from an untagged partial view of a tagged type such that it is
+not a tagged type, then A is not a tagged object and the other rules apply.
+
+For instance:
+
+package P is
+ type Priv (A : Natural) is private;
+private
+ type Priv (A : Natural) is tagged ...
+end P;
+
+with P;
+package Q is
+ type P2 (B : Integer := 10) is new P.Priv(B);
+ procedure Proc (Obj : in out P2);
+end Q;
+
+package body Q is
+ procedure Proc (Obj : in out P2) is
+ begin
+ if Obj'Constrained then
+ raise Program_Error;
+ end if;
+ end Proc;
+
+ P2_Obj : P2;
+
+begin
+ Proc (P2_Obj); -- Does not raise Program_Error.
+end Q;
+
+
+
!example
+See the Queue containers (AI05-0159-1) for an example of use.
---!corrigendum A.4.4(3)
+!corrigendum 3.7(9.1/2)
+@drepl
+@fa<Default_expression>s shall be provided either for all or for none of the
+discriminants of a @fa<known_discriminant_part>. No @fa<default_expression>s
+are permitted in a @fa<known_discriminant_part> in a declaration of a tagged
+type or a generic formal type.
+@dby
+@fa<Default_expression>s shall be provided either for all or for none of the
+discriminants of a @fa<known_discriminant_part>. No @fa<default_expression>s
+are permitted in a @fa<known_discriminant_part> in a declaration of
+a nonlimited tagged type or a generic formal type.
+
+!corrigendum 3.7.2(3)
+
+@drepl
+@xhang<@xterm<A'Constrained>
+Yields the value True if A denotes a constant, a value,
+or a constrained variable, and False otherwise.>
+@dby
+@xhang<@xterm<A'Constrained>
+Yields the value True if A denotes a constant, a value, a tagged
+object, or a constrained variable, and False otherwise.>
!ACATS test
Questions? Ask the ACAA Technical Agent