This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/10481: Invalid use of non-static data member causes ICE.


>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 at buffy dot mintel dot co dot 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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]