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/4.3 Regression] placement new does not change the dynamic type as it should
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Oct 2006 06:53:25 -0000
- Subject: [Bug libstdc++/29286] [4.0/4.1/4.2/4.3 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 #24 from gdr at integrable-solutions dot net 2006-10-24 06:53 -------
Subject: Re: [4.0/4.1/4.2 Regression] placement new does not change the
dynamic type as it should
"mark at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Comment #22 from mark at codesourcery dot com 2006-10-04 05:39
-------
| Subject: Re: [4.0/4.1/4.2 Regression] placement new
| does not change the dynamic type as it should
|
| ian at airs dot com wrote:
| > ------- 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.
|
| > So I don't see a serious problem in C either. Am I missing something/
|
| I think there are two remaining issues:
|
| int i;
| *(float*)(&i) = 7.0;
|
| IIUC, Mike's position is that this is valid -- and that, in fact, after
| this point "i" can no longer be accessed as an int. Do you agree?
I don't see how that code is supported by the paragraphs quoted by Mike.
There was a recent discussion (at most two weeks ago) on the C++
standard reflector -core about similar topic. I do agree with Mark
that the proper way to resolve this is to go to the C++ committee.
It would be incredible that C++ was less type-strict than C.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286