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++/53225] static operator new in multiple inheritance carries incorrect type information for the class


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

--- Comment #3 from Thomas W. Lynch <dimitrisdad at gmail dot com> 2012-05-04 05:20:46 UTC ---
> I don't think this is valid as the memory which is done after the operator new
is considered as unitialized.

The code does not use any uninitialized memory.  It does not read the memory. 
However, it accesses the _type_  and the type exists before an instance of that
type is made.  

Part of the type information is the layout inside the class. The operator,
which has been copied into the child via inheritance,  i.e. the child's version
of the operator should be seeing the type of the child, not the type of the
parent.  The parent is irrelevant once its type is constructed - i.e. after the
inheritance operation - which occurs before any instances are instantiated.

-Thomas


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