smatch_data/kernel.unreachable.ignore: add BUG(), WARN_ON() and others
[smatch.git] / validation / constexpr-addr-of-static-member.c
blobc2a74ac78b9e210ce4df84e3c51de7180dac1608
1 struct A {
2 int a;
3 int b[2];
4 };
6 struct B {
7 int c;
8 struct A d;
9 };
11 static struct B a= {1, {1, {1, 1}}};
13 static int *b = &a.d.a; // OK
14 static int *c = &(&a.d)->a; // OK
15 static int *d = a.d.b; // OK
16 static int *e = (&a.d)->b; // OK
17 static int *f = &a.d.b[1]; // OK
18 static int *g = &(&a.d)->b[1]; // OK
21 * check-name: constexpr static object's member address
22 * check-command: sparse -Wconstexpr-not-const $file
24 * check-error-start
25 * check-error-end