https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91462
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |10.0, 7.3.0
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=91463
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot
gnu.org
Target Milestone|8.4 |10.0
Summary|[8/9/10 Regression] missing |[8/9 Regression] missing
|-Warray-bounds writing to |-Warray-bounds writing to
|an empty flexible array |an empty flexible array
|member in a ctor |member in a ctor
Known to fail| |8.3.0, 9.2.0
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 10 diagnoses both instances as expected, possibly as a result of r277728.
Since that commit introduces warnings for code that was not diagnosed before I
don't think the policy allows it to be backported so adjusting Milestone to
10.0.
pr91462.C: In function ‘void g()’:
pr91462.C:5:14: warning: array subscript 0 is outside array bounds of ‘char
[0]’ [-Warray-bounds]
5 | A0 () { a[0] = 0; } // -Warray-bounds (good)
| ~~~^
pr91462.C:3:11: note: while referencing ‘A0::a’
3 | char n, a[0];
| ^
pr91462.C: In function ‘void h()’:
pr91462.C:20:14: warning: array subscript 0 is outside array bounds of ‘char
[]’ [-Warray-bounds]
20 | Ax () { a[0] = 0; } // missing -Warray-bounds
| ~~~^
pr91462.C:18:11: note: while referencing ‘Ax::a’
18 | char n, a[];
| ^