gcc/testsuite/gnat.dg/derived_type4.adb
raw| 1 | -- { dg-do compile } |
| 2 | |
| 3 | procedure Derived_Type4 is |
| 4 | |
| 5 | type Root (D : Positive) is record |
| 6 | S : String (1 .. D); |
| 7 | end record; |
| 8 | |
| 9 | subtype Short is Positive range 1 .. 10; |
| 10 | type Derived (N : Short := 1) is new Root (D => N); |
| 11 | |
| 12 | Obj : Derived; |
| 13 | |
| 14 | begin |
| 15 | Obj := (N => 5, S => "Hello"); |
| 16 | end; |