Version 1.2 of ai05s/ai05-0253-1.txt

Unformatted version of ai05s/ai05-0253-1.txt version 1.2
Other versions for file ai05s/ai05-0253-1.txt

!standard 3.10.2(13.2/3)          11-06-16 AI05-0253-1/01
!class Amendment 11-06-16
!status work item 11-06-16
!status received 11-05-13
!priority Low
!difficulty Medium
!subject Accessibility of allocators for anonymous access of an object
!summary
**TBD.
!question
Consider the following two allocators
declare X : access Designated := new Designated; begin X := Some_Global_Variable'access; X := new Designated;
It seems clear that the accessibility level of the allocated objects should be that of X (just as it was in Ada05), but that's not what the current wording of the Standard says.
It appears to say that the accessibility level of each allocated object is that of X's anonymous access type, which is determined by the value most recently assigned to X (which is well-defined but silly for the second allocator above and not even well-defined for the first allocator).
Should this be changed? (Yes.)
!proposal
(See wording.)
!wording
** TBD.
!discussion
!ACATS test
** TBD.
!appendix

From: Steve Baird
Sent: Friday, May 13, 2011  12:37 AM

Consider the following two allocators

   declare
     X : access Designated := new Designated;
   begin
     X := Some_Global_Variable'Access;
     X := new Designated;

It seems clear that the accessibility level of the allocated objects *should* be
that of X (just as it was in Ada05), but that's not how I read the current RM
wording.

It appears to say that the accessibility level of each allocated object is that
of X's anonymous access type, which is determined by the value most recently
assigned to X (which is well-defined but silly for the second allocator above
and not even well-defined for the first allocator).

Is there general agreement that the current RM wording needs fixing to preserve
Ada05's handling of the case of an allocator which is assigned to a stand-alone
object of an anonymous access type?

****************************************************************

From: Tucker Taft
Sent: Sunday, May 15, 2011 10:40 AM

Yes, I agree the level of an anonymous allocator in this context should remain
local.

****************************************************************



Questions? Ask the ACAA Technical Agent