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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,28b389d4503cb555 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: generic package dilemma Date: 1999/11/20 Message-ID: <3836D487.B741CBF1@mail.com>#1/1 X-Deja-AN: 551230604 Content-Transfer-Encoding: 7bit References: <80u48b$ghr$1@bunyip.cc.uq.edu.au> <3832e27f_1@news1.prserv.net> <3832E75D.5B1BA719@mail.com> <383319e8_4@news1.prserv.net> <3833F615.5AD7166C@mail.com> <383442e1_1@news1.prserv.net> <383510EA.9DFEE8B6@mail.com> <383569db_2@news1.prserv.net> <81449o$1fh$1@nnrp1.deja.com> <3835cb73_3@news1.prserv.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: VTX Services SA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-20T00:00:00+00:00 List-Id: Matthew Heaney wrote: > > In article <81449o$1fh$1@nnrp1.deja.com> , Robert Dewar > wrote: > > > The rule is simple, if you instantiate a generic from within > > elaboration code, then you must use a pragma Elaborate_All > > on the generic. > > But Mats seems to be saying that if you do this: > > generic > ... > package GQ is ... end GQ; > > with GP; > package body GQ is > package P is new GP; > ... > end GQ; > > then you should NOT use an elaborate(_all) pragma on GP. This would > appear to be in violation of the rule that you're advocating. No. The above is in a generic body, whose elaboration does nothing: the actual instantiation of GP is going to happen only when GQ is instantiated. If GQ were not generic, then you would need the pragma. GP's body will need to be elaborated before any non-generic unit that instantiates GQ, and that's the only constraint. In particular, it can be elaborated after GQ's body, and that's because GQ is a generic. The elaboration of a generic body has no other effect than to establish that from now on, the generic can be elaborated. Check the RM for details. > So which is it: should the body of GQ above pragma Elaborate_All (GP), > or not? no pragma is necessary.