This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18933] pointer-to-member called on incomplete type generates bad code
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Dec 2004 21:53:53 -0000
- Subject: [Bug c++/18933] pointer-to-member called on incomplete type generates bad code
- References: <20041210210120.18933.efrias@syncad.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-12-10 21:53 -------
The fact that we don't issue any errors is a duplicate of PR 15684. However,
the code is fundamentally broken in that you cast a pointer to B into a
pointer to A and use it to do something with it. This violates aliasing
constraints, and you shouldn't be surprised that your code does weird
things.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18933