gcc/testsuite/gnat.dg/specs/pack13.ads
raw| 1 | -- { dg-do compile } |
| 2 | |
| 3 | package Pack13 is |
| 4 | |
| 5 | generic |
| 6 | type Value_Type is private; |
| 7 | Value : in out Value_Type; |
| 8 | package G is end G; |
| 9 | |
| 10 | type Rec is record |
| 11 | B : Boolean; |
| 12 | end record; |
| 13 | for Rec use record |
| 14 | B at 0 range 8 .. 8; |
| 15 | end record; |
| 16 | for Rec'size use 9; |
| 17 | |
| 18 | type Arr is array (Boolean) of Rec; |
| 19 | pragma Pack (Arr); |
| 20 | |
| 21 | A : Arr; |
| 22 | |
| 23 | package My_G is new G (Boolean, A(True).B); -- { dg-warning "\"A\" may be referenced before it has a value" } |
| 24 | |
| 25 | end Pack13; |