aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-11-28 10:34:30 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2005-11-28 10:34:30 +0000
commit646c0835465a8438ce3543bfcae30becf641a63e (patch)
tree7e925b64a93bd395a2f07912807080dfbe0ecd38 /gcc/cp/class.c
parentbbee4b64682d27f5ea99df3654e3e1b139443e0e (diff)
downloadgcc-646c0835465a8438ce3543bfcae30becf641a63e.zip
gcc-646c0835465a8438ce3543bfcae30becf641a63e.tar.gz
gcc-646c0835465a8438ce3543bfcae30becf641a63e.tar.bz2
re PR c++/21166 (g++ gives error on reference to packed structure elements)
.: PR c++/21166 * c-decl.c (finish_struct): Only set DECL_PACKED on a field when its natural alignment is > BITS_PER_UNIT. * stor-layout.c (finalize_type_size): Revert my patch of 2005-08-08. * c-common.c (handle_packed_attribute): Ignore packing on a field whose type is naturally char aligned. cp: PR c++/21166 * class.c (check_field_decls): Only set DECL_PACKED on a field when its natural alignment is > BITS_PER_UNIT. From-SVN: r107599
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 7c43d3b..647b7cb 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2801,7 +2801,7 @@ check_field_decls (tree t, tree *access_decls,
(0,
"ignoring packed attribute on unpacked non-POD field %q+#D",
x);
- else
+ else if (TYPE_ALIGN (TREE_TYPE (x)) > BITS_PER_UNIT)
DECL_PACKED (x) = 1;
}