CVS difference for ais/ai-00377.txt
--- ais/ai-00377.txt 2004/10/05 22:49:20 1.3
+++ ais/ai-00377.txt 2004/12/09 19:55:37 1.4
@@ -1,5 +1,7 @@
-!standard 08.03(26/1) 04-10-04 AI95-00377/02
+!standard 08.03(26/1) 04-11-30 AI95-00377/03
!class binding interpretation 04-04-20
+!status Amendment 200Y 04-11-30
+!status ARG Approved 6-0-1 04-11-21
!status work item 04-08-31
!status received 04-03-23
!priority Low
@@ -9,7 +11,9 @@
!summary
If a library unit generic and a library unit instance thereof have child
-units with the same name, then the explicitly declared child of the instance
+units with the same name, and both are mentioned in with_clauses, the
+
+then the explicitly declared child of the instance
and the implicit declaration corresponding to the child of the generic
hide each other.
@@ -25,18 +29,14 @@
!wording
-Append to end of 10.1.1(19):
+In 8.3(26/1), change:
-Furthermore, if the instance is a library package, then this declaration
-is not visible within the scope of a with_clause that mentions a child
-unit of the instance which is a homograph of this declaration.
-
-Append after 10.1.2(7):
-
-A child unit of a library unit instance of a generic package
-is not visible within the scope of a with_clause that mentions
-a child unit of the generic which is a homograph of the child
-unit of the instance.
+Similarly, the context_clause for a {compilation unit}[subunit] is illegal if
+it mentions (in a with_clause) some library unit, and there is a homograph of
+the library unit that is visible at the place of
+the {compilation unit}[corresponding stub], and the homograph and the
+mentioned library unit are both declared immediately within the same
+declarative region.
!discussion
@@ -51,7 +51,8 @@
approach.
Another approach would be to prefer one of the declarations over the other,
-but hiding both declarations seems cleaner.
+or to hide both declarations, but making the offending with_clause illegal
+is cleaner and corresponds to what is done for subunits.
!example
@@ -84,8 +85,41 @@
with I1.G2;
with System;
procedure Q3 (X : System.Address := I1.G2'Address); -- legal? (no)
+
+In each of these cases, the with of I1.G2 is illegal.
+
+!corrigendum 8.3(26/1)
---!corrigendum
+@drepl
+A non-overridable declaration is illegal if there is a homograph occurring
+immediately within the same declarative region that is visible at the place of
+the declaration, and is not hidden from all visibility by the non-overridable
+declaration. In addition, a type extension is illegal if somewhere within its
+immediate scope it has two visible components with the same name. Similarly,
+the @fa<context_clause> for a @fa<subunit> is illegal if it mentions (in a
+@fa<with_clause>) some library unit, and there is a homograph of the library
+unit that is visible at the place of the corresponding stub, and the homograph
+and the mentioned library unit are both declared immediately within the same
+declarative region. These rules also apply to dispatching operations declared
+in the visible part of an instance of a generic unit. However, they do not
+apply to other overloadable declarations in an instance; such declarations may
+have type conformant profiles in the instance, so long as the corresponding
+declarations in the generic were not type conformant.
+@dby
+A non-overridable declaration is illegal if there is a homograph occurring
+immediately within the same declarative region that is visible at the place of
+the declaration, and is not hidden from all visibility by the non-overridable
+declaration. In addition, a type extension is illegal if somewhere within its
+immediate scope it has two visible components with the same name. Similarly,
+the @fa<context_clause> for a compilation unit is illegal if it mentions (in a
+@fa<with_clause>) some library unit, and there is a homograph of the library
+unit that is visible at the place of the compilation unit, and the homograph
+and the mentioned library unit are both declared immediately within the same
+declarative region. These rules also apply to dispatching operations declared
+in the visible part of an instance of a generic unit. However, they do not
+apply to other overloadable declarations in an instance; such declarations may
+have type conformant profiles in the instance, so long as the corresponding
+declarations in the generic were not type conformant.
!ACATS test
Questions? Ask the ACAA Technical Agent