This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/57599] g++ accepts invalid dynamic_cast of a const type to a regular type


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57599

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The summary is very misleading. You're not casting a const type to a non-const
type, you're casting a non-const type to a const type, then assigning that to a
non-const type.

What actually happens is that dynamic_cast<const A*>(b) returns A*


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]