1 // RUN: %clang_cc1 -Wfree-nonheap-object -fsyntax-only -verify %s
3 typedef __SIZE_TYPE__
size_t;
15 free(&GI
); // expected-warning {{attempt to call free on non-heap object 'GI'}}
19 free(&SI
); // expected-warning {{attempt to call free on non-heap object 'SI'}}
23 free(&I
); // expected-warning {{attempt to call free on non-heap object 'I'}}
28 free(P
); // FIXME diagnosing this would require control flow analysis.
35 int A
[] = {0, 1, 2, 3};
36 free(A
); // expected-warning {{attempt to call free on non-heap object 'A'}}
37 free(&A
); // expected-warning {{attempt to call free on non-heap object 'A'}}
41 free(&s
.I
); // expected-warning {{attempt to call free on non-heap object 'I'}}