CVS difference for ais/ai-00262.txt
--- ais/ai-00262.txt 2001/06/05 00:03:27 1.8
+++ ais/ai-00262.txt 2002/03/13 00:48:28 1.9
@@ -1,6 +1,7 @@
-!standard 10.01.02 (04) 01-06-04 AI95-00262/02
+!standard 10.01.02 (04) 02-02-25 AI95-00262/03
!standard 10.01.02 (08)
!class amendment 01-02-15
+!status ARG Approved 7-0-0 02-02-11
!status work item 01-02-15
!status received 01-02-15
@@ -61,13 +62,18 @@
* the body or subunit of a (public or private) descendant of that
library unit; or
* the declaration of a public descendant of that library unit, and
- the with_clause shall include the reserved work private.
+ the with_clause shall include the reserved word private.
Add after 10.1.2(8):
-In the visible part of a package or generic package, a name shall not denote
-a library unit named only in a with_clause which includes the reserved word
+A name shall not denote a declaration mentioned only in a with_clause which
+includes the reserved word private if:
+ * the name appears in the visible part of a package or generic package, or
+ * the name appears in a use_clause in a context_clause.
+A with_clause which includes the reserved word private shall be appear only
+in the context_clause of a package specification or generic package
@@ -85,8 +91,9 @@
Reference to private withed items in the private part is a legality rule,
rather than a visibility rule, in order to avoid a form of Beaujolais when
a declaration is moved from the visible part to the private part (or
-vice-versa). Since such moves are common, it is important to avoid them.
-With the legality rule, the declarations will be illegal in the public part.
+vice-versa). Since such moves are common, it is important to avoid problems
+with them. With the legality rule, the declarations will be illegal in the
@@ -113,9 +120,12 @@
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 allowed on bodies. They are equivalent to regular withs
-there. We could make them illegal on bodies, but there doesn't seem to be any
-value to doing that.
+Private withs are allowed only on (generic) package specifications. This avoids
+confusion as to the meaning of them on bodies and subprogram specifications.
+We could allow them on bodies, but they would have be equivalent to regular
+withs. For subprograms, they could be defined to not have an effect in the
+subprogram specification (useful on subprogram bodies), but this is of limited
Ada allows a unit to be withed multiple times in a single context clause.
In order to handle this, we have proposed that the legality rule is written
@@ -123,6 +133,12 @@
legality rule does not apply. Alternatively, we could have made such a
combination illegal. But that doesn't seem to buy much, and it adds an
additional new check.
+The legality rule prohibits private withed units from being used in context
+clause use clauses. Allowing this would substantially complicate the legality
+rule for the use of such items, without much benefit. The user can always put
+the use clause in the private part. Private withed units are allowed in
+context clause pragmas such as Elaborate.
Questions? Ask the ACAA Technical Agent