https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> --- It's not a useless warning. If I call your function from comment 7 like this, I get undefined behaviour: CoverMyBases( Enum{2} ); Your switch is undefined for this code. That's what GCC is warning you about. To tell GCC you will never call the function with any value except Enum::A or Enum::B, add default: __builtin_unreachable();