2 package body Old_Errors
is
7 (X
: Integer := A
'Old) -- { dg-error "can only appear within subprogram" }
13 procedure P
(I
: in Integer; O
: out Integer; IO
: in out Integer) is
16 (X
: Integer := Y
'Old) -- { dg-error "cannot refer to local variable" }
22 function H
(X
: Integer := A
'Old) return Integer is -- OK
28 Y
:= Y
'Old; -- { dg-error "cannot refer to local variable" }
34 IL
:= IL
'Old; -- { dg-error "cannot refer to local variable" }
38 Y
:= Z
'Old; -- { dg-error "cannot refer to local variable" }
40 Y
:= I
'Old; -- { dg-warning "Old applied to constant has no effect" }
43 Y
:= G
; -- OK, error has been signalled at G declaration
44 pragma Assert
(G
(3)'Old = Y
); -- { dg-error "cannot refer to local variable" }