This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10635: ICE (segfault) when dereferencing an incomplete type casted from a void pointer
- From: giovannibajo at libero dot it
- To: Shea dot Williams at colorado dot edu, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 6 May 2003 10:43:57 -0000
- Subject: Re: c++/10635: ICE (segfault) when dereferencing an incomplete type casted from a void pointer
- Reply-to: giovannibajo at libero dot it, Shea dot Williams at colorado dot edu, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: g++ seg faluts on compile command
New Synopsis: ICE (segfault) when dereferencing an incomplete type casted from a void pointer
State-Changed-From-To: open->analyzed
State-Changed-By: bajo
State-Changed-When: Tue May 6 10:43:57 2003
State-Changed-Why:
Confirmed, it ICEs 3.3 CVS 20030503 and 3.4 CVS 20030503.
------------------------------------------------------
struct INCOMPLETE;
void* foo(void);
struct Foo
{
void get_incomplete(INCOMPLETE );
void bar(void)
{
get_incomplete((INCOMPLETE) *((INCOMPLETE*)foo()));
}
};
------------------------------------------------------
pr10635.cpp: In member function `void Foo::bar()':
pr10635.cpp:11: internal compiler error: Segmentation fault
The code is illegal because it is trying to use an
incomplete type (in the original code: QDateTime was not
yet defined when TimeLabel::qt_invoke() is compiled,
probably it's just a matter of including one more header).
Not a regression: 2.95 had an accept-illegal on this, so
it's slightly better now, the code is rejected (even if not
gracefully).
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10635