[Bug c++/50518] New: repeated c++11 opaque enum declarations are invalid
fabien at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Sep 25 20:48:00 GMT 2011
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: unassigned@gcc.gnu.org
ReportedBy: fabien@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.
More information about the Gcc-bugs
mailing list