CVS difference for ai05s/ai05-0017-1.txt

Differences between 1.1 and version 1.2
Log of other versions for file ai05s/ai05-0017-1.txt

--- ai05s/ai05-0017-1.txt	2006/11/10 06:44:49	1.1
+++ ai05s/ai05-0017-1.txt	2007/04/05 01:49:14	1.2
@@ -1,4 +1,4 @@
-!standard 13.14(3/1)                                   06-11-09    AI05-0017-1/01
+!standard 13.14(3/1)                                   07-04-04    AI05-0017-1/02
 !class binding interpretation 06-11-09
 !status work item 06-11-09
 !status received 06-08-02
@@ -9,7 +9,8 @@
 
 !summary
 
-The occurrence of a package body does not freeze an incomplete type deferred to a body.
+The rules that define how package bodies freeze Taft-Amendment types are modified
+to eliminate anomalies.
 
 !question
 
@@ -49,23 +50,41 @@
 
 Modify 13.14(3/1):
 
-   ... of each entity declared before it within the same
-   declarative_part, other than an incomplete type declared
-   within a preceding package or generic package specification.
+The end of a declarative_part, protected_body, or a declaration of a library package
+or generic library package, causes freezing of each entity declared within it, except
+for incomplete types. {The end of a package_body, or a package_body_stub, cause freezing
+of the incomplete types declared within it.} A noninstance body other than a
+renames-as-body causes freezing of each entity declared before it within the
+same declarative_part {that is not an incomplete type; it only causes freezing
+of an incomplete type if the body is within the immediate scope of the incomplete
+type, or if the full_type_declaration and the incomplete_type_declaration occur
+in the same list of declarations.}
 
 !discussion
 
 We don't want an intervening body to freeze any deferred incomplete types, otherwise
-they'd be useless. Moreover, there is no need to freeze them - their representation is
-not needed until their own body is encountered. Thus, we adjust the wording to avoid
-this case.
-
-[Editor's note: I'm troubled by the appeal to Dewar's rule in Pascal's original question.
-Shouldn't we clarify something somewhere to say that a noninstance body doesn't freeze
-anything in that package's declarative region? Surely the rule is intended to apply to
-things in outer regions; the rule about the end of a declarative_part freezing means that
-only incomplete types could possibly be unfrozen at the start of a body. But we wouldn't
-want to change the rules more than this.]
+they'd be useless. Moreover, there is no need to freeze them -- their representation is
+not needed until their own body is encountered, because there are numerous restrictions
+on the usages of such types (see 3.10). So we adjust the wording to avoid unnecessary
+freezing.
+
+The new wording is supposed to have no effect for "ordinary" incomplete types, that is,
+types for which the incomplete_type_declaration and the full_type_declaration occur
+in the same list of declarations. For such types, a noninstance body causes freezing.
+
+The new wording is also supposed to have no effect for bodies that are within the
+immediate scope of the (incomplete) type. For instance, a subprogram body nested
+within the body of the package that declares the type causes freezing.
+
+The new wording says, however, that bodies that don't have visibility to a
+Taft-Amendment type do not cause freezing of this type. This means that, in the
+example, the stub for P1 doesn't freeze P2.T2. Similarly the beginning of the body
+of P1 doesn't freeze P1.T1, otherwise it would be impossible to write a
+Taft Amendment type.
+
+Now that the beginning of the body of P1 doesn't freeze T1, we must at a minimum ensure
+that the *end* of this body freezes T1. This ensures that T1 gets frozen at some
+point, and it preserves the equivalence between proper bodies and stubs.
 
 !corrigendum 13.14(3/1)
 
@@ -78,15 +97,19 @@
 @dby
 The end of a @fa<declarative_part>, @fa<protected_body>, or a declaration of a
 library package or generic library package, causes freezing of each entity
-declared within it, except for incomplete types. A noninstance body other than
+declared within it, except for incomplete types. The end of a @fa<package_body>,
+or a @fa<package_body_stub>, cause freezing of the incomplete types declared
+within it. A noninstance body other than
 a renames-as-body causes freezing of each entity declared before it within
-the same @fa<declarative_part>, other than an incomplete type declared within a
-preceding package or generic package specification.
+the same @fa<declarative_part> that is not an incomplete type; it only causes
+freezing of an incomplete type if the body is within the immediate scope of the
+incomplete type, or if the @fa<full_type_declaration> and the
+@fa<incomplete_type_declaration> occur in the same list of declarations.
 
 !ACATS test
 
-Existing ACATS tests cover the basic cases. A C-test similar to the example in the question
-should be added.
+Existing ACATS tests cover the basic cases. A C-test similar to the example in the
+question should be added.
 
 !appendix
 

Questions? Ask the ACAA Technical Agent