https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91389
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Don't do it then? The no fallthru early discovery isn't perfect and with the sanitizer instrumentation it gets even harder. Looks like a dup of PR86899 to me anyway. If I do a small modification like: class A { struct B { enum {} type; }; B *m_fn1(); }; struct C { C (); ~C (); }; A::B *A::m_fn1() { C c; B *a; switch (a->type) { break; default: return a; } } then it emits the false positive warning even with just -O0 -Wreturn-type. I really think it doesn't hurt if people remove the clearly unreachable code from their code to get rid of this warning.