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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fe3c0be7cdbdeea3 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Definition of "aliased" Date: 1998/10/26 Message-ID: #1/1 X-Deja-AN: 405233394 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-10-26T00:00:00+00:00 List-Id: Matthew Heaney (matthew_heaney@acm.org) wrote: : What is the definition of "aliased"? I thought : --per RM95 3.10 (9)-- that the "current instance" of a limited type was : defined to be aliased. : Yet when I try to compile this code fragment... You seem to have run into a compiler bug. Our Ada 95 front end has no problem with the following code. : package P is : type T is tagged limited private; : private : function Op (O : access T) return Integer; : type T is : tagged limited record : I : Integer := Op (T'Access); : end record; : end P; : with P; : procedure Test_P is : O : P.T; : begin : null; : end; : ...my compiler is telling me that : (start of message) : $ gnatmake test_p : gcc -c test_p.adb : p.ads:7:29: prefix of "Access" attribute must be aliased : gnatmake: "test_p.adb" compilation error : (end of message) : The behavior of function Op appears to be no different from Initialize : for a Controlled type. What's the difference? : I was trying to do some non-trivial default initialization for objects : of the type, without deriving from Controlled and overriding : Initialize. The latter approach seems like too heavy a solution. Perhaps it is time to file a bug report... (or experiment with additional compilers ;-). : Thanks, : Matt -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company