class A { public: int a[0]; }; int main() { A a; int size1 = sizeof(A); // == 0, should be nonzero int size2 = sizeof(a); // == 0, should be nonzero }
Since: ISO 14882-2003, 9 [Classes].3 Thanks, -- Summary: sizeof == 0 for empty class Product: gcc Version: 3.3.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jz201115 at zodiac dot mimuw dot edu dot pl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28820