From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9432 invoked by alias); 3 Nov 2009 05:45:48 -0000 Received: (qmail 9364 invoked by uid 48); 3 Nov 2009 05:45:31 -0000 Date: Tue, 03 Nov 2009 05:45:00 -0000 Message-ID: <20091103054531.9363.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/39934] Union member incorrectly disallowed In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "redhatter at gentoo dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00138.txt.bz2 ------- 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: EzeCorp@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. EzeCorp@TOSHIBA /tmp $ cat test.c struct A { const int x; int y; }; union U { const int x; struct A a; }; EzeCorp@TOSHIBA /tmp $ gcc -o test-c.o -c test.c EzeCorp@TOSHIBA /tmp $ echo $? 0 EzeCorp@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 EzeCorp@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