From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Initialization and Finalization of limited object "returned" by a function
Date: Thu, 11 Feb 2010 20:27:11 -0800 (PST)
Date: 2010-02-11T20:27:11-08:00 [thread overview]
Message-ID: <52234b80-70a7-4711-8d07-6921f4ab35ef@15g2000yqi.googlegroups.com> (raw)
In-Reply-To: fded7501-6a8b-4f6f-8213-bfd12e898472@15g2000yqa.googlegroups.com
Back here (I was busy at some intermediate things).
It seems to me, there is indeed a GNAT bug here, as this next sample
which solve the trouble shows. With G, initialization and finalization
are done just like I was expecting.
procedure G is
-- Variation from G : the protected
-- type is wrapped in a limited record
-- which is handle the derivation of
-- the Limited_Type.
-- Observations : Entity is initialized
-- and Finalized as expected (like in A),
-- and its component of Protected_Type is
-- initialized before Entity is Initialized
-- (as expected) and Finalized after
-- Entity is Finalized (also as expected).
-- It seems to me (unless there are contradictory
-- interpretation of these observations), that
-- a bug is confirmed here, and the construct
-- provided here is a possible workaround.
package P is
type Limited_Type is limited interface;
subtype Limited_Class is Limited_Type'Class;
function New_Limited return Limited_Class;
end P;
package body P is
protected type Protected_Type is end;
protected body Protected_Type is end;
type Derived_Limited_Type is
limited new Limited_Type with
record
Wrapped_Protected_Item : Protected_Type;
end record;
function New_Derived return Derived_Limited_Type is
begin
return R : Derived_Limited_Type do
null;
end return;
end;
function New_Limited return Limited_Class is
begin
return R: Limited_Class := New_Derived do
null;
end return;
end;
end P;
Entity : P.Limited_Class := P.New_Limited;
begin
null;
end G;
next prev parent reply other threads:[~2010-02-12 4:27 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-11 4:37 Initialization and Finalization of limited object "returned" by a function Hibou57 (Yannick Duchêne)
2010-02-11 9:51 ` Hibou57 (Yannick Duchêne)
2010-02-11 11:00 ` Ludovic Brenta
2010-02-11 11:33 ` Jean-Pierre Rosen
2010-02-11 23:15 ` Hibou57 (Yannick Duchêne)
2010-02-11 23:24 ` Robert A Duff
2010-02-12 5:41 ` Hibou57 (Yannick Duchêne)
2010-02-12 15:15 ` Robert A Duff
2010-02-12 16:27 ` Jean-Pierre Rosen
2010-02-12 17:53 ` Jacob Sparre Andersen
2010-02-12 18:05 ` Adam Beneschan
2010-02-13 1:59 ` Randy Brukardt
2010-02-12 16:57 ` Adam Beneschan
2010-02-12 18:07 ` mockturtle
2010-02-12 18:29 ` Hibou57 (Yannick Duchêne)
2010-02-12 19:09 ` Robert A Duff
2010-02-13 2:00 ` Randy Brukardt
2010-02-13 2:51 ` Hibou57 (Yannick Duchêne)
2010-02-13 15:59 ` Robert A Duff
2010-02-13 19:34 ` Hibou57 (Yannick Duchêne)
2010-02-13 19:45 ` Robert A Duff
2010-02-12 19:10 ` (see below)
2010-02-13 9:54 ` Dmitry A. Kazakov
2010-02-13 15:52 ` (see below)
2010-02-14 10:23 ` Dmitry A. Kazakov
2010-02-13 15:53 ` Robert A Duff
2010-02-14 10:59 ` Dmitry A. Kazakov
2010-02-14 22:00 ` Hibou57 (Yannick Duchêne)
2010-02-11 15:16 ` Robert A Duff
2010-02-11 17:40 ` Adam Beneschan
2010-02-11 19:10 ` Robert A Duff
2010-02-11 21:51 ` Adam Beneschan
2010-02-11 22:49 ` Hibou57 (Yannick Duchêne)
2010-02-11 22:53 ` Hibou57 (Yannick Duchêne)
2010-02-11 23:08 ` Robert A Duff
2010-02-11 23:18 ` Hibou57 (Yannick Duchêne)
2010-02-12 0:48 ` Randy Brukardt
2010-02-12 5:37 ` Hibou57 (Yannick Duchêne)
2010-02-13 1:54 ` Randy Brukardt
2010-02-12 5:39 ` Hibou57 (Yannick Duchêne)
2010-02-12 15:10 ` Robert A Duff
2010-02-12 17:15 ` (Hibou57) Yannick Duchêne
2010-02-12 19:07 ` Robert A Duff
2010-02-12 1:05 ` Adam Beneschan
2010-02-12 2:35 ` Hibou57 (Yannick Duchêne)
2010-02-12 2:36 ` Hibou57 (Yannick Duchêne)
2010-02-12 2:36 ` Hibou57 (Yannick Duchêne)
2010-02-12 2:36 ` Hibou57 (Yannick Duchêne)
2010-02-12 2:37 ` Hibou57 (Yannick Duchêne)
2010-02-12 2:37 ` Hibou57 (Yannick Duchêne)
2010-02-12 2:37 ` Hibou57 (Yannick Duchêne)
2010-02-12 4:27 ` Hibou57 (Yannick Duchêne) [this message]
2010-02-12 4:28 ` Hibou57 (Yannick Duchêne)
2010-02-11 22:53 ` Robert A Duff
2010-02-11 23:41 ` Adam Beneschan
2010-02-12 0:22 ` Robert A Duff
2010-02-12 5:25 ` Hibou57 (Yannick Duchêne)
2010-02-12 9:27 ` Alex R. Mosteo
2010-02-12 16:43 ` Adam Beneschan
2010-02-12 19:11 ` Robert A Duff
2010-02-12 0:44 ` Randy Brukardt
2010-02-12 4:47 ` Hibou57 (Yannick Duchêne)
2010-02-12 18:02 ` Adam Beneschan
2010-02-12 4:49 ` Hibou57 (Yannick Duchêne)
2010-02-12 4:40 ` Hibou57 (Yannick Duchêne)
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox