This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52767] New: Default inits for structs in struct initializer lists: wrong "this" pointer
- From: "shatrov at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Mar 2012 11:51:13 +0000
- Subject: [Bug c++/52767] New: Default inits for structs in struct initializer lists: wrong "this" pointer
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52767
Bug #: 52767
Summary: Default inits for structs in struct initializer lists:
wrong "this" pointer
Classification: Unclassified
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: shatrov@gmail.com
Created attachment 27031
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27031
test case
Test case attached.
I see output like this:
$ ./a.out
0x7fff81c36e40 A()
&c: 0x7fff81c36e30
sizeof (c): 8
Should be: 0x7fff81c36e34 A()
I.e., offset to "A b" inside struct B should be 4, not 16.
$ g++ --version
g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
$ uname -mpi
x86_64 x86_64 x86_64