From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Definition of "aliased"
Date: 1998/10/26
Date: 1998-10-26T00:00:00+00:00 [thread overview]
Message-ID: <m37lxo6pii.fsf@mheaney.ni.net> (raw)
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...
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.
Thanks,
Matt
next 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 Matthew Heaney [this message]
1998-10-26 0:00 ` Definition of "aliased" dennison
1998-10-26 0:00 ` Matthew Heaney
1998-10-27 0:00 ` dennison
1998-10-28 0:00 ` Robert I. Eachus
1998-10-26 0:00 ` Tucker Taft
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox