param_key: fix container of when no struct member is referenced
[smatch.git] / validation / constexpr-compound-literal.c
blobe137873955bc3369ca83c33e7aa87728fa554472
1 static int *a = &(int){ 1 }; // OK
2 static int *b = &(int){ *a }; // KO
4 static void foo(void)
6 int *b = &(int){ 1 }; // OK
7 int *c = &(int){ *a }; // OK
8 static int *d = &(int){ 1 }; // KO
12 * check-name: constexpr compound literal address
13 * check-command: sparse -Wconstexpr-not-const $file
15 * check-error-start
16 constexpr-compound-literal.c:2:25: warning: non-constant initializer for static object
17 constexpr-compound-literal.c:8:27: warning: non-constant initializer for static object
18 * check-error-end