comp.lang.ada
 help / color / mirror / Atom feed
* Pure, Storage_Size and Unchecked_Conversion
@ 2007-07-08  0:24 Y.Tomino
  2007-07-08  9:49 ` Georg Bauhaus
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Y.Tomino @ 2007-07-08  0:24 UTC (permalink / raw)


Hi.
I compiled the package like this with gcc 4.2.

with Ada.Unchecked_Conversion;
package Pure_SS_Unc is
   pragma Pure;
   type T is access Integer;
   for T'Storage_Size use 0;
   function F1 (X : Integer) return T;
   function F2 is new Ada.Unchecked_Conversion (Integer, T);
end Pure_SS_Unc;

Ada.Unchecked_Conversion is pure generic function.
I think the condition of F1 and F2 is the same.
but, I saw this message:

pure_ss_unc.ads:7:58: named access types not allowed in pure unit

   function F1 (X : Integer) return T; -- OK
   function F2 is new Ada.Unchecked_Conversion (Integer, T); -- NG

Why does compiler make an error at F2?

--
YT http://panathenaia.halfmoon.jp/alang/ada.html




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-07-15 17:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-08  0:24 Pure, Storage_Size and Unchecked_Conversion Y.Tomino
2007-07-08  9:49 ` Georg Bauhaus
2007-07-08 10:41   ` Y.Tomino
2007-07-08 16:08 ` Martin Krischik
2007-07-09 13:31   ` Y.Tomino
2007-07-09 21:31     ` Georg Bauhaus
2007-07-10  1:35 ` Randy Brukardt
2007-07-10  8:30   ` Georg Bauhaus
2007-07-15 17:30   ` Y.Tomino

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