https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #5 from Vitali <vlovich at gmail dot com> --- Jonathan, I think the defect report here does actually apply to this example. I agree the argument could be made that if there's gaps in the enum values that it's arguable that the current GCC behaviour is standards compliant (clearly clang & GCC disagree on this for both C & C++ so unclear who's right or wrong in their interpretation of what's allowed). However, in the example posted this is a "dense" enum. There's no integer value possible that's not outside the range & yet GCC still continues to treat that as a possibility & thus missing optimization opportunities & generating false-positive warnings.