comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Elaboration of nested generic package.
Date: Wed, 16 Jul 2003 21:08:51 -0500
Date: 2003-07-16T21:08:51-05:00	[thread overview]
Message-ID: <vhc16kc89vmt75@corp.supernews.com> (raw)
In-Reply-To: 1ec946d1.0307160724.1ff7c5b5@posting.google.com

"Matthew Heaney" <mheaney@on2.com> 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.







  reply	other threads:[~2003-07-17  2:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-02  4:13 Elaboration of nested generic package christoph.grein
2003-07-08  3:05 ` Don Westermeyer
2003-07-08 17:46   ` Matthew Heaney
2003-07-10  1:10     ` Don Westermeyer
2003-07-10  1:35       ` Robert I. Eachus
2003-07-10  4:51         ` Robert I. Eachus
2003-07-10  6:58           ` Jean-Pierre Rosen
2003-07-10 15:08             ` Robert I. Eachus
2003-07-11 21:26             ` Robert A Duff
2003-07-10 14:12         ` Matthew Heaney
2003-07-10 15:39           ` Robert I. Eachus
2003-07-11 21:41           ` Robert A Duff
2003-07-14 18:35             ` Matthew Heaney
2003-07-15 17:19               ` Randy Brukardt
2003-07-16 15:24                 ` Matthew Heaney
2003-07-17  2:08                   ` Randy Brukardt [this message]
2003-07-17 15:54                     ` Richard Riehle
2003-07-10 15:03         ` Don Westermeyer
2003-07-10 15:45       ` Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
2003-07-09  5:21 christoph.grein
2003-07-01 20:14 Don Westermeyer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox