summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/access8_pkg.adb
blob: 9d7c9332b93382a0517c19c0e217ca3d8920be38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--  { dg-options "-gnatws" }

with Ada.Finalization;

package body Access8_Pkg is

   overriding procedure Initialize (O : in out Object) is
   begin
      null;
   end;

   overriding procedure Finalize (O : in out Object) is
   begin
      null;
   end;

   function Get return Object is
   begin
      return O : Object := Object'
        (Ada.Finalization.Limited_Controlled
          with D => new discriminant);
   end;

   function Get_Access return access Object is
   begin
      return new Object'
        (Ada.Finalization.Limited_Controlled
          with D => new Discriminant);
   end;
end;