gcc/testsuite/gnat.dg/prot2_pkg2.adb
raw| 1 | with Unchecked_Deallocation; |
| 2 | |
| 3 | package body Prot2_Pkg2 is |
| 4 | |
| 5 | protected type Rec is |
| 6 | private |
| 7 | M : T; |
| 8 | end Rec; |
| 9 | |
| 10 | protected body Rec is end; |
| 11 | |
| 12 | procedure Create (B : out Id) is |
| 13 | begin |
| 14 | B := new Rec; |
| 15 | end; |
| 16 | |
| 17 | procedure Delete (B : in out Id) is |
| 18 | procedure Free is new Unchecked_Deallocation(Object => Rec, Name => Id); |
| 19 | begin |
| 20 | Free (B); |
| 21 | end; |
| 22 | |
| 23 | end Prot2_Pkg2; |