outofbound.c revision ef74f4c6dcd59b3af1de9d8f613c1caf3e6cb63d
1// RUN: clang -cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
2
3char f1() {
4  char* s = "abcd";
5  char c = s[4]; // no-warning
6  return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
7}
8