comp.lang.ada
 help / color / mirror / Atom feed
From: "Y.Tomino" <demoonlit@panathenaia.halfmoon.jp>
Subject: Pure, Storage_Size and Unchecked_Conversion
Date: Sat, 07 Jul 2007 17:24:15 -0700
Date: 2007-07-07T17:24:15-07:00	[thread overview]
Message-ID: <1183854255.792142.110150@i38g2000prf.googlegroups.com> (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




             reply	other threads:[~2007-07-08  0:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  0:24 Y.Tomino [this message]
2007-07-08  9:49 ` Pure, Storage_Size and Unchecked_Conversion 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
replies disabled

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