Bug 18165 - Attributes following enumeration declaration ignored
Summary: Attributes following enumeration declaration ignored
Status: RESOLVED DUPLICATE of bug 14124
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-26 21:50 UTC by Matt Austern
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: powerpc-apple-darwin7.5.0
Target: powerpc-apple-darwin7.5.0
Build: powerpc-apple-darwin7.5.0
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Austern 2004-10-26 21:50:32 UTC
Consider the following program:
m>

enum X { a = 1 };
enum Y { b = 1 } __attribute__((packed));

int main()
{
  using namespace std;
  cout << "default:        " << sizeof(enum X) << endl;
  cout << "with attribute: " << sizeof(enum Y) << endl;
}

The C++ compiler accepts this.  However, the attribute on enum Y is ignored.  As running this program 
shows, the size of enum Y is the same as the size of enum X.

Note that the test suite contains a test to make sure that an attribute in this position is accepted.  
(parse/parse3.C) We just failed to make sure that the attribute really did anything.
Comment 1 Andrew Pinski 2004-10-26 21:56:46 UTC

*** This bug has been marked as a duplicate of 14124 ***