From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Definition of "aliased"
Date: 1998/10/26
Date: 1998-10-26T00:00:00+00:00 [thread overview]
Message-ID: <F1FzzC.MK8.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: m37lxo6pii.fsf@mheaney.ni.net
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
next prev parent reply other threads:[~1998-10-26 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-10-26 0:00 Definition of "aliased" Matthew Heaney
1998-10-26 0:00 ` Tucker Taft [this message]
1998-10-26 0:00 ` dennison
1998-10-26 0:00 ` Matthew Heaney
1998-10-27 0:00 ` dennison
1998-10-28 0:00 ` Robert I. Eachus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox