3 void testUseMiddleArgAfterDelete(int *p
) {
5 f(p
); // warn: use after free
14 SomeClass
*c
= new SomeClass
;
16 c
->f(); // warn: use after free
20 int *p
= (int *)__builtin_alloca(sizeof(int));
21 delete p
; // warn: deleting memory allocated by alloca
27 delete p
; // warn: attempt to free released
32 delete &i
; // warn: delete address of local
38 // warn: argument to 'delete[]' is offset by 4 bytes
39 // from the start of memory allocated by 'new[]'