• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=flat -Wno-null-dereference -verify %s
2 #define FAIL ((void)*(char*)0)
3 struct simple { int x; };
4 
PR7297()5 void PR7297 () {
6   struct simple a;
7   struct simple *p = &a;
8   p->x = 5;
9   if (!p[0].x) FAIL; // no-warning
10   if (p[0].x) FAIL; // expected-warning {{null}}
11 }
12