struct A { const int x; int y; }; union U { const int x; A a; };
g++ 4.3.1 says... vvv.C:8: error: member `A U::a' with copy assignment operator not allowed in union As far as I can see, struct A does not have a copy assignment operator at all. Sun's Forte 12 is happy with the code for what that is worth. -- Summary: Union member incorrectly disallowed Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: terra at gnome dot org GCC host triplet: x86_64-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39934