1-- { dg-do compile }
2-- { dg-options "-O -gnatn" }
3
4package body Atomic4 is
5
6   procedure Next (Self : in out Reader'Class) is
7   begin
8      Self.Current_Reference := Self.Reference_Stack.Last_Element;
9      Self.Reference_Stack.Delete_Last;
10   end Next;
11
12end Atomic4;
13