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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f494beedc5085953,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!27g2000hsf.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Obtaining access to protected object Date: Tue, 8 Jul 2008 13:41:49 -0700 (PDT) Organization: http://groups.google.com Message-ID: <72741a06-d96c-4f53-a80b-3595c513efa1@27g2000hsf.googlegroups.com> NNTP-Posting-Host: 85.3.242.226 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1215549709 17256 127.0.0.1 (8 Jul 2008 20:41:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Jul 2008 20:41:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 27g2000hsf.googlegroups.com; posting-host=85.3.242.226; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061004 Firefox/3.0,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1040 Date: 2008-07-08T13:41:49-07:00 List-Id: 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? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com