This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/29286] [4.0/4.1/4.2 Regression] placement new does not change the dynamic type as it should
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2006 23:44:07 -0000
- Subject: [Bug libstdc++/29286] [4.0/4.1/4.2 Regression] placement new does not change the dynamic type as it should
- References: <bug-29286-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #21 from ian at airs dot com 2006-10-03 23:44 -------
In C a general allocation function should work with a char array. A specific
allocation function should use a union. I don't think there are many existing
exceptions to these guidelines.
I think that code like that in PR 29272, which casts Node* to void* to Foo*, is
an unusual case. And I believe we can handle that code correctly because of
the use of memcpy. And if the code didn't use memcpy it would be clearly
noncomformant--which isn't to say that we should deliberately break it, but we
don't need to try extra hard to make it work.
So I don't see a serious problem in C either. Am I missing something/
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286