[Bug c++/46476] Missing Warning about unreachable code after return

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 17 22:14:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46476

--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Richard, perhaps a less aggressive -Wunreachable-code could be implemented just
after (or while) building the control flow graph?

It would not try to be smart with constant propagation or guessing branches
taken or not taken, just warn for code that immediately follows return, break,
continue, goto or throw. See PR69857.

Clang does have -Wunreachable-code.


More information about the Gcc-bugs mailing list