summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/class_wide1.adb
blob: ba6fea032934c110f1df93a80b3e04c9b13ec8c1 (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
-- { dg-do compile }

procedure Class_Wide1 is
    package P is
       type T is tagged null record;
       procedure P1 (x : T'Class);
       procedure P2 (x : access T'Class);
    end P;
    package body P is
        procedure P1 (x : T'Class) is 
       begin 
          null;
       end;
       procedure P2 (x : access T'Class) is
       begin
          null;
       end;
    end P;
    use P;
    a : T;
    type Ptr is access T;
    b : Ptr := new T;
begin
    A.P1;
    B.P2;
end;