diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-04 22:05:15 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-04 22:05:15 +0000 |
commit | 79dc3b8eebe13e6e2cd6d8813aeaaa4171e307b2 (patch) | |
tree | abbbeb9e68d3bc70e43d55d15b23db2b78adbf38 /gcc/c-semantics.c | |
parent | 5c56a3a9aa6da6b2b1e51b4dcbc2745cd77ef44b (diff) | |
download | gcc-79dc3b8eebe13e6e2cd6d8813aeaaa4171e307b2.tar.gz |
PR c/4475, c++/3780:
* c-common.def (SWITCH_STMT): Add SWITCH_TYPE operand.
* c-common.h (SWITCH_TYPE): Define.
* c-typeck.c (c_start_case): Set SWITCH_TYPE.
* stmt.c (all_cases_count): Set lastval to thisval at end of loop.
Rename spareness variable to sparseness.
(expand_end_case_type): Renamed from expand_end_case, use orig_type
if non-NULL instead of TREE_TYPE (orig_index).
* tree.h (expand_end_case_type): Renamed from expand_end_case.
(expand_end_case): Define using expand_end_case_type.
* c-semantics.c (genrtl_switch_stmt): Pass SWITCH_TYPE
to expand_end_case_type.
* doc/c-tree.texi (SWITCH_STMT): Document SWITCH_TYPE.
* semantics.c (begin_switch_stmt): Clear SWITCH_TYPE.
(finish_switch_cond): Set SWITCH_TYPE.
* gcc.dg/Wswitch.c: Fix typos. Don't return unconditionally
before all tests. Move warning one line above to match where it
C frontend emits.
* gcc.dg/Wswitch-2.c: New test.
* g++.dg/warn/Wswitch-1.C: New test.
* g++.dg/warn/Wswitch-2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49497 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-semantics.c')
-rw-r--r-- | gcc/c-semantics.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index c0bbc515da8..8f99bc1f64c 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -644,7 +644,7 @@ genrtl_switch_stmt (t) emit_line_note (input_filename, lineno); expand_start_case (1, cond, TREE_TYPE (cond), "switch statement"); expand_stmt (SWITCH_BODY (t)); - expand_end_case (cond); + expand_end_case_type (cond, SWITCH_TYPE (t)); } /* Create a CASE_LABEL tree node and return it. */ |