| // RUN: %clang_cc1 -Wfree-nonheap-object -fsyntax-only -verify %s |
| typedef __SIZE_TYPE__ size_t; |
| free(&GI); // expected-warning {{attempt to call free on non-heap object 'GI'}} |
| free(&SI); // expected-warning {{attempt to call free on non-heap object 'SI'}} |
| free(&I); // expected-warning {{attempt to call free on non-heap object 'I'}} |
| free(P); // FIXME diagnosing this would require control flow analysis. |
| free(A); // expected-warning {{attempt to call free on non-heap object 'A'}} |
| free(&A); // expected-warning {{attempt to call free on non-heap object 'A'}} |
| free(&s.I); // expected-warning {{attempt to call free on non-heap object 'I'}} |