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

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Sep 11 10:27:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53479

--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
In summary, neither adding 'default' or 'return' are recommended to silence
this warning if you think the warning is wrong. If you think the warning will
always be wrong, use __builtin_unreachable(). If you think it is wrong now, but
you would like to notice if it stops being wrong, then use assert(false).


More information about the Gcc-bugs mailing list