c++: constrained lambda error-recovery [PR108972]
[official-gcc.git] / gcc / testsuite / gnat.dg / slice3.adb
blobdb568f99740de1a5a66dd0d2a271d7780ca0edd9
1 -- { dg-do run }
3 procedure Slice3 is
5 type Varray is array (1 .. 1) of Natural; -- SImode
7 type Sample is record
8 Maybe : Boolean;
9 Values : Varray;
10 end record;
11 pragma Pack (Sample);
13 function Match (X, Y: Sample; Length : Positive) return Boolean is
14 begin
15 return X.Values (1 .. Length) = Y.Values (1 .. Length);
16 end;
18 X, Y : Sample := (Maybe => True, Values => (1 => 1));
19 begin
20 X.Maybe := False;
21 if not Match (X, Y, 1) then
22 raise Program_Error;
23 end if;
24 end;