From 6f9fdf4db2c68f482ec4ff3cadaea0537a4b13e1 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 4 Feb 2002 23:05:15 +0100 Subject: 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. From-SVN: r49497 --- gcc/doc/c-tree.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi index cbf0196..65b39db 100644 --- a/gcc/doc/c-tree.texi +++ b/gcc/doc/c-tree.texi @@ -1631,7 +1631,8 @@ Used to represent a @code{switch} statement. The @code{SWITCH_COND} is the expression on which the switch is occurring. See the documentation for an @code{IF_STMT} for more information on the representation used for the condition. The @code{SWITCH_BODY} is the body of the switch -statement. +statement. The @code{SWITCH_TYPE} is the original type of switch +expression as given in the source, before any compiler conversions. @item TRY_BLOCK Used to represent a @code{try} block. The body of the try block is -- cgit v1.1