aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/expr.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1998-09-06 19:45:16 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-09-06 19:45:16 +0000
commitd41fbd2cb8c2ead8f101826149bd73f2f60b876a (patch)
tree435801f8dbbe8801f40acefd041c50a5a7d375b5 /gcc/cp/expr.c
parente04a16fbeee9504247e0d069171a627096225028 (diff)
downloadgcc-d41fbd2cb8c2ead8f101826149bd73f2f60b876a.zip
gcc-d41fbd2cb8c2ead8f101826149bd73f2f60b876a.tar.gz
gcc-d41fbd2cb8c2ead8f101826149bd73f2f60b876a.tar.bz2
cp-error.def: New file.
* cp-error.def: New file. * Make-lang.in (cc1plus): Add dependency on it. * Makefile.in (CXX_TREE_H): Likewise. * cp-tree.h (error_code): New type. Include cp-error.def to get error codes. Make it possible to include cp-tree.h in errfn.c. (enable_warning): New function. (flag_diag_codes): New variable. * errfn.c: Include cp-tree.h. (cp_err_msg): New type. Include cp-error.def to define it. (err_msgs): New variable. (is_warning_enabled): New function. (cp_thing): Take an error_code, not a format string. Output the diagnostic code if flag_diag_codes. (cp_error, cp_compiler_error, cp_sprintf, cp_error_at): Take error_codes, not format strings. (cp_warning, cp_pedwarn, cp_warning_at, cp_pedwarn_at): Likewise. Call is_warning_enabled. * decl2.c (flag_diag_codes): New variable. (lang_decode_option): Handle -fdiag-codes and -Wnumber. * lang-options.h: Add -fdiag-codes, -fno-diag-codes, and -W-number-, and -Wno-number. * class.c: Update all calls to error-functions. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * lex.c: Likewise. * parse.y: Likewise. * pt.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * sig.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. * xref.c: Likewise. From-SVN: r22304
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r--gcc/cp/expr.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 4c3d8b6..8994891 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -331,10 +331,10 @@ do_case (start, end)
if (start != NULL_TREE && TREE_TYPE (start) != NULL_TREE
&& POINTER_TYPE_P (TREE_TYPE (start)))
- error ("pointers are not permitted as case values");
+ cp_error (ec_pointers_are_not_permitted_as_case_values);
if (end && pedantic)
- pedwarn ("ANSI C++ forbids range expressions in switch statement");
+ cp_pedwarn (ec_forbids_range_expressions_in_switch_statement);
if (processing_template_decl)
{
@@ -366,43 +366,43 @@ do_case (start, end)
if (success == 1)
{
if (end)
- error ("case label not within a switch statement");
+ cp_error (ec_case_label_not_within_a_switch_statement);
else if (start)
- cp_error ("case label `%E' not within a switch statement", start);
+ cp_error (ec_case_label_not_within_a_switch_statement, start);
else
- error ("default label not within a switch statement");
+ cp_error (ec_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",
+ cp_error (ec_duplicate_or_overlapping_case_value);
+ cp_error_at (ec_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);
+ cp_error (ec_duplicate_case_value, start);
+ cp_error_at (ec_previously_used_here, duplicate);
}
else
{
- error ("multiple default labels in one switch");
- cp_error_at ("this is the first default label", duplicate);
+ cp_error (ec_multiple_default_labels_in_one_switch);
+ cp_error_at (ec_this_is_the_first_default_label, duplicate);
}
}
else if (success == 3)
- warning ("case value out of range");
+ cp_warning (ec_case_value_out_of_range);
else if (success == 4)
- warning ("empty range specified");
+ cp_warning (ec_empty_range_specified);
else if (success == 5)
{
if (end)
- error ("case label within scope of cleanup or variable array");
+ cp_error (ec_case_label_within_scope_of_cleanup_or_variable_array);
else if (! start)
- error ("`default' label within scope of cleanup or variable array");
+ cp_error (ec_default_label_within_scope_of_cleanup_or_variable_array);
else
- cp_error ("case label `%E' within scope of cleanup or variable array", start);
+ cp_error (ec_case_label_within_scope_of_cleanup_or_variable_array, start);
}
}
if (start)