blob: a9e045b4af533c578402ed1cdd1b6cce70abdf0d [file] [log] [blame]
Ted Kremenek722398f2012-08-24 20:39:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core.SizeofPtr -verify %s
Zhongxing Xu0f92ec62009-11-09 02:28:12 +00002
3struct s {
4};
5
6int f(struct s *p) {
Ted Kremenek9bf9af92012-08-16 17:45:23 +00007 return sizeof(p); // expected-warning{{The code calls sizeof() on a pointer type. This can produce an unexpected result}}
Zhongxing Xu0f92ec62009-11-09 02:28:12 +00008}