This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46476] Missing Warning about unreachable code after return
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Feb 2016 22:13:59 +0000
- Subject: [Bug c++/46476] Missing Warning about unreachable code after return
- Auto-submitted: auto-generated
- References: <bug-46476-4 at http dot gcc dot gnu dot org/bugzilla/>
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.