c++: constrained lambda error-recovery [PR108972]
[official-gcc.git] / gcc / testsuite / gnat.dg / not_null.adb
blob8f863d87437e60c5eca7d4f35727783b6a8ac234
1 -- { dg-do run }
3 procedure not_null is
4 type Not_Null_Int_Ptr is not null access all Integer;
6 generic
7 F : Not_Null_Int_Ptr := null;
8 package GPack is
9 end GPack;
11 begin
12 declare
13 pragma Warnings (Off, "*""null"" not allowed in null-excluding objects");
14 package Inst_2 is new GPack (null);
15 pragma Warnings (On, "*""null"" not allowed in null-excluding objects");
16 begin
17 null;
18 end;
19 exception
20 when Constraint_Error =>
21 null;
22 end not_null;