procedure Main is
subtype str5 is string(1..5);
type s5_ptr is access all str5;
type T is
record
--current : access str5;
current : s5_ptr; -- "aliased actual has wrong accessibility"
foo : aliased str5;
end record;
The accessibility rules are far too complicated and unreadable (I'm not about trying to grock them), but the component current has a type that has a lifetime as long as Main. Your object o may be declared in an inner scope with less lifetime. Thus theassignment must be illegal.
I'm trying to learn the 2012 changes to accessibility rules, ......
Does anyone know off hand which is the correct behavior?
function F (y : aliased in out str5) return access str5 is
begin
return y'Access;
end F;
procedure P (x : in out T) is
begin
x.current := F(x.foo);
end P;
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 376 |
Nodes: | 16 (2 / 14) |
Uptime: | 26:56:23 |
Calls: | 8,036 |
Files: | 13,034 |
Messages: | 5,829,414 |