diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-29 13:12:44 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-29 13:12:44 +0000 |
commit | be23b16fde27a3bc050e177abd965de0c4f2f04a (patch) | |
tree | 8bc44969367937690b20314e2432d485c707678f /gcc/cp/semantics.c | |
parent | 6b4402853b6c8f5f6c3ea6ca0509ee5e3889d870 (diff) | |
download | gcc-be23b16fde27a3bc050e177abd965de0c4f2f04a.tar.gz |
PR c/66322
* c-common.c (check_case_bounds): Add bool * parameter. Set
OUTSIDE_RANGE_P.
(c_add_case_label): Add bool * parameter. Pass it down to
check_case_bounds.
(c_do_switch_warnings): Add bool parameters. Implement -Wswitch-bool
warning here.
* c-common.h (c_add_case_label, c_do_switch_warnings): Update
declarations.
* c-typeck.c (struct c_switch): Add BOOL_COND_P and OUTSIDE_RANGE_P.
(c_start_case): Set BOOL_COND_P and OUTSIDE_RANGE_P. Don't warn
about -Wswitch-bool here.
(do_case): Update c_add_case_label call.
(c_finish_case): Update c_do_switch_warnings call.
* decl.c (struct cp_switch): Add OUTSIDE_RANGE_P.
(push_switch): Set OUTSIDE_RANGE_P.
(pop_switch): Update c_do_switch_warnings call.
(finish_case_label): Update c_add_case_label call.
* semantics.c (finish_switch_cond): Don't warn about -Wswitch-bool
here.
* function.c (stack_protect_epilogue): Remove a cast to int.
* doc/invoke.texi: Update -Wswitch-bool description.
* c-c++-common/pr60439.c: Add dg-prune-output and add switch cases.
* c-c++-common/pr66322.c: New test.
* g++.dg/eh/scope1.C: Remove dg-warning.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225116 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 4b8ce3b35ce..c23d9bef0c2 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1156,11 +1156,6 @@ finish_switch_cond (tree cond, tree switch_stmt) orig_type = TREE_TYPE (cond); if (cond != error_mark_node) { - /* Warn if the condition has boolean value. */ - if (TREE_CODE (orig_type) == BOOLEAN_TYPE) - warning_at (input_location, OPT_Wswitch_bool, - "switch condition has type bool"); - /* [stmt.switch] Integral promotions are performed. */ |