From: Jason Merrill Date: Tue, 23 Feb 2010 18:31:58 +0000 (-0500) Subject: re PR c++/42837 (FAIL: g++.dg/abi/packed1.C execution test) X-Git-Tag: releases/gcc-4.5.0~641 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3b20e90b15f4022bbc6851b11e1950b89c3b961;p=thirdparty%2Fgcc.git re PR c++/42837 (FAIL: g++.dg/abi/packed1.C execution test) PR c++/42837 * stor-layout.c (place_field): Don't warn about unnecessary DECL_PACKED if the type is packed. From-SVN: r157013 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bd2c7b93356..b148e67d11df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-02-23 Jason Merrill + + 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 PR target/43139 diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 6f08d8cdf977..1806c12189a6 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -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); }