From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1264e586250f470 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-16 19:07:16 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Elaboration of nested generic package. Date: Wed, 16 Jul 2003 21:08:51 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <5437fafb.0307071905.5d3bbc4e@posting.google.com> <1ec946d1.0307080946.7e61cda9@posting.google.com> <5437fafb.0307091710.5cb4b0eb@posting.google.com> <3F0CC2D1.10904@attbi.com> <1ec946d1.0307100612.20a3d000@posting.google.com> <1ec946d1.0307141035.3f1e4b80@posting.google.com> <1ec946d1.0307160724.1ff7c5b5@posting.google.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:40379 Date: 2003-07-16T21:08:51-05:00 List-Id: "Matthew Heaney" wrote in message news:1ec946d1.0307160724.1ff7c5b5@posting.google.com... > For example, in the AI, there's this example: > > with Op; > > generic > package GP is > pragma Preelaborate; > I : Integer := Op; > ... > end GP; > > The pragma states that the body of GP should be elaborated prior to > the elaboration of any non-preelaborated library units, which means > you can omit elaboration checks during instantiations of GP. > > Fine, but then what categorization pragma should one use on the > instantiation of GP: > > with GP; > pragma Elaborate_All (GP); > package P is new GP; > pragma What_Goes_Here(P); --??? > > We can't use Preelaborate on P, because it isn't preelaborateable > (even though GP is). What would be the difference between using > Elaborate_Body and Elaborate_All on P? Nothing goes here (as you said, you can't put Pure or Preelaborate here, and Elaborate_Body makes no sense for an instantiation). In any case, you don't need to do anything anywhere for elaboration, because the generic body is alway elaborated at the point of the instantiation (which is why you need the elaboration check at the instantiation). See 12.3(20). So there can't be an elaboration problem in some other unit with an instantiation. Randy.