------- Comment #179 from schaub-johannes at web dot de 2010-06-20 00:01 ------- (In reply to comment #158) > Subject: Re: [4.0/4.1/4.2/4.3 Regression] placement new does not change the > dynamic type as it should > > "rguenther at suse dot de" <gcc-bugzi...@gcc.gnu.org> writes: > > [...] > > | > Now, if I understand your argument below correctly, you are saying > | > that even if we fixed the union rules for C++, we may still be facing > | > the same problem because assignment to POD objects does not just mean > | > that the object was there before, but that we are actually starting a > | > new one. Do I understand your argument correctly? > | > | Yes. > > Then, I'm not sure I agree with that. I'll raise it as part of the > union problem. >
I'm sorry for commenting this late, but were there any outcomes of the discussion about changing the dynamic type by assignments for non-PODs (maybe on the reflector)? The way I see it, and how Richard may see it, is by 3.8/1 which says The lifetime of an object of type T begins when - storage with the proper alignment and size for type T is obtained The lifetime of an object of type T ends when - the storage which the object occupies is reused or released. This isn't specific to unions, but it never seems to define what constitutes a "reuse", but Richard seems to interpret this to include assignments and so do I, and i've always used this interpretation to explain the mechanism by which unions change their active member. -- schaub-johannes at web dot de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schaub-johannes at web dot | |de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286