diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dfb3d4bdda2..f0cb0704b43 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2002-02-04 Jakub Jelinek <jakub@redhat.com> + + * semantics.c (begin_switch_stmt): Clear SWITCH_TYPE. + (finish_switch_cond): Set SWITCH_TYPE. + 2002-02-04 Richard Henderson <rth@redhat.com> * method.c (use_thunk): Always initialize the block tree. Reindent. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index cdc1178f338..c344a3016ef 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -500,7 +500,7 @@ tree begin_switch_stmt () { tree r; - r = build_stmt (SWITCH_STMT, NULL_TREE, NULL_TREE); + r = build_stmt (SWITCH_STMT, NULL_TREE, NULL_TREE, NULL_TREE); add_stmt (r); do_pushlevel (); return r; @@ -513,6 +513,7 @@ finish_switch_cond (cond, switch_stmt) tree cond; tree switch_stmt; { + tree orig_type = NULL; if (!processing_template_decl) { tree type; @@ -525,6 +526,7 @@ finish_switch_cond (cond, switch_stmt) error ("switch quantity not an integer"); cond = error_mark_node; } + orig_type = TREE_TYPE (cond); if (cond != error_mark_node) { cond = default_conversion (cond); @@ -542,6 +544,7 @@ finish_switch_cond (cond, switch_stmt) cond = index; } FINISH_COND (cond, switch_stmt, SWITCH_COND (switch_stmt)); + SWITCH_TYPE (switch_stmt) = orig_type; push_switch (switch_stmt); } |