expressions: make assign_expression() take an op argument
[smatch.git] / validation / constexpr-offsetof.c
blobd1697b0c5cb789e9bd31dcb0eeaf7fc6b651b1f1
1 struct A {
2 int a[1];
3 int b;
4 };
6 extern int c;
8 static int o[] = {
9 [__builtin_offsetof(struct A, b)] = 0, // OK
10 [__builtin_offsetof(struct A, a[0])] = 0, // OK
11 [__builtin_offsetof(struct A, a[0*0])] = 0, // OK
12 [__builtin_offsetof(struct A, a[c])] = 0 // KO
16 * check-name: __builtin_offsetof() constness verification.
18 * check-error-start
19 constexpr-offsetof.c:12:39: error: bad constant expression
20 * check-error-end