This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1689: dynamic_cast operator is wrong
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1689: dynamic_cast operator is wrong
- From: Jorgen dot Sigvardsson at kau dot se
- Date: 18 Jan 2001 09:12:00 -0000
- Reply-To: Jorgen dot Sigvardsson at kau dot se
>Number: 1689
>Category: c++
>Synopsis: dynamic_cast operator is wrong
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 18 01:16:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: ?
>Release: gcc version 2.95.2 20000220 (Debian GNU/Linux)
>Organization:
>Environment:
Debian GNU/Linux (Unstable)
>Description:
dynamic_cast does not allow me to do simple casts, which are to my knowledge allowed by the C++ language.
I have also been able to reproduce the error on http://www.codesourcery.com/gcc-compile.shtml where the compile output explicitly tells me that source type is not polymorphic. More on the actual problem in thw "How-To-Repeat" field.
I noticed this error in a larger project which I am working on. I am not sending you that source since it is quite big and because of the fact I can reproduce the error in just a few lines of code.
>How-To-Repeat:
Just compile this file with g++.
>Fix:
I don't have the slightest idea.. I would assume that some magic should be done to the type information management in the compiler ;-)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="tst.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="tst.cpp"
Y2xhc3MgQQp7Cn07CgpjbGFzcyBCIDogcHVibGljIHZpcnR1YWwgQQp7Cn07CgppbnQgbWFpbih2
b2lkKQp7CglBIGE7CglCKiBiOwoJYiA9IGR5bmFtaWNfY2FzdDxCKj4oJmEpOwoJcmV0dXJuIDA7
Cn0K