https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60725
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #10 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Mário Feroldi from comment #9) > Note that this version of `f1` doesn't prevent the warning. I wonder why? > > enum E { E1 }; > static inline int f1(enum E e) { > (e == E1) ? void() : __builtin_unreachable(); // * > switch (e) { > case E1: return 1; > } > } > int main () { > f1(E1); > return 0; > } Because the warning comes from the front-end and there is no data flow in the front-end. *** This bug has been marked as a duplicate of bug 67629 ***