From: Adam Beneschan <adam@irvine.com>
Subject: Re: Obtaining access to protected object
Date: Wed, 9 Jul 2008 08:03:59 -0700 (PDT)
Date: 2008-07-09T08:03:59-07:00 [thread overview]
Message-ID: <247f4dc5-44d8-4618-9fdf-140286ac8d0e@m45g2000hsb.googlegroups.com> (raw)
In-Reply-To: 72741a06-d96c-4f53-a80b-3595c513efa1@27g2000hsf.googlegroups.com
On Jul 8, 1:41 pm, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> Consider 9.4-21/2:
>
> "Within the declaration or body of a protected unit other than in an
> access_definition, the name of the protected unit denotes the current
> instance of the unit"
>
> I understand that this allows me to obtain the access to the current
> object (the "this" access) of the protected object.
> Let's try:
>
> protected type P is
> procedure Foo;
> end P;
>
> protected body P is
> procedure Foo is
> Ptr : access P; -- P denotes the type P
> begin
> Ptr := P'Access; -- here P denotes the "this" instance of
> P
> end;
> end P;
>
> This is what GNAT has to say about it: ""Access" attribute cannot be
> applied to type".
> As far as I understand, this is in conflict with the AARM paragraph
> mentioned above.
>
> Am I doing something wrong or is it a compiler bug?
It's a compiler bug.
-- Adam
next prev parent reply other threads:[~2008-07-09 15:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 20:41 Obtaining access to protected object Maciej Sobczak
2008-07-09 15:03 ` Adam Beneschan [this message]
2008-07-09 21:21 ` Maciej Sobczak
2008-07-09 21:57 ` Adam Beneschan
2008-07-09 22:01 ` Georg Bauhaus
2008-07-10 0:39 ` Randy Brukardt
2008-07-09 15:33 ` george.priv
2008-07-09 19:27 ` Adam Beneschan
2008-07-10 2:10 ` george.priv
2008-07-10 14:46 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox