public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: redi@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Subject: c++/10481: Invalid use of non-static data member causes ICE. Date: Thu, 24 Apr 2003 13:16:00 -0000 [thread overview] Message-ID: <200304241314.h3ODEWk0086139@buffy.mintel.co.uk> (raw) >Number: 10481 >Category: c++ >Synopsis: Invalid use of non-static data member causes ICE. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-illegal-code >Submitter-Id: net >Arrival-Date: Thu Apr 24 13:16:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Jonathan Wakely >Release: 3.4 20030422 (experimental) >Organization: >Environment: System: FreeBSD buffy.mintel.co.uk 4.8-RC-20030314-JPSNAP FreeBSD 4.8-RC-20030314-JPSNAP #0: Mon Mar 17 13:41:48 GMT 2003 jason@buffy.mintel.co.uk:/usr/src/sys/compile/BUFFY i386 host: i386-unknown-freebsd4.8 build: i386-unknown-freebsd4.8 target: i386-unknown-freebsd4.8 configured with: /home/jw/src/cvs/gcc/configure --prefix=/home/jw --program-prefix=x --enable-languages=c,c++ : (reconfigured) /home/jw/src/cvs/gcc/configure --prefix=/home/jw/gcc33/ --enable-languages=c,c++ : (reconfigured) /home/jw/src/cvs/gcc/configure --prefix=/home/jw/gcc3/ --enable-languages=c,c++ >Description: If you compile the code below the first error in function f() correctly issues a diagnostic about invalid use of a non-static data member, but the second function, B::f() causes an ICE. The only difference is that one function is a class member. >How-To-Repeat: struct A { char a; }; struct B { void f(const A&) const; }; void f(const A& a) { unsigned s = sizeof(A::a); // ERROR -> diagnostic } void B::f(const A& a) const { unsigned s = sizeof(A::a); // ERROR -> ICE } >Fix: Don't write bad code. >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2003-04-24 13:16 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-04-24 13:16 redi [this message] 2003-04-24 13:46 Jonathan Wakely
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=200304241314.h3ODEWk0086139@buffy.mintel.co.uk \ --to=redi@gcc.gnu.org \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).