Search

bad warning using negative value for enum with underlying type specified as signed short by Paul Rose

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 712990
Opened: 12/10/2011 1:40:48 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
0
User(s) can reproduce this bug
c++11 feature of specifying underlying type for enum
when using "short" or "signed short" as underlying type you get warning C4341 "signed value is out of range for enum constant"
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling version

Visual Studio 11 Developer Preview

Steps to reproduce

compile this 3 line program: see unexpected warnings on lines 1 and 2
enum Test1 : short { eT1 = -1 }; // warning C4341:
enum Test2 : signed short {    eT2 = -1 }; // warning C4341:
int main(){ return 0;}

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

c:\foo\foo.cpp(1): warning C4341: 'eT1' : signed value is out of range for enum constant
c:\foo\foo.cpp(2): warning C4341: 'eT2' : signed value is out of range for enum constant

Expected results

no warnings
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 12/13/2011 at 9:58 AM
Hi: this issue does not reproduce with a current compiler so it looks as if it has been addressed.

Thanks
Jonathan Caves
Visual C++ Compiler Team
Posted by MS-Moderator10 [Feedback Moderator] on 12/11/2011 at 10:24 PM
Thank you for submitting feedback on Visual Studio 2010 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 MS-Moderator01 on 12/10/2011 at 2:42 PM
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.