https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102295
Bug ID: 102295
Summary: ELF symbol sizes for variable-length objects are too
small (C++)
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Like PR 63373 but this one is for C++ (since the C front-end has been fixed
since GCC 5), GCC's C++ front-end only started to accept this in GCC 6 too.
Take:
struct blah
{
float foo;
int i[];
};
struct blah b = { 42.0, { 1, 2, 3, 4, 0 } };
------ CUT ----
GCC's C++ front-end outputs:
.size b, 4
Which is wrong, it should be 24.