From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17310 invoked by alias); 27 Apr 2003 17:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17286 invoked by uid 71); 27 Apr 2003 17:36:01 -0000 Resent-Date: 27 Apr 2003 17:36:01 -0000 Resent-Message-ID: <20030427173601.17285.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Andreas Oberritter Received: (qmail 15966 invoked from network); 27 Apr 2003 17:31:07 -0000 Received: from unknown (HELO smtp.bsws.de) (213.128.133.139) by sources.redhat.com with SMTP; 27 Apr 2003 17:31:07 -0000 Received: (qmail 4041 invoked from network); 27 Apr 2003 17:31:05 -0000 Received: from dsl-213-023-227-053.arcor-ip.net (HELO [192.168.2.95]) ([smtpauth]oberritter@[213.23.227.53]) (envelope-sender ) by smtp.bsws.de (qmail-ldap-1.03) with RC4-MD5 encrypted SMTP for ; 27 Apr 2003 17:31:05 -0000 Message-Id: <1051464625.1871.5.camel@localhost> Date: Sun, 27 Apr 2003 17:36:00 -0000 From: Andreas Oberritter To: gcc-gnats@gcc.gnu.org Cc: debian-gcc@lists.debian.org Subject: c++/10515: g++ 3.3 mixes up types when an initialized field in a union is not the first one X-SW-Source: 2003-04/txt/msg01212.txt.bz2 List-Id: >Number: 10515 >Category: c++ >Synopsis: g++ 3.3 mixes up types when an initialized field in a union >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Sun Apr 27 17:36:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Andreas Oberritter >Release: 3.3 20030415 (Debian prerelease) (Debian testing/unstable) >Organization: >Environment: System: Linux shiva 2.4.20-ac2 #1 Sun Jan 5 10:47:07 CET 2003 i686 unknown unknown GNU/Linux Architecture: i686 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux >Description: g++ 3.3 treats members of a union as if they were of the first member's type. g++ 3.2 and gcc 3.3 can compile it. >How-To-Repeat: struct a { int x; }; struct b { int x; int y; }; struct foo { union { struct a a; struct b b; } u; }; int main(void) { struct foo bar = { u: { b: { x: 0, y: 0, }}}; (void)bar; return 0; } $ CXXFLAGS="" CPPFLAGS="" g++-3.3 union_bug.cpp -o union_bug union_bug.cpp: In function `int main()': union_bug.cpp:20: error: too many initializers for `a' >Fix: >Release-Note: >Audit-Trail: >Unformatted: is not the first one