| 1 |
-- { dg-do run } |
| 2 |
-- { dg-options "-gnatws" } |
| 3 |
|
| 4 |
with discr3; use discr3; |
| 5 |
with Text_IO; use Text_IO; |
| 6 |
procedure Conv_Bug is |
| 7 |
begin |
| 8 |
begin |
| 9 |
V2 := S2 (V1); |
| 10 |
exception |
| 11 |
when Constraint_Error => null; |
| 12 |
when others => Put_Line ("Wrong Exception raised"); |
| 13 |
end; |
| 14 |
|
| 15 |
begin |
| 16 |
V2 := S2(V1(V1'Range)); |
| 17 |
Put_Line ("No exception raised - 2"); |
| 18 |
exception |
| 19 |
when Constraint_Error => null; |
| 20 |
when others => Put_Line ("Wrong Exception raised"); |
| 21 |
end; |
| 22 |
|
| 23 |
begin |
| 24 |
V2 := S2 (V3); |
| 25 |
Put_Line ("No exception raised - 3"); |
| 26 |
exception |
| 27 |
when Constraint_Error => null; |
| 28 |
when others => Put_Line ("Wrong Exception raised"); |
| 29 |
end; |
| 30 |
end Conv_Bug; |