------- Comment #2 from redhatter at gentoo dot org 2009-11-03 05:45 ------- Also confirmed on GCC 3.4.5 as distributed with Qt SDK:
ezec...@toshiba /tmp $ /c/Qt/2009.03/mingw/bin/gcc --version gcc.exe (GCC) 3.4.5 (mingw-vista special r3) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ezec...@toshiba /tmp $ cat test.c struct A { const int x; int y; }; union U { const int x; struct A a; }; ezec...@toshiba /tmp $ gcc -o test-c.o -c test.c ezec...@toshiba /tmp $ echo $? 0 ezec...@toshiba /tmp $ g++ -o test-cpp.o -c test.c test.c:8: error: member `A U::a' with copy assignment operator not allowed in union ezec...@toshiba /tmp $ echo $? 1 Is there a sane workaround for this? -- redhatter at gentoo dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |redhatter at gentoo dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39934