This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/18165] New: Attributes following enumeration declaration ignored


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.

-- 
           Summary: Attributes following enumeration declaration ignored
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: austern at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin7.5.0
  GCC host triplet: powerpc-apple-darwin7.5.0
GCC target triplet: powerpc-apple-darwin7.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18165


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]