!standard 10.02.01 (11) 99-08-31 AI95-00002/03 !class binding interpretation 95-06-25 !status Corrigendum 2000 99-05-24 !status WG9 approved 95-06-14 !status ARG approved (subject to editorial review) 9-0-2 95-11-01 !status received 95-06-25 !qualifier Error !subject Subunits of a preelaborated subprogram !summary A package subunit whose parent is a preelaborated subprogram need not be preelaborable. !question 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 A package subunit of a preelaborated subprogram need not be preelaborable. !wording (See corrigendum.) !discussion 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. !corrigendum 10.02.01(11) @dprepl All compilation units of a preelaborated library unit shall be preelaborable. @dby All compilation units of a preelaborated library unit other than subunits of preelaborated subprogram units shall be preelaborable. !ACATS test Test CA21001 checks that the newly allowed case is supported. Test BA21004 checks that only this permission is allowed. !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. ****************************************************************