TITLE: Anonymous structs and unions RESPONSE: clamage@taumet.Eng.Sun.COM (Steve Clamage), 7 Jun 94 By "anonymous struct" (which DEC C allows, BTW) we usually mean a struct with no tag and no object or type declared: struct { ... } ; This violates the C rule that a declaration must declare a tag, object, or type, but we don't have that rule in C++. On the other hand, there is no way under C++ rules to access the members of the struct. Anonymous unions are allowed in C++, and we have explicit language** which explains how the member names are exported into the enclosing scope. There is no such language for structs. The original example looked something like struct outer { struct { // anonymous int i, j; }; } x; after which an expression like "x.i" apparently referred to the "i" member of the anonymous struct. This would be the case with an anonymous union, but the analagous situation with structs is not part of the ARM or the Working Paper. So the expression "x.i" should generate an error, as there is no "i" in the scope of "x", but only in an inaccessable inner scope. --- ** which is nothing compared to the explicit language heard when people argue about C++ language rules ...