From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31146 invoked by alias); 3 Oct 2006 23:44:15 -0000 Received: (qmail 31111 invoked by uid 48); 3 Oct 2006 23:44:07 -0000 Date: Tue, 03 Oct 2006 23:44:00 -0000 Message-ID: <20061003234407.31110.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/29286] [4.0/4.1/4.2 Regression] placement new does not change the dynamic type as it should In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ian at airs dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-10/txt/msg00293.txt.bz2 List-Id: ------- 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