bug report

Mike Stump mrs@wrs.com
Mon Nov 23 14:45:00 GMT 1998


> Date: Fri, 20 Nov 1998 00:41:21 -0500
> From: Michael Lee <leemich@ms.com>
> To: egcs-bugs@cygnus.com

> version:  egcs-2.91.57
> system: SunOS 5.6 Generic_105182-06 i86pc i386

>     Base* dp = new Derived();

>     cout << reinterpret_cast<Derived*>(dp)->status() << endl;

> $ g++ t.cc
> $ a.out
> Segmentation Fault (core dumped)

This isn't a bug.  This behaves exactly the way a C++ compiler should.
Maybe you want to use another type of cast, like maybe static_cast?



More information about the Gcc-bugs mailing list