This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51563] dynamic_cast bug
- From: "gausszhch at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Dec 2011 10:21:21 +0000
- Subject: [Bug c++/51563] dynamic_cast bug
- Auto-submitted: auto-generated
- References: <bug-51563-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51563
--- Comment #3 from gausszhch at gmail dot com 2011-12-15 10:21:21 UTC ---
What does EDG stand for?
Besides, why does dynamic_cast<D2*>(pd1) success but dynamic_cast<D1*>(pd2)
fail?
Here, D1 and D2 are symmetrical in the hierarchy graph. I think they can be
cast to each other according to the ISO/IEC 14882:2003. It is said that
" dynamic_cast<T>(v)
...
if v points (refers) to a public base class sub-object of the most derived
object, and the type of the most derived object has a base class, of type T,
that is unambiguous and public, the result is a pointer (an lvalue referring)
to the T sub-object of the most derived object.
"
(In reply to comment #1)
> A real C++ compiler based on EDG agrees with GCC.