This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53479] Control flow analysis reports warnings in switch over an enum class even if all possible values have their branches


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]