From: "Luke A. Guest" <laguest@archeia.com>
Subject: Re: elab pragma placement
Date: Sun, 22 Jan 2023 08:15:18 +0000 [thread overview]
Message-ID: <tqirfc$1vu2$1@gioia.aioe.org> (raw)
In-Reply-To: 7f9d3951-fbf3-469a-ae4f-a74de26771b1n@googlegroups.com
On 21/01/2023 23:43, Simon Belmont wrote:
> Where is the right spot to apply an elaboration pragma to a library level subprogram? GNAT (20210519-103) complains that in the below code C cannot with subprogram A.B because it's not Pure, but it certainly appears to be,
To be pure it can contain only things that can be pre-elaborated, iirc,
so only types, no functions.
> and no amount of shuffling around the pragma in B seems to placate it. Playing with the declaration of T seems to change the behavior; is GNAT is just misreporting a different error?
>
> Thanks
>
> -sb
>
>
> package A is
> pragma Pure;
> type T is limited null record;
> end A;
>
> procedure A.B (x : T) is
> pragma Pure; -- is this the right spot?
> begin
> null;
> end A.B;
>
> with A.B; -- error: cannot depend on "B" (wrong categorization)
> package C is
> pragma Pure;
> end C;
next prev parent reply other threads:[~2023-01-22 8:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-21 23:43 elab pragma placement Simon Belmont
2023-01-22 8:15 ` Luke A. Guest [this message]
2023-01-22 9:55 ` AdaMagica
2023-01-22 23:14 ` Rod Kay
2023-01-22 23:18 ` Rod Kay
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox