Compiler error (C3431) using elaborated type specifiers for scoped enumerations - by Nico Rieck

Status : 

  Deferred<br /><br />
		The product team has reviewed this issue and has deferred it for consideration at a later time.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 771978 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/22/2012 9:49:42 AM
Access Restriction Public


ISO/IEC 14882:2011 section [dcl.type.elab]/3 states: "[...] the enum keyword shall be used to refer to an enumeration [...]".

When using an elaborated type specifier for a scoped enumeration, Visual C++ incorrectly requires "enum class":

enum class E { };
enum class E e1; // incorrect, but compiles
enum E e2; // correct, but yields: error C3431: 'E' : a scoped enumeration cannot be redeclared as an unscoped enumeration

Intellisense parses this correctly, and complains about the variant the compiler accepts.
Sign in to post a comment.
Posted by Microsoft on 11/22/2012 at 6:46 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/22/2012 at 10:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(