https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116284
Bug ID: 116284
Summary: incorrect classification of zero-sized array as
variably modified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: muecker at gwdg dot de
Target Milestone: ---
In the following example we can an error because 'd' is classified as variably
modified.
static int a[0];
static int b[sizeof a];
void foo(int (*x)[*]);
static int c[0];
static int d[sizeof c];
<source>:11:12: error: variably modified 'd' at file scope
11 | static int d[sizeof c];
https://godbolt.org/z/a8Ej6c5jr
Found by Alejandro Colomar.