Debian Codegraph @

gcc/testsuite/gnat.dg/specs/opt5.ads

raw
1 -- { dg-do compile }
2 -- { dg-options "-O2 -gnata -gnatVa" }
3
4 with Opt5_Pkg;
5
6 package Opt5 is
7
8 type Object is new Opt5_Pkg.Object with private;
9
10 Undefined : constant Object;
11
12 overriding function Is_Defined (Self : Object) return Boolean;
13
14 function Create (Sloc : Opt5_Pkg.Object) return Integer is (0)
15 with Pre => Sloc.Is_Defined;
16
17 private
18
19 type Object is new Opt5_Pkg.Object with null record;
20
21 Undefined : constant Object := (Opt5_Pkg.Undefined with others => <>);
22
23 overriding function Is_Defined (Self : Object) return Boolean is (Self /= Undefined);
24
25 end Opt5;