| // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s |
| int *p = (int *)sizeof(int); |
| return *p; // expected-warning {{Dereference of null pointer}} |
| int *p = (int *)sizeof(int); |
| return *p; // expected-warning {{Dereference of null pointer}} |
| int *p = (int *)sizeof(int); |
| return *p; // expected-warning {{Dereference of null pointer}} |
| // This is a special case where pointer arithmetic is not calculated to |
| // preserve useful warnings on dereferences of null pointers. |
| return *p; // expected-warning {{Dereference of null pointer}} |