The follow code incorrectly fails to compile with G++ 2.96-78: #include <string> struct AStruct { union { int a; }; std::string str; }; AStruct global; void Foo (const AStruct & other) { global = other; } The error is: temp.cc: In method `AStruct &AStruct::operator= (const AStruct &)': temp.cc:7: `AStruct::{anonymous union} &AStruct::{anonymous union}::operator= (const AStruct::{anonymous union} &)' is inaccessible temp.cc:15: within this context
I've fixed this last thursday in CVS gcc, the fix will be included in gcc-c++-2.96-80.
Oh, just FYI, the patch is at http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01620.html