]> gcc.gnu.org Git - gcc.git/commit
re PR c++/54046 (wrong control reaches end of non-void function for switch case with...
authorJakub Jelinek <jakub@redhat.com>
Fri, 23 Nov 2012 16:04:03 +0000 (17:04 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 23 Nov 2012 16:04:03 +0000 (17:04 +0100)
commit88cd0e88e36515f01b6f1e398358dc11cc06c389
tree756c94d3f1786802105c930a7ed81bf4e39c9a8d
parent340ef734b8072d2b58f946bb69170f2e535813d7
re PR c++/54046 (wrong control reaches end of non-void function for switch case with throw and default)

PR c++/54046
* Makefile.in (gimple-low.o): Depend on langhooks.h.
* gimple-low.c: Include langhooks.c.
(block_may_fallthru): Handle TARGET_EXPR and ERROR_MARK,
by default call lang_hooks.block_may_fallthru.
* langhooks.h (struct lang_hooks): Add block_may_fallthru
langhook.
* langhooks-def.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define.
(LANG_HOOKS_INITIALIZER): Use it.

* cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
* cp-objcp-common.c (cxx_block_may_fallthru): New function.
* cp-tree.h (cxx_block_may_fallthru): New prototype.

* g++.dg/warn/Wreturn-type-8.C: New test.

From-SVN: r193762
gcc/ChangeLog
gcc/Makefile.in
gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.c
gcc/cp/cp-objcp-common.h
gcc/cp/cp-tree.h
gcc/gimple-low.c
gcc/langhooks-def.h
gcc/langhooks.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wreturn-type-8.C [new file with mode: 0644]
This page took 0.058547 seconds and 5 git commands to generate.