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: "db0451 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 02 Oct 2016 09:01:15 +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/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53479
--- Comment #19 from DB <db0451 at gmail dot com> ---
just for anyone finding this later, note this has been raised at the level of
the C++ Standard - http://wg21.link/p0375r0 - with the conclusion being:
> EWG pointed out that most enumerations are exhaustive, and
> we want to be annotating the exception, not the norm.
> However, there wasn’t much appetite for a “non-exhaustive”
> annotation, either; implementers were of the opinion that
> current heuristics for diagnostics for switch statements
> on enumerations are sufficient.
- via
https://botondballo.wordpress.com/2016/07/06/trip-report-c-standards-meeting-in-oulu-june-2016/
I suspect that "most enumerations are exhaustive" is an overgeneralisation that
only holds for some people you could ask, but hey.