re PR c++/48035 (Mismatch on size of class when initializing hierarchy involving...
authorJakub Jelinek <jakub@redhat.com>
Fri, 11 Mar 2011 15:43:37 +0000 (16:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 11 Mar 2011 15:43:37 +0000 (16:43 +0100)
commite33eba75933fdd7bd895a3b35ef1b1b710ddbb13
tree646fcf3880fcf55f5b06c27e45a7d9a15287445c
parent4074f163fc39eedabb09f1ddcbd4c78bf55cb19b
re PR c++/48035 (Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes)

PR c++/48035
* init.c (build_zero_init_1): Extracted from build_zero_init.
Add FIELD_SIZE argument, if non-NULL and field bit_position
as not smaller than that, don't add that field's initializer.
Pass DECL_SIZE as last argument to build_zero_init_1
for DECL_FIELD_IS_BASE fields.
(build_zero_init): Use build_zero_init_1.

* g++.dg/inherit/virtual8.C: New test.

From-SVN: r170874
gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/inherit/virtual8.C [new file with mode: 0644]