This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should



------- Comment #148 from gdr at cs dot tamu dot edu  2007-05-23 23:50 -------
Subject: Re:  [4.0/4.1/4.2/4.3 Regression] placement new does not change the
dynamic type as it should

"mark at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| Gaby's claim, as I understand it, is that writing to a union member,
| even through a pointer, rather than directly through the union, is
| valid, and activates that part of the union.

Yes; that is what the current C++ standard says.  

C99 tried to fix things with the notion of effective type, but that
notion does not fully address the issue and it is not part of C++98
and C++03.  What I'm doing is making sure that we all know where
(potential existing codes) we are starting from and make sure that we
do understand the implications of the changes we would like to make to
make optimizers easier.  I spent some of my time this afternoon
going through this with the original inventor of C++ and trying to see
whether we have choice to make things less hard.  

It is clear to us that, *if* we have a choice -- note *if* we have a
choice -- when the aliasing through union should be made appearant;
but for the moment, that is hard to formulate correctly  and simply
(with the constraint of not breaking the existing object model
badly). 

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]