blob: 102ab59874c5095983094d6b18976ea79b1cc0e5 [file] [log] [blame]
Ted Kremenek6c07bdb2009-06-26 00:05:51 +00001// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
Zhongxing Xu20f01782008-11-24 02:19:49 +00002
3char f1() {
4 char* s = "abcd";
Ted Kremenekf9e96842009-01-22 20:36:33 +00005 char c = s[4]; // no-warning
Zhongxing Xu58e689f2009-11-11 12:33:27 +00006 return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
Zhongxing Xu20f01782008-11-24 02:19:49 +00007}