CVS difference for ais/ai-00311.txt

Differences between 1.2 and version 1.3
Log of other versions for file ais/ai-00311.txt

--- ais/ai-00311.txt	2003/07/03 04:37:47	1.2
+++ ais/ai-00311.txt	2003/09/19 01:42:28	1.3
@@ -1,5 +1,5 @@
-!standard  4.9.1 (02)                                  03-06-27  AI95-00311/01
-!standard 12.5.2 (01)
+!standard  4.9   (31)                                  03-09-10  AI95-00311/02
+!standard  4.9.1 (01)
 !class binding interpretation 02-09-26
 !status work item 02-09-26
 !status received 02-08-28
@@ -23,7 +23,7 @@
     end Pak1;
 
     package body Pak1 is
-        procedure P1 (Left : T1'Base) is
+        procedure P1 (Left : T1'Base) is -- Legal? (No.)
         begin
             null;
         end P1;
@@ -40,15 +40,31 @@
 
 !wording
 
-(* TBD *)
+Add after 4.9(31):
 
+In any case, the constraint of a generic formal type is neither static nor
+null.
+
+
+Replace 4.9.1(1) by:
+
+A constraint *statically matches* another constraint if:
+
+o  both are null constraints; or
+o  both are static and have equal corresponding bounds or discriminant values;
+   or
+o  both are nonstatic and result from the same elaboration of a constraint of a
+   subtype_indication, the same evaluation of a range of a
+   discrete_subtype_definition, or the same declaration of a generic formal
+   subtype.
+
 !discussion
 
 Intuitively, T1's constraint should be nonstatic by definition, since it is not
 known what the actual constraint will be and the actual subtype can have any
 legal constraint whatsoever. However, the standard does not say this.
 
-We would like the wording to allow
+Note that the wording is intended to allow the following:
 
     generic
         type T1 is range <>;
@@ -58,17 +74,41 @@
     end Pak1;
 
     package body Pak1 is
-        procedure P1 (Left : S1) is
+        procedure P1 (Left : S1) is -- Legal
         begin
             null;
         end P1;
     end Pak1;
+
+That's because the constraints on S1 and T1 "result from the same declaration
+of a generic formal subtype".
 
-to be legal. That eliminates the obvious fix of saying that a generic formal
-subtype only matches itself in 4.9.1(2). Another fix, to say that a formal
-subtype always has nonstatic constraints (after 4.9(31)), also fails this test.
+!corrigendum 4.9(31)
 
-(At this point I gave up - ED).
+@dinsa
+@xbullet<A discriminant constraint is static if each @fa<expression> of the
+constraint is static, and the subtype of each discriminant is static.>
+@dinst
+In any case, the constraint of a generic formal type is neither static nor
+null.
+
+!corrigendum 4.9.1(1)
+
+@drepl
+A constraint @i<statically matches> another constraint if both are null
+constraints, both are static and have equal corresponding bounds or
+discriminant values, or both are nonstatic and result from the same elaboration
+of a @fa<constraint> of a @fa<subtype_indication> or the same evaluation of a
+@fa<range> of a @fa<discrete_subtype_definition>.
+@dby
+A constraint @i<statically matches> another constraint if:
+@xbullet<both are null constraints; or>
+@xbullet<both are static and have equal corresponding bounds or discriminant
+values; or>
+@xbullet<both are nonstatic and result from the same elaboration
+of a @fa<constraint> of a @fa<subtype_indication>, the same evaluation of a
+@fa<range> of a @fa<discrete_subtype_definition>, or the same declaration of
+a generic formal subtype.>
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent