comp.lang.ada
 help / color / mirror / Atom feed
From: ytomino <aghia05@gmail.com>
Subject: Re: Question about library-level functions
Date: Mon, 17 Dec 2012 18:26:51 -0800 (PST)
Date: 2012-12-17T18:26:51-08:00	[thread overview]
Message-ID: <9e0aa594-f136-4301-a942-5dee0ad2752b@googlegroups.com> (raw)
In-Reply-To: <1a56bd55-0e11-4a62-866f-51ebfcf01c88@googlegroups.com>

On Tuesday, December 18, 2012 4:49:41 AM UTC+9, Adam Beneschan wrote:
> There were some rule changes in Ada 2012 in 3.10.2 and 7.6.1, and I haven't yet studied them all.  But my initial reading is that since the anonymous access function result is converted to a named access type A, then the object that gets allocated should be finalized when A disappears, i.e. at the end of the block that declares A.  I could easily be wrong.
> 
> 
> 
>                         -- Adam

I'm reading that you pointed, now.

RM 3.10.2 (10.3/3) says "If the result is of an anonymous access type and is the operand of an explicit conversion, the master is that of the target type of the conversion;". The rule is just applicable to this case. This statement is added when Ada 2012.
Or, In Ada 2005 RM, (10/2) says "The accessibility level of an aggregate or the result of a function call (or equivalent use of an operator) that is used (in its entirety) to directly initialize part of an object is that of the object being initialized. In other contexts, the accessibility level of an aggregate or the result of a function call is that of the innermost master that evaluates the aggregate or function call. ". 
The innermost master or *function call* is probably in the block of type A.

I came to be sure that my understanding was wrong and it's a bug of the compiler.
Thanks.



  reply	other threads:[~2012-12-18  2:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15  3:38 Question about library-level functions ytomino
2012-12-15  9:47 ` AdaMagica
2012-12-15 10:50   ` ytomino
2012-12-15 11:38     ` AdaMagica
2012-12-17 19:49       ` Adam Beneschan
2012-12-18  2:26         ` ytomino [this message]
2012-12-15 15:23 ` sbelmont700
2012-12-16  6:09   ` ytomino
2012-12-16  9:43 ` Simon Wright
2012-12-16 10:21   ` AdaMagica
2012-12-16 13:07     ` ytomino
2012-12-16 18:31     ` Simon Wright
2012-12-18  3:18       ` ytomino
2012-12-18  0:07     ` Randy Brukardt
2012-12-16 13:34   ` ytomino
2012-12-16 15:54     ` AdaMagica
2012-12-18  0:09       ` Randy Brukardt
replies disabled

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