gcc/testsuite/gnat.dg/limited1_inner.adb
raw| 1 | package body Limited1_Inner is |
| 2 | overriding procedure Finalize (X : in out Limited_Type) is |
| 3 | begin |
| 4 | if X.Self /= X'Unrestricted_Access then |
| 5 | raise Program_Error with "Copied!"; |
| 6 | end if; |
| 7 | end; |
| 8 | |
| 9 | function Make_Inner return Inner_Type is |
| 10 | begin |
| 11 | return Inner : Inner_Type (True) do |
| 12 | null; |
| 13 | end return; |
| 14 | end; |
| 15 | end; |