diff options
author | Jason Merrill <jason@redhat.com> | 2010-02-23 13:31:58 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-02-23 13:31:58 -0500 |
commit | a3b20e90b15f4022bbc6851b11e1950b89c3b961 (patch) | |
tree | 75de48b522dc558018496443966ad310bcfffa48 /gcc/stor-layout.c | |
parent | 5ead99faadd6b813fb277a87b96a324766b0b3b8 (diff) | |
download | gcc-a3b20e90b15f4022bbc6851b11e1950b89c3b961.zip gcc-a3b20e90b15f4022bbc6851b11e1950b89c3b961.tar.gz gcc-a3b20e90b15f4022bbc6851b11e1950b89c3b961.tar.bz2 |
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
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 6f08d8c..1806c12 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); } |