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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,195bd8ec4227e968 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-13 16:24:14 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: adam@irvine.com (Adam Beneschan) Newsgroups: comp.lang.ada Subject: Re: [Q] non-limited record and "self-pointer" Date: 13 Feb 2004 16:24:14 -0800 Organization: http://groups.google.com Message-ID: References: <86d68pl0tc.fsf@sonnenregen.at.home> NNTP-Posting-Host: 66.126.103.122 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1076718254 16676 127.0.0.1 (14 Feb 2004 00:24:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 14 Feb 2004 00:24:14 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:5554 Date: 2004-02-13T16:24:14-08:00 List-Id: "Robert I. Eachus" wrote in message news:... > Stephen Leake wrote: > > > > This definitely looks like a compiler bug. Perhaps because Container > > is tagged, Read_Only_Set is being labeled "aliased". But that's not in > > the ARM. > > I don't see that. 3.10(9) says in part: "Finally, the current instance > of a limited type, and a formal parameter or generic formal object of a > tagged type are defined to be aliased." > > Note that this applies to parameters, not to objects. So a type > definition can include a self reference as in the example, and the > compiler should only object if you declare an object of the type that is > not aliased. However, the AARM says: "Ramification: The current instance of a nonlimited type is not aliased." It doesn't say "The current instance of a nonlimited type is either aliased or not aliased depending on whether an object of that type is aliased or not". So that would indicate to me, at least according to the AARM (which I realize is not part of the standard but may indicate how the standard is intended to be interpreted, maybe), that the type declaration is illegal. See also AI95-00225 (Amendment 200Y), which uses the term "if and only if" to make it clear that the current instance is not aliased and thus 'Access and 'Unchecked_Access cannot be used on it. -- Adam