https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88565
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Last reconfirmed| |2019-11-03 Resolution|FIXED |--- Ever confirmed|0 |1 --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- Actually, although the test case in comment #0 is diagnosed a few others that could be aren't. For example, since class Sx has a user-defined default ctor the flexible array member can't very well be used as such (there's no good way for the ctor to allocate memory for it and initialize it), and so either the declaration or the access to the array element should be diagnosed. Same for zero-length arrays and arrays of length one (accesses to those beyond element 0 are diagnosed at -Warray-bounds=2). struct Sx { Sx (); int f (); int n, a[]; }; int Sx::f () { return a[0]; // missing warning }