The compiler issues errors about anonymous unions for the following code snippet although there's only an anonymous class:
============================ struct A { class { static int i; int j; }; }; ============================ bug.cc:5: error: 'int A::<anonymous class>::i' invalid; an anonymous union can only have non-static data members bug.cc:6: error: private member 'int A::<anonymous class>::j' in anonymous union It looks like the code in finish_struct_anon (cp/class.c) was copied from build_anon_union_vars (cp/decl2.c) without adjusting the messages. -- Summary: Bogus diagnostic for anonymous structs/classes Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30300