Version 1.1 of ais/ai-00002.txt

Unformatted version of ais/ai-00002.txt version 1.1
Other versions for file ais/ai-00002.txt

!standard 10.02.01 (11)          96-02-06 AI95-00002/02
!class binding interpretation 95-06-25
!status WG9 approved 95-06-14
!status ARG approved (subject to editorial review) 9-0-2 95-11-01
!status received 95-06-25
!subject Subunits of a preelaborated subprogram
!summary 95-06-25
A package subunit whose parent is a preelaborated subprogram need not be preelaborable.
!question 95-06-25
10.2.1(11) says, "All compilation units of a preelaborated library unit shall be preelaborable." The term "all compilation units" includes subunits. Is this really intended? (No.)
!recommendation 95-06-25
A package subunit of a preelaborated subprogram need not be preelaborable.
!wording 95-06-25
!discussion 95-06-25
It is unnecessary to require a subunit of a preelaborated subprogram to be preelaborable, because such a subunit is not elaborated during elaboration of the subprogram.
Furthermore, subunits and physically nested program units should behave in the same way. If a subprogram is preelaborated, packages physically nested within the subprogram need not be preelaborable; therefore, the same should be true of package subunits.
Note that a subunit of a preelaborated package is required to be preelaborable even without the quoted sentence, because such a subunit is elaborated during elaboration of the parent package, and the definition of preelaborability in 10.2.1(5) says, "... unless its elaboration performs...", which makes the rule transitive.
Note that the rule is irrelevant for subunits that are subprograms, since subprograms are always preelaborable.
!appendix

!section 10.2.1(11)
!subject Compilation units "of" a library unit
!reference RM9X-10.2.1(11);5.95
!from Norman Cohen
!reference as: 94-5029.c Norman H. Cohen 94-12-13>>
!discussion

"All compilation units of a preelaborated library unit shall be
preelaborable."

Presumably the compilation units "of" a library unit are the library unit
itself, the body, if any, and all subunits descended from the body.

But then a subunit of a preelaborated subprogram is required to be
preelaborable, which does not seem necessary since elaboration of the
subprogram does not entail elaboration of the subunit.

****************************************************************

!section 10.2.1(11)
!subject Compilation units "of" a library unit
!reference RM9X-10.2.1(11);5.95
!reference 94-5029.c Norman H. Cohen 94-12-13
!from Tucker Taft 94-12-14
!reference as: 94-5030.c Tucker Taft 94-12-14>>
!discussion

> "All compilation units of a preelaborated library unit shall be
> preelaborable."
>
> Presumably the compilation units "of" a library unit are the library unit
> itself, the body, if any, and all subunits descended from the body.
>
> But then a subunit of a preelaborated subprogram is required to be
> preelaborable, which does not seem necessary since elaboration of the
> subprogram does not entail elaboration of the subunit.

Good point.  For a package subunit of a subprogram, this
requirement seems overly restrictive.  What we wanted to ensure
was that the subunit depended semantically only on other
preelaborated units.

****************************************************************

Questions? Ask the ACAA Technical Agent