This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53479] Control flow analysis reports warnings in switch over an enum class even if all possible values have their branches
- 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: Thu, 24 May 2012 20:21:57 +0000
- Subject: [Bug c++/53479] Control flow analysis reports warnings in switch over an enum class even if all possible values have their branches
- Auto-submitted: auto-generated
- References: <bug-53479-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53479
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-24 20:21:57 UTC ---
No, there's nothing wrong with the cast.
A scoped enumeration type without an explicitly-specified underlying type has a
fixed underlying type of int, so the values of the enumeration type are the
values of int.
Your switch doesn't handle all values, so control can flow off the end of the
function, so the warning is correct.