blob: e137873955bc3369ca83c33e7aa87728fa554472 [file] [log] [blame]
static int *a = &(int){ 1 }; // OK
static int *b = &(int){ *a }; // KO
static void foo(void)
{
int *b = &(int){ 1 }; // OK
int *c = &(int){ *a }; // OK
static int *d = &(int){ 1 }; // KO
}
/*
* check-name: constexpr compound literal address
* check-command: sparse -Wconstexpr-not-const $file
*
* check-error-start
constexpr-compound-literal.c:2:25: warning: non-constant initializer for static object
constexpr-compound-literal.c:8:27: warning: non-constant initializer for static object
* check-error-end
*/