This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28523] New: Throw of a derived class casted to its base class using a C-style cast
- From: "m dot faustino at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jul 2006 10:28:57 -0000
- Subject: [Bug c++/28523] New: Throw of a derived class casted to its base class using a C-style cast
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The compiler generates the error:
a.cpp: In function ‘int main()’:
a.cpp:6: internal compiler error: in stabilize_call, at cp/tree.c:2248
For this code:
class A {};
class B : public A {};
int main()
{
throw (A) B();
return 0;
}
Info:
gcc version 4.1.1
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1-src/configure
Thread model: posix
Command line:
g++ -Wall -ansi -pedantic a.cpp
--
Summary: Throw of a derived class casted to its base class using
a C-style cast
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: m dot faustino at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28523