diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-04-19 13:56:07 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-04-19 13:56:07 +0200 |
commit | c280b7ee5c5dfcc1b4ae2c0389987b7b67ec8cf8 (patch) | |
tree | ea24706aa8db720c9a1d2368df12936553d81be8 /gcc/tree-outof-ssa.c | |
parent | 4180490732498b1d7e30eb73abb6a7c934b89256 (diff) | |
download | gcc-c280b7ee5c5dfcc1b4ae2c0389987b7b67ec8cf8.zip gcc-c280b7ee5c5dfcc1b4ae2c0389987b7b67ec8cf8.tar.gz gcc-c280b7ee5c5dfcc1b4ae2c0389987b7b67ec8cf8.tar.bz2 |
re PR c/89888 (When switch controlling expression is promoted from type narrower than int, GCC does not diagnose identical cases)
PR c/89888
* c-common.h (c_add_case_label): Remove orig_type and outside_range_p
arguments.
(c_do_switch_warnings): Remove outside_range_p argument.
* c-common.c (check_case_bounds): Removed.
(c_add_case_label): Remove orig_type and outside_range_p arguments.
Don't call check_case_bounds. Fold low_value as well as high_value.
* c-warn.c (c_do_switch_warnings): Remove outside_range_p argument.
Check for case labels outside of range of original type here and
adjust them.
c/
* c-typeck.c (struct c_switch): Remove outside_range_p member.
(c_start_case): Don't clear it.
(do_case): Adjust c_add_case_label caller.
(c_finish_case): Adjust c_do_switch_warnings caller.
cp/
* decl.c (struct cp_switch): Remove outside_range_p member.
(push_switch): Don't clear it.
(pop_switch): Adjust c_do_switch_warnings caller.
(finish_case_label): Adjust c_add_case_label caller.
testsuite/
* c-c++-common/pr89888.c: New test.
* g++.dg/torture/pr40335.C: Change dg-bogus into dg-warning.
Don't expect -Wswitch-unreachable warning.
From-SVN: r270455
Diffstat (limited to 'gcc/tree-outof-ssa.c')
0 files changed, 0 insertions, 0 deletions