CVS difference for ais/ai-00312.txt

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

--- ais/ai-00312.txt	2002/10/01 03:08:54	1.1
+++ ais/ai-00312.txt	2004/03/02 04:45:00	1.2
@@ -1,4 +1,4 @@
-!standard 10.1.6 (05)                                  02-09-26  AI95-00312/00
+!standard 10.1.6 (05)                                  04-02-25  AI95-00312/01
 !standard  4.1.3 (04)
 !class binding interpretation 02-09-26
 !status work item 02-09-26
@@ -10,41 +10,62 @@
 
 !summary
 
-It is legal to name a generic parent unit in a parent_unit_name, context_clause,
-and pragma at the place of a compilation unit.
+It is legal to name a generic child unit in a pragma in a context clause and
+in a pragma at the place of a compilation unit.
 
 !question
 
 The standard makes the following illegal:
 
     generic
-    package parent is
+    package Parent is
         ...
-    end parent;
+    end Parent;
 
     generic
-    procedure parent.p1;
-    pragma Elaborate_Body (parent.p1);   -- illegal
+    procedure Parent.P1;
+    pragma Elaborate_Body (Parent.P1);   -- Illegal?
 
-The problem is that "parent.p1" cannot be used to denote the generic
-procedure. "parent.p1" is not a legal expanded name because "parent" is a
-generic, not a package, thus 4.1.3(4) does not apply. Moreover, the
-"enclosing named construct" clause of 4.1.3(4) doesn't apply because the pragma
-is not enclosed by "parent".
+The problem is that Parent.P1 cannot be used to denote the generic
+procedure. Parent.P1 is not a legal expanded name because Parent
+is a generic, not a package, thus 4.1.3(4) does not apply. Moreover,
+the "enclosing named construct" clause of 4.1.3(4) doesn't apply
+because the pragma is not enclosed by Parent.
 
 This is surprising. Is this intended to be illegal? (No.)
 
 !recommendation
 
+(See wording.)
+
 !wording
 
+Move the last two sentences of 10.1.6(2) to a new paragraph at the end
+of 10.1.6 (following 10.1.6(5)) and revise the wording as follows:
+
+  Notwithstanding the rules of 4.1.3, an expanded name in a with_clause{,
+  a pragma in a context_clause, or a pragma that appears at the place of
+  a compilation unit} may consist of a prefix that denotes a generic package
+  and a selector_name that denotes a child of that generic package. (The
+  child is necessarily a generic unit; see 10.1.1.)
+
 !discussion
 
-(* Note: This problem appears to occur in use clauses and pragmas in context
-clauses, and in grandchildren of generic units as well. It's clear that all of
-these were intended to be legal. *)
+The use of expanded names for generic child units is unusual in that such
+names cannot follow the normal rules for expanded names defined in 4.1.3.
+Clause 10.1.6 already has a special dispensation for generic child unit
+names used in with clauses (see the second to last sentence of 10.1.6(2)).
+The problem is that these names should also haven been allowed within pragmas
+that occur outside of the declarative region of a generic child unit. This
+oversight is addressed by extending the "notwithstanding" rule of 10.1.6(2)
+to include pragmas that occur within context clauses and at the place of a
+compilation unit. No exception is needed for the case of use clauses within
+a context clause because the name given in a use clause must denote a package,
+and so a generic child unit name is not allowed there.
 
 !ACATS test
+
+Create a test to check that the above cases are allowed.
 
 !appendix
 

Questions? Ask the ACAA Technical Agent