comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Belmont <sbelmont700@gmail.com>
Subject: elab pragma placement
Date: Sat, 21 Jan 2023 15:43:32 -0800 (PST)	[thread overview]
Message-ID: <7f9d3951-fbf3-469a-ae4f-a74de26771b1n@googlegroups.com> (raw)

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, 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;

             reply	other threads:[~2023-01-21 23:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21 23:43 Simon Belmont [this message]
2023-01-22  8:15 ` elab pragma placement Luke A. Guest
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