This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53225] static operator new in multiple inheritance carries incorrect type information for the class
- From: "dimitrisdad at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 May 2012 05:20:46 +0000
- Subject: [Bug c++/53225] static operator new in multiple inheritance carries incorrect type information for the class
- Auto-submitted: auto-generated
- References: <bug-53225-4@http.gcc.gnu.org/bugzilla/>
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