CVS difference for ais/ai-00262.txt

Differences between 1.13 and version 1.14
Log of other versions for file ais/ai-00262.txt

--- ais/ai-00262.txt	2002/07/23 01:05:24	1.13
+++ ais/ai-00262.txt	2002/12/04 23:43:38	1.14
@@ -1,4 +1,4 @@
-!standard 10.01.02 (04)                              02-07-11  AI95-00262/05
+!standard 10.01.02 (04)                              02-12-03  AI95-00262/06
 !standard 10.01.02 (08)
 !class amendment 01-02-15
 !status Amendment 200Y 02-07-11
@@ -73,7 +73,7 @@
 A name denoting a library item that is visible only due to being mentioned in
 with_clauses that include the reserved word private shall appear only within
     * a private part,
-    * a body,
+    * a body, but not within the subprogram_specification of a library subprogram body,
     * a private descendant of the unit on which one of these with_clauses
       appear, or
     * a pragma within a context clause.
@@ -118,12 +118,13 @@
 If we use a visibility rule saying that library subprogram B is not in scope
 in the visible part of C, then the B at (1) resolves to A.B, while (2)
 resolves to library unit B. Simply moving a declaration could silently change
-its meaning: a classic Beaujolais effect.
+its meaning: a classic Beaujolais effect. Removing "private" from with B would
+have the same effect.
 
 With the legality rule as proposed, the B at (1) is illegal. If the user meant
 A.B, they can still say that.
 
-Private withs are allow on all compilation units. They are essentially
+Private withs are allowed on all compilation units. They are essentially
 equivalent to a regular with on bodies. We considered making them illegal
 on units other than (generic) package specifications, but that adds a rule
 with little benefit to users.
@@ -141,12 +142,24 @@
 context clause pragmas such as Elaborate, since elaboration issues matter just
 as much in the private part as in the rest of a package.
 
+We cannot allow the use of private withed units in the subprogram_specification
+part of a library subprogram body acting as a specification -- these are
+visible declarations. For instance, if X is acting as a specification, then
+A.T must be illegal in
+   private with A;
+   procedure X (Y : A.T) is
+We simplify the check by simply saying that such uses are always illegal,
+without requiring the compiler or user to figure out if it is acting as a body.
+Any use in the subprogram specification of a body would have to be illegal
+anyway (it could never conform to the original specification), so there is
+no benefit to a more complex rule.
+
 !example
 
 As described in the problem statement, the low-level Win32 interface for Claw
 is defined in a series of private packages. However, Ada 95 prevents these
-packages from being accessed in the private part of the public types. The
-proposed feature eliminates that problem.
+packages from being accessed in the full types of private types. The proposed
+feature eliminates that problem.
 
 The low-level interface for an image list package might look like:
 
@@ -182,8 +195,8 @@
          ...
     private
        type Image_List_Type is tagged record
-         Handle : Claw.Low_Level_Image_Lists.HImage_List;
-            Flags : Claw.Low_Level_Image_Lists.IL_Flags;
+           Handle : Claw.Low_Level_Image_Lists.HImage_List;
+           Flags : Claw.Low_Level_Image_Lists.IL_Flags;
               ...
        end record;
     end Claw.Image_List;
@@ -194,9 +207,9 @@
 !corrigendum 10.1.2(04)
 
 @drepl
-@xindent<@fa<with_clause ::= @b<with> @i<library_>unit_name {, @i<library_>unit_name}>>
+@xindent<@fa<with_clause ::= @b<with> @i<library_unit_>name {, @i<library_unit_>name}>>
 @dby
-@xindent<@fa<with_clause ::= [@b<private>] @b<with> @i<library_>unit_name {, @i<library_>unit_name}>>
+@xindent<@fa<with_clause ::= [@b<private>] @b<with> @i<library_unit_>name {, @i<library_unit_>name}>>
 
 !corrigendum 10.1.2(08)
 
@@ -218,7 +231,7 @@
 mentioned in @fa<with_clause>s that include the keyword @b<private>
 shall appear only within
 @xbullet<a private part,>
-@xbullet<a body,>
+@xbullet<a body, but not within the @fa<subprogram_specification> of a library subprogram body,>
 @xbullet<a private descendant of the unit on which one of these
 @fa<with_clause>s appear, or>
 @xbullet<a pragma within a context clause.>

Questions? Ask the ACAA Technical Agent