https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86284
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- -fsanitize=unreachable will find the C++ cases right now. For C, it is a little harder because it is only undefined if the value is used.