summaryrefslogtreecommitdiff
path: root/gcc/langhooks-def.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-11-23 17:04:03 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-11-23 17:04:03 +0100
commit88cd0e88e36515f01b6f1e398358dc11cc06c389 (patch)
tree756c94d3f1786802105c930a7ed81bf4e39c9a8d /gcc/langhooks-def.h
parent340ef734b8072d2b58f946bb69170f2e535813d7 (diff)
downloadgcc-88cd0e88e36515f01b6f1e398358dc11cc06c389.tar.gz
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
Diffstat (limited to 'gcc/langhooks-def.h')
-rw-r--r--gcc/langhooks-def.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index d8f479f3f5d..75793f62325 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -115,6 +115,7 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
#define LANG_HOOKS_EH_PERSONALITY lhd_gcc_personality
#define LANG_HOOKS_EH_RUNTIME_TYPE lhd_pass_through_t
#define LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS NULL
+#define LANG_HOOKS_BLOCK_MAY_FALLTHRU hook_bool_const_tree_true
#define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false
#define LANG_HOOKS_DEEP_UNSHARING false
@@ -300,6 +301,7 @@ extern void lhd_end_section (void);
LANG_HOOKS_EH_PERSONALITY, \
LANG_HOOKS_EH_RUNTIME_TYPE, \
LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \
+ LANG_HOOKS_BLOCK_MAY_FALLTHRU, \
LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \
LANG_HOOKS_DEEP_UNSHARING \
}