]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/42837 (FAIL: g++.dg/abi/packed1.C execution test)
authorJason Merrill <jason@redhat.com>
Tue, 23 Feb 2010 18:31:58 +0000 (13:31 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 23 Feb 2010 18:31:58 +0000 (13:31 -0500)
PR c++/42837
* stor-layout.c (place_field): Don't warn about unnecessary DECL_PACKED
if the type is packed.

From-SVN: r157013

gcc/ChangeLog
gcc/stor-layout.c

index 7bd2c7b93356ad34b4be079847447baccea0a55f..b148e67d11df7c95aa4db00efc79f81ce726e0e3 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 6f08d8cdf97787637c2902c91a59022e8845b51a..1806c12189a6883757df780727ba6f95a1de63f9 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);
            }