diff options
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r-- | gcc/cp/expr.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index 42a5390..39095ec 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -205,82 +205,3 @@ extract_init (decl, init) return 0; } -void -do_case (start, end) - tree start, end; -{ - tree value1 = NULL_TREE, value2 = NULL_TREE, label; - - if (start != NULL_TREE && TREE_TYPE (start) != NULL_TREE - && POINTER_TYPE_P (TREE_TYPE (start))) - error ("pointers are not permitted as case values"); - - if (end && pedantic) - pedwarn ("ISO C++ forbids range expressions in switch statement"); - - if (start) - value1 = check_cp_case_value (start); - if (end) - value2 = check_cp_case_value (end); - - label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); - - if (value1 != error_mark_node - && value2 != error_mark_node) - { - tree duplicate; - int success; - - if (end) - success = pushcase_range (value1, value2, convert_and_check, - label, &duplicate); - else if (start) - success = pushcase (value1, convert_and_check, label, &duplicate); - else - success = pushcase (NULL_TREE, 0, label, &duplicate); - - if (success == 1) - { - if (end) - error ("case label not within a switch statement"); - else if (start) - cp_error ("case label `%E' not within a switch statement", start); - else - error ("default label not within a switch statement"); - } - else if (success == 2) - { - if (end) - { - error ("duplicate (or overlapping) case value"); - cp_error_at ("this is the first entry overlapping that value", - duplicate); - } - else if (start) - { - cp_error ("duplicate case value `%E'", start); - cp_error_at ("previously used here", duplicate); - } - else - { - error ("multiple default labels in one switch"); - cp_error_at ("this is the first default label", duplicate); - } - } - else if (success == 3) - warning ("case value out of range"); - else if (success == 4) - warning ("empty range specified"); - else if (success == 5) - { - if (end) - error ("case label within scope of cleanup or variable array"); - else if (! start) - error ("`default' label within scope of cleanup or variable array"); - else - cp_error ("case label `%E' within scope of cleanup or variable array", start); - } - } - - current_function_return_value = NULL_TREE; -} |