http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50518
Bug #: 50518 Summary: repeated c++11 opaque enum declarations are invalid Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: fab...@gcc.gnu.org The below example should not compile: struct B { enum E: int; enum E: int; }; Repeating opaque-enum-declarations at class scope is invalid under 9.2/1: -- A member shall not be declared twice in the member-specification, except that a nested class or member class template can be declared and then later defined, and except that an enumeration can be introduced with an opaque-enum-declaration and later redeclared with an enum-specifier. -- However, struct A { enum E: int; enum E: int { e1 }; }; is OK.