This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13064] New: getting address of a virtual base before its construction causes a crash
- From: "joseph at dkd dot lt" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Nov 2003 00:27:04 -0000
- Subject: [Bug c++/13064] New: getting address of a virtual base before its construction causes a crash
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program compiles but crashes at runtime.
=== test.cpp ===
struct A {};
struct B : virtual public A
{
B(A*) {}
};
struct C
{
C() : b(&b) {}
B b;
};
int main()
{
new C;
}
=========
Command line:
g++ -Wall test.cpp
--
Summary: getting address of a virtual base before its
construction causes a crash
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: joseph at dkd dot lt
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13064