aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2006-08-29 02:55:35 -0400
committerJason Merrill <jason@gcc.gnu.org>2006-08-29 02:55:35 -0400
commit4666cd04464f6f77a80b8d3479f8e4d5760d34fe (patch)
treea25aa21ee2d5af03a666508c54f5c5ef21973bb7 /gcc/cp/class.c
parentbed02d89608838750eac5b389e91b2678c72d55d (diff)
downloadgcc-4666cd04464f6f77a80b8d3479f8e4d5760d34fe.zip
gcc-4666cd04464f6f77a80b8d3479f8e4d5760d34fe.tar.gz
gcc-4666cd04464f6f77a80b8d3479f8e4d5760d34fe.tar.bz2
re PR c++/26670 (attribute((packed)) sometimes not ignored for non-PODs)
PR c++/26670 * class.c (check_field_decls): Unset TYPE_PACKED (t) if one of the fields can't be packed. From-SVN: r116555
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 18996a0..550edff 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2906,10 +2906,13 @@ check_field_decls (tree t, tree *access_decls,
if (TYPE_PACKED (t))
{
if (!pod_type_p (type) && !TYPE_PACKED (type))
- warning
- (0,
- "ignoring packed attribute on unpacked non-POD field %q+#D",
- x);
+ {
+ warning
+ (0,
+ "ignoring packed attribute because of unpacked non-POD field %q+#D",
+ x);
+ TYPE_PACKED (t) = 0;
+ }
else if (TYPE_ALIGN (TREE_TYPE (x)) > BITS_PER_UNIT)
DECL_PACKED (x) = 1;
}