diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-06 02:09:02 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-06 02:09:02 +0000 |
commit | 2bc7da70381f8e12129c1c470aee18ccaf465e0b (patch) | |
tree | e5a04b6dd5dab15766d0b02b4b48425818534909 /gcc/stor-layout.c | |
parent | d14c819e7e3a6da5fe3a553067fdbe60890b89e5 (diff) | |
download | linaro-gcc-2bc7da70381f8e12129c1c470aee18ccaf465e0b.tar.gz linaro-gcc-2bc7da70381f8e12129c1c470aee18ccaf465e0b.tar.bz2 linaro-gcc-2bc7da70381f8e12129c1c470aee18ccaf465e0b.zip |
PR c++/13983
PR c++/17519
* stor-layout.c (finish_record_layout): Copy TYPE_PACKED to variants.
* c-common.c (handle_packed_attribute): So don't copy it here.
* c-decl.c (finish_struct): Don't copy TYPE_ALIGN.
* cp/class.c (check_field_decls): Check TYPE_PACKED after
stripping array types.
(finish_struct_bits): Don't copy TYPE_SIZE here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115217 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 47bc6a047a7..76aa4ac73bb 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1465,6 +1465,8 @@ finalize_type_size (tree type) void finish_record_layout (record_layout_info rli, int free_p) { + tree variant; + /* Compute the final size. */ finalize_record_size (rli); @@ -1474,6 +1476,12 @@ finish_record_layout (record_layout_info rli, int free_p) /* Perform any last tweaks to the TYPE_SIZE, etc. */ finalize_type_size (rli->t); + /* Propagate TYPE_PACKED to variants. With C++ templates, + handle_packed_attribute is too early to do this. */ + for (variant = TYPE_NEXT_VARIANT (rli->t); variant; + variant = TYPE_NEXT_VARIANT (variant)) + TYPE_PACKED (variant) = TYPE_PACKED (rli->t); + /* Lay out any static members. This is done now because their type may use the record's type. */ while (rli->pending_statics) |