gcc/testsuite/gnat.dg/type_conv2.adb
raw| 1 | -- { dg-do compile } |
| 2 | |
| 3 | package body Type_Conv2 is |
| 4 | |
| 5 | function Wrap (X : Integer) return Root'Class is |
| 6 | begin |
| 7 | return Der_I'(X => X); |
| 8 | end Wrap; |
| 9 | |
| 10 | procedure Proc_Static is |
| 11 | D : constant Der_I := Der_I (Wrap (0)); -- { dg-error "initialization of limited object requires aggregate or function call" } |
| 12 | begin |
| 13 | null; |
| 14 | end Proc_Static; |
| 15 | |
| 16 | end Type_Conv2; |