This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54140] -Wswitch shouldn't complain about out-of-range values that are cast to the correct type
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 31 Jul 2012 15:27:09 +0000
- Subject: [Bug c++/54140] -Wswitch shouldn't complain about out-of-range values that are cast to the correct type
- Auto-submitted: auto-generated
- References: <bug-54140-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54140
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-31 15:27:09 UTC ---
(In reply to comment #0)
> This would have been appropriate if I wrote "case 72:", but I didn't -- I wrote
> "case (Enum)72:". This is an explicit indication that I want gcc to treat 72
> as a member of Enum here
The values of the enumeration type are the values in the range [0,1] so there
is no way to treat 72 as type Enum, the value is not defined.