https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81275
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- You get the same thing with any other cleanup, say: struct C { C (); ~C (); }; int foo (int a, int b) { C c; switch (a) { case 0: switch (b) { default: return 0; } break; default: return 0; } } with just -Wreturn-type will warn too. And no optimizations, with -O1 and above the eh pass optimizes it away.