--  B2028: a general access value that could outlive, alias or free what it designates.
with Ada.Unchecked_Deallocation;
procedure Main is
   type Cell is record
      Value : Integer := 0;
   end record;
   type Cell_Ref is access all Cell;
   procedure Free is new Ada.Unchecked_Deallocation (Cell, Cell_Ref);

   Plain : Cell;
   R : Cell_Ref;

   procedure Inner is
      Local : aliased Cell;
      Fresh : Cell_Ref := new Cell;
   begin
      R := Local'Access;
      Free (Fresh);
   end Inner;
begin
   R := Plain'Access;
   Inner;
end Main;
