OSDN Git Service

PR c++/42837
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Feb 2010 18:31:58 +0000 (18:31 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Feb 2010 18:31:58 +0000 (18:31 +0000)
* stor-layout.c (place_field): Don't warn about unnecessary DECL_PACKED
if the type is packed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157013 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stor-layout.c

index 7bd2c7b..b148e67 100644 (file)
@@ -1,3 +1,9 @@
+2010-02-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42837
+       * stor-layout.c (place_field): Don't warn about unnecessary
+       DECL_PACKED if the type is packed.
+
 2010-02-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/43139
index 6f08d8c..1806c12 100644 (file)
@@ -1100,7 +1100,8 @@ place_field (record_layout_info rli, tree field)
              if (STRICT_ALIGNMENT)
                warning (OPT_Wattributes, "packed attribute causes "
                          "inefficient alignment for %q+D", field);
-             else
+             /* Don't warn if DECL_PACKED was set by the type.  */
+             else if (!TYPE_PACKED (rli->t))
                warning (OPT_Wattributes, "packed attribute is "
                         "unnecessary for %q+D", field);
            }