CVS difference for ais/ai-00402.txt

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

--- ais/ai-00402.txt	2005/01/28 02:10:51	1.2
+++ ais/ai-00402.txt	2005/04/13 05:37:22	1.3
@@ -1,6 +1,9 @@
-!standard 03.07(10)                                  05-01-22   AI95-00402/01
+!standard 03.07(10)                                  05-03-11   AI95-00402/02
+!standard 03.07(11)
 !standard 06.05(20)
 !class amendment 05-01-27
+!status Amendment 200Y 05-03-11
+!status ARG Approved 7-0-3  05-02-13
 !status work item 05-01-27
 !status received 05-01-22
 !priority High
@@ -13,7 +16,7 @@
 based on the object rather than the type, as for those of
 limited types. However, defaults are only permitted for
 access discriminants of limited types, to avoid accessibility
-checks whih would be needed on assignment statements to objects
+checks which would be needed on assignment statements to objects
 with unconstrained discriminants.
 
 !problem
@@ -104,7 +107,7 @@
   be reclaimed until the subtype_indication goes out of scope.
 
 
-Modify the paragraph added after 6.5(20) by AI-354:
+Modify the paragraph added after 6.5(20) by AI-344:
 
     If the result type is class-wide, a check is made that the
     accessibility level of the type identified by the tag of the result
@@ -137,13 +140,13 @@
     previous version of the RM9X were attributable to this rule).
 
     * A type with an access discriminant shall be limited. This is
-    equivalent to the rule we actually chose for Ada 95 , except that it
+    equivalent to the rule we actually chose for Ada 95, except that it
     allows a type to have an access discriminant if it is limited just
     because of a limited component. For example, any record containing a
     task would be allowed to have an access discriminant, whereas the
-    actual rule requires “limited record”. This rule was also rejected
+    actual rule requires "limited record". This rule was also rejected
     due to readability concerns, and because would interact badly with
-    the rules for limited types that “become nonlimited”.
+    the rules for limited types that "become nonlimited".
 
     * A type may have an access discriminant if it is a limited partial
     view, or a task, protected, or limited record type. This was the
@@ -157,7 +160,7 @@
     full view -- giving the two view different accessibility.
 
     * Any type may have an access discriminant, as above. However,
-    special accessibility rules only apply to types that are “really”
+    special accessibility rules only apply to types that are "really"
     limited (task, protected, and limited records). However, this breaks
     privacy; worse, Legality Rules depend on the definition of
     accessibility.
@@ -174,7 +177,7 @@
 
     * Any type may have an access discriminant. All types have special
     accessibility. This was considered early during the Ada 9X process,
-    but was dropped for “unpleasant complexities”, which unfortunately
+    but was dropped for "unpleasant complexities", which unfortunately
     aren't recorded. It does seem that an accessibility check would be
     needed on assignment of such a type, to avoid copying an object with
     a discriminant pointing to a local object into a more global object
@@ -260,9 +263,52 @@
 
 !example
 
+(See discussion.)
 
---!corrigendum
+!corrigendum 3.7(10)
 
+@drepl
+A @fa<discriminant_specification> for an access discriminant shall appear only
+in the declaration for a task or protected type, or for a type with the
+reserved word @b<limited> in its (full) definition or in that of one of its
+ancestors. 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.
+@dby
+@fa<Default_expression>s shall be provided either for all or for none of the
+discriminants of a 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].
+
+A @fa<discriminant_specification> for an access discriminant
+may have a @fa<default_expression> only in the declaration for a task or
+protected type, or for a type with the reserved word @b<limited> in its (full)
+definition or in that of one of its ancestors. 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.
+
+!corrigendum 3.7(11)
+
+@ddel
+@fa<Default_expression>s shall be provided either for all or for none of the
+discriminants of a 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].
+
+!corrigendum 6.5(20)
+
+@drepl
+The exception Program_Error is raised if this check fails.
+@dby
+If the result type is class-wide, a check is made that the accessibility
+level of the type identified by the tag of the result is not deeper than
+that of the master that elaborated the function body. If the result expression
+is of a type with an access discriminant, a check is made that the
+accessibility level of the object associated with the value of the expression
+is not deeper than that of the master that elaborated the function body.
+If either of these checks fail, Program_Error is raised.
+
+
 !ACATS test
 
 ACATS B and C-Tests should be created to check these rules.
@@ -321,7 +367,7 @@
 anything to do with accessibility checks!
 
 What I don't understand about this is why there isn't any problem on
-assignment of these guys. You went into a length explanation of why variant
+assignment of these guys. You went into a lengthy explanation of why variant
 record components aren't a problem, but (a) I don't understand why variants
 would have anything to do with it; (b) why this isn't a problem on top-level
 discriminants. There isn't any accessibility check defined for components of
@@ -342,7 +388,7 @@
 Ah, got it; the *discriminant check* prevents problems. The AI really,
 really ought to show an example like this and make this point. Talking about
 discriminant defaults hardly makes the appropriate connection (probably
-because they are such a lousy way to define mutual records - sigh). We
+because they are such a lousy way to define mutuable records - sigh). We
 shouldn't have to write examples each time to figure out what is going on...
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent