From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f494beedc5085953 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!m45g2000hsb.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Obtaining access to protected object Date: Wed, 9 Jul 2008 08:03:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: <247f4dc5-44d8-4618-9fdf-140286ac8d0e@m45g2000hsb.googlegroups.com> References: <72741a06-d96c-4f53-a80b-3595c513efa1@27g2000hsf.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1215615839 27433 127.0.0.1 (9 Jul 2008 15:03:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 9 Jul 2008 15:03:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m45g2000hsb.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1047 Date: 2008-07-09T08:03:59-07:00 List-Id: On Jul 8, 1:41 pm, Maciej Sobczak 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