Home Dashboard Directory Help
Search

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


Status: 

Closed
 as Deferred Help for as Deferred


4
0
Sign in
to vote
Type: Bug
ID: 771978
Opened: 11/22/2012 9:49:42 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

ISO/IEC 14882:2011 section 7.1.6.3 [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.
Details
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(http://support.microsoft.com)
Sign in to post a workaround.