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 c++/14827] Run time error, breaking of type info and static casts


------- Additional Comments From bangerth at dealii dot org  2004-04-02 23:30 -------
I can confirm this with all compiler up to and including mainline. And 
also with Intel's icc7. 
 
However, your code is invalid. When you cast to void*, the compiler 
loses track of where the Derived part of your SuperDerived object 
resides. Then, when you cast back from void*, the compiler has to 
assume that this cast does not need any pointer adjustment. There is 
simply no way the compiler can do what you want in view of this. You 
can't cast to void* and expect the compiler to work with this correctly. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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