aboutsummaryrefslogtreecommitdiff
path: root/gcc
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
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')
-rw-r--r--gcc/cp/ChangeLog45
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/Makefile.in2
-rw-r--r--gcc/cp/call.c103
-rw-r--r--gcc/cp/class.c185
-rw-r--r--gcc/cp/cp-error.def2469
-rw-r--r--gcc/cp/cp-tree.h16
-rw-r--r--gcc/cp/cvt.c46
-rw-r--r--gcc/cp/decl.c788
-rw-r--r--gcc/cp/decl2.c196
-rw-r--r--gcc/cp/errfn.c120
-rw-r--r--gcc/cp/except.c8
-rw-r--r--gcc/cp/expr.c32
-rw-r--r--gcc/cp/friend.c38
-rw-r--r--gcc/cp/init.c134
-rw-r--r--gcc/cp/lang-options.h4
-rw-r--r--gcc/cp/lex.c194
-rw-r--r--gcc/cp/method.c40
-rw-r--r--gcc/cp/parse.c1645
-rw-r--r--gcc/cp/parse.y133
-rw-r--r--gcc/cp/pt.c227
-rw-r--r--gcc/cp/repo.c6
-rw-r--r--gcc/cp/rtti.c14
-rw-r--r--gcc/cp/search.c86
-rw-r--r--gcc/cp/semantics.c32
-rw-r--r--gcc/cp/sig.c14
-rw-r--r--gcc/cp/tree.c8
-rw-r--r--gcc/cp/typeck.c448
-rw-r--r--gcc/cp/typeck2.c200
-rw-r--r--gcc/cp/xref.c2
-rw-r--r--gcc/invoke.texi23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn2.C6
32 files changed, 4949 insertions, 2317 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7315d25..a4fc494 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,48 @@
+1998-09-06 Mark Mitchell <mark@markmitchell.com>
+
+ * 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.
+
Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com)
* Makefile.in (INCLUDES): Update after recent toplevel gcc
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 2bea6a6..3cf313c 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -125,7 +125,7 @@ CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
$(srcdir)/cp/repo.c $(srcdir)/cp/semantics.c
cc1plus$(exeext): $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o \
- $(srcdir)/cp/cp-tree.h $(srcdir)/cp/cp-tree.def
+ $(srcdir)/cp/cp-tree.h $(srcdir)/cp/cp-tree.def $(srcdir)/cp/cp-error.def
cd cp; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus$(exeext)
#
# Build hooks:
diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in
index f7e0941..cdc0984 100644
--- a/gcc/cp/Makefile.in
+++ b/gcc/cp/Makefile.in
@@ -208,7 +208,7 @@ RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
-CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
+CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def cp-error.def
PARSE_H = $(srcdir)/parse.h
PARSE_C = $(srcdir)/parse.c
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index d27d616..e7cf716 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -132,7 +132,7 @@ build_field_call (basetype_path, instance_ptr, name, parms)
if (field == NULL_TREE)
{
- cp_error ("`this' has no member named `%D'", name);
+ cp_error (ec_this_has_no_member_named, name);
return error_mark_node;
}
@@ -203,7 +203,7 @@ build_field_call (basetype_path, instance_ptr, name, parms)
}
else if (TREE_CODE (ftype) == METHOD_TYPE)
{
- error ("invalid call via pointer-to-member function");
+ cp_error (ec_invalid_call_via_pointertomember_function);
return error_mark_node;
}
else
@@ -421,7 +421,7 @@ build_scoped_method_call (exp, basetype, name, parms)
return build_method_call (exp, name, parms, NULL_TREE, LOOKUP_NORMAL);
if (! check_dtor_name (basetype, name))
- cp_error ("qualified type `%T' does not match destructor name `~%T'",
+ cp_error (ec_qualified_type_does_not_match_destructor_name,
basetype, TREE_OPERAND (name, 0));
/* Destructors can be "called" for simple types; see 5.2.4 and 12.4 Note
@@ -430,7 +430,7 @@ build_scoped_method_call (exp, basetype, name, parms)
if (! IS_AGGR_TYPE (basetype))
{
if (TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (basetype))
- cp_error ("type of `%E' does not match destructor type `%T' (type was `%T')",
+ cp_error (ec_type_of_does_not_match_destructor_type_type_was,
exp, basetype, type);
return cp_convert (void_type_node, exp);
@@ -442,7 +442,7 @@ build_scoped_method_call (exp, basetype, name, parms)
if (! IS_AGGR_TYPE (type))
{
- cp_error ("base object `%E' of scoped method call is of non-aggregate type `%T'",
+ cp_error (ec_base_object_of_scoped_method_call_is_of_nonaggregate_type,
exp, type);
return error_mark_node;
}
@@ -661,15 +661,14 @@ build_method_call (instance, name, parms, basetype_path, flags)
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
if (parms)
- error ("destructors take no parameters");
+ cp_error (ec_destructors_take_no_parameters);
basetype = TREE_TYPE (instance);
if (TREE_CODE (basetype) == REFERENCE_TYPE)
basetype = TREE_TYPE (basetype);
if (! check_dtor_name (basetype, name))
- cp_error
- ("destructor name `~%T' does not match type `%T' of expression",
- TREE_OPERAND (name, 0), basetype);
+ cp_error (ec_destructor_name_does_not_match_type,
+ TREE_OPERAND (name, 0), basetype);
if (! TYPE_HAS_DESTRUCTOR (complete_type (basetype)))
return cp_convert (void_type_node, instance);
@@ -2019,20 +2018,20 @@ print_z_candidates (candidates)
if (TREE_CODE (candidates->fn) == IDENTIFIER_NODE)
{
if (candidates->fn == ansi_opname [COND_EXPR])
- cp_error ("%s %D(%T, %T, %T) <builtin>", str, candidates->fn,
+ cp_error (ec_builtin_3, str, candidates->fn,
TREE_TYPE (TREE_VEC_ELT (candidates->convs, 0)),
TREE_TYPE (TREE_VEC_ELT (candidates->convs, 1)),
TREE_TYPE (TREE_VEC_ELT (candidates->convs, 2)));
else if (TREE_VEC_LENGTH (candidates->convs) == 2)
- cp_error ("%s %D(%T, %T) <builtin>", str, candidates->fn,
+ cp_error (ec_builtin_2, str, candidates->fn,
TREE_TYPE (TREE_VEC_ELT (candidates->convs, 0)),
TREE_TYPE (TREE_VEC_ELT (candidates->convs, 1)));
else
- cp_error ("%s %D(%T) <builtin>", str, candidates->fn,
+ cp_error (ec_builtin_1, str, candidates->fn,
TREE_TYPE (TREE_VEC_ELT (candidates->convs, 0)));
}
else
- cp_error_at ("%s %+D%s", str, candidates->fn,
+ cp_error_at (ec_candidate_1, str, candidates->fn,
candidates->viable == -1 ? " <near match>" : "");
str = " ";
}
@@ -2169,7 +2168,7 @@ build_user_type_conversion_1 (totype, expr, flags)
if (candidates && ! candidates->next)
/* say why this one won't work or try to be loose */;
else
- cp_error ("no viable candidates");
+ cp_error (ec_no_viable_candidates);
}
#endif
@@ -2183,7 +2182,7 @@ build_user_type_conversion_1 (totype, expr, flags)
{
if (flags & LOOKUP_COMPLAIN)
{
- cp_error ("conversion from `%T' to `%T' is ambiguous",
+ cp_error (ec_conversion_from_to_is_ambiguous,
fromtype, totype);
print_z_candidates (candidates);
}
@@ -2249,7 +2248,7 @@ resolve_args (args)
return error_mark_node;
else if (TREE_CODE (TREE_TYPE (TREE_VALUE (t))) == VOID_TYPE)
{
- error ("invalid use of void expression");
+ cp_error (ec_invalid_use_of_void_expression);
return error_mark_node;
}
else if (TREE_CODE (TREE_VALUE (t)) == OFFSET_REF)
@@ -2302,7 +2301,7 @@ build_new_function_call (fn, args)
{
if (candidates && ! candidates->next)
return build_function_call (candidates->fn, args);
- cp_error ("no matching function for call to `%D (%A)'",
+ cp_error (ec_no_matching_function_for_call_to,
DECL_NAME (OVL_FUNCTION (fn)), args);
if (candidates)
print_z_candidates (candidates);
@@ -2313,7 +2312,7 @@ build_new_function_call (fn, args)
if (cand == 0)
{
- cp_error ("call of overloaded `%D (%A)' is ambiguous",
+ cp_error (ec_call_of_overloaded_is_ambiguous,
DECL_NAME (OVL_FUNCTION (fn)), args);
print_z_candidates (candidates);
return error_mark_node;
@@ -2348,8 +2347,8 @@ build_object_call (obj, args)
{
/* It's no good looking for an overloaded operator() on a
pointer-to-member-function. */
- cp_error ("pointer-to-member function %E cannot be called", obj);
- cp_error ("without an object; consider using .* or ->*");
+ cp_error (ec_pointertomember_function_cannot_be_called, obj);
+ cp_error (ec_without_an_object_consider_using_or);
return error_mark_node;
}
@@ -2419,7 +2418,7 @@ build_object_call (obj, args)
if (! any_viable (candidates))
{
- cp_error ("no match for call to `(%T) (%A)'", TREE_TYPE (obj), args);
+ cp_error (ec_no_match_for_call_to, TREE_TYPE (obj), args);
print_z_candidates (candidates);
return error_mark_node;
}
@@ -2429,7 +2428,7 @@ build_object_call (obj, args)
if (cand == 0)
{
- cp_error ("call of `(%T) (%A)' is ambiguous", TREE_TYPE (obj), args);
+ cp_error (ec_call_of_is_ambiguous, TREE_TYPE (obj), args);
print_z_candidates (candidates);
return error_mark_node;
}
@@ -2455,23 +2454,23 @@ op_error (code, code2, arg1, arg2, arg3, problem)
switch (code)
{
case COND_EXPR:
- cp_error ("%s for `%T ? %T : %T'", problem,
+ cp_error (ec_for_1, problem,
error_type (arg1), error_type (arg2), error_type (arg3));
break;
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
- cp_error ("%s for `%T%s'", problem, error_type (arg1), opname);
+ cp_error (ec_for_2, problem, error_type (arg1), opname);
break;
case ARRAY_REF:
- cp_error ("%s for `%T[%T]'", problem,
+ cp_error (ec_for_3, problem,
error_type (arg1), error_type (arg2));
break;
default:
if (arg2)
- cp_error ("%s for `%T %s %T'", problem,
+ cp_error (ec_for_4, problem,
error_type (arg1), opname, error_type (arg2));
else
- cp_error ("%s for `%s%T'", problem, opname, error_type (arg1));
+ cp_error (ec_for_5, problem, opname, error_type (arg1));
}
}
@@ -2496,7 +2495,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
undeclared_template<1, 5, 72>a; */
if (code == LT_EXPR && TREE_CODE (arg1) == TEMPLATE_DECL)
{
- cp_error ("`%D' must be declared before use", arg1);
+ cp_error (ec_must_be_declared_before_use, arg1);
return error_mark_node;
}
@@ -2713,7 +2712,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
/* Look for an `operator++ (int)'. If they didn't have
one, then we fall back to the old way of doing things. */
if (flags & LOOKUP_COMPLAIN)
- cp_pedwarn ("no `%D (int)' declared for postfix `%s', trying prefix operator instead",
+ cp_pedwarn (ec_no_int_declared_for_postfix_s_trying_prefix_operator_instead,
fnname, opname_tab [code]);
if (code == POSTINCREMENT_EXPR)
code = PREINCREMENT_EXPR;
@@ -2759,9 +2758,9 @@ build_new_op (code, flags, arg1, arg2, arg3)
&& candidates->next
&& ! candidates->next->next)
{
- cp_warning ("using synthesized `%#D' for copy assignment",
+ cp_warning (ec_using_synthesized_for_copy_assignment,
cand->fn);
- cp_warning_at (" where cfront would use `%#D'",
+ cp_warning_at (ec_where_cfront_would_use,
cand == candidates
? candidates->next->fn
: candidates->fn);
@@ -2796,7 +2795,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
&& (TYPE_MAIN_VARIANT (TREE_TYPE (arg1))
!= TYPE_MAIN_VARIANT (TREE_TYPE (arg2))))
{
- cp_warning ("comparison between `%#T' and `%#T'",
+ cp_warning (ec_comparison_between_and,
TREE_TYPE (arg1), TREE_TYPE (arg2));
}
break;
@@ -3023,7 +3022,7 @@ build_op_delete_call (code, addr, size, flags, placement)
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
- cp_error ("no suitable operator delete for `%T'", type);
+ cp_error (ec_no_suitable_operator_delete_for, type);
return error_mark_node;
}
@@ -3038,17 +3037,17 @@ enforce_access (basetype_path, decl)
if (access == access_private_node)
{
- cp_error_at ("`%+#D' is %s", decl,
+ cp_error_at (ec_access_is_1, decl,
TREE_PRIVATE (decl) ? "private"
: "from private base class");
- error ("within this context");
+ cp_error (ec_within_this_context);
}
else if (access == access_protected_node)
{
- cp_error_at ("`%+#D' %s", decl,
+ cp_error_at (ec_access_is_2, decl,
TREE_PROTECTED (decl) ? "is protected"
: "has protected accessibility");
- error ("within this context");
+ cp_error (ec_within_this_context);
}
}
@@ -3151,11 +3150,11 @@ convert_like (convs, expr)
if (comptypes (TREE_TYPE (expr), TREE_TYPE (convs), 1))
incomplete_type_error (expr, TREE_TYPE (expr));
else
- cp_error ("could not convert `%E' (with incomplete type `%T') to `%T'",
+ cp_error (ec_could_not_convert_with_incomplete_type_to,
expr, TREE_TYPE (expr), TREE_TYPE (convs));
}
else
- cp_error ("could not convert `%E' to `%T'",
+ cp_error (ec_could_not_convert_to,
expr, TREE_TYPE (convs));
return error_mark_node;
}
@@ -3196,7 +3195,7 @@ convert_arg_to_ellipsis (arg)
arg = cp_convert (double_type_node, arg);
else if (IS_AGGR_TYPE (TREE_TYPE (arg))
&& ! TYPE_HAS_TRIVIAL_INIT_REF (TREE_TYPE (arg)))
- cp_warning ("cannot pass objects of type `%T' through `...'",
+ cp_warning (ec_cannot_pass_objects_of_type_through,
TREE_TYPE (arg));
else
/* Convert `short' and `char' to full-size `int'. */
@@ -3296,7 +3295,7 @@ build_over_call (cand, args, flags)
char *p = (dv && dc ? "const and volatile"
: dc ? "const" : dv ? "volatile" : "");
- cp_pedwarn ("passing `%T' as `this' argument of `%#D' discards %s",
+ cp_pedwarn (ec_passing_as_this_argument_of_discards_s,
TREE_TYPE (argtype), fn, p);
}
/* [class.mfct.nonstatic]: If a nonstatic member function of a class
@@ -3348,7 +3347,7 @@ build_over_call (cand, args, flags)
/* Issue warnings about peculiar, but legal, uses of NULL. */
if (ARITHMETIC_TYPE_P (TREE_VALUE (parm))
&& TREE_VALUE (arg) == null_node)
- cp_warning ("converting NULL to non-pointer type");
+ cp_warning (ec_converting_null_to_nonpointer_type);
val = convert_like (conv, TREE_VALUE (arg));
}
@@ -3598,7 +3597,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
|| IS_SIGNATURE_REFERENCE (basetype))))
{
if ((flags & LOOKUP_COMPLAIN) && basetype != error_mark_node)
- cp_error ("request for member `%D' in `%E', which is of non-aggregate type `%T'",
+ cp_error (ec_request_for_member_in_which_is_of_nonaggregate_type,
name, instance, basetype);
return error_mark_node;
@@ -3689,7 +3688,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
/* XXX will LOOKUP_SPECULATIVELY be needed when this is done? */
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
- cp_error ("no matching function for call to `%T::%D (%A)%V'", basetype,
+ cp_error (ec_no_matching_function_for_call_to_member, basetype,
pretty_name, user_args, TREE_TYPE (TREE_TYPE (instance_ptr)));
print_z_candidates (candidates);
return error_mark_node;
@@ -3699,7 +3698,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
if (cand == 0)
{
- cp_error ("call of overloaded `%D(%A)' is ambiguous", pretty_name,
+ cp_error (ec_call_of_overloaded_is_ambiguous_2, pretty_name,
user_args);
print_z_candidates (candidates);
return error_mark_node;
@@ -3710,11 +3709,11 @@ build_new_method_call (instance, name, args, basetype_path, flags)
&& DECL_CONSTRUCTOR_P (current_function_decl)
&& ! (flags & LOOKUP_NONVIRTUAL)
&& value_member (cand->fn, get_abstract_virtuals (basetype)))
- cp_error ("abstract virtual `%#D' called from constructor", cand->fn);
+ cp_error (ec_abstract_virtual_called_from_constructor, cand->fn);
if (TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE
&& TREE_CODE (instance_ptr) == NOP_EXPR
&& TREE_OPERAND (instance_ptr, 0) == error_mark_node)
- cp_error ("cannot call member function `%D' without object", cand->fn);
+ cp_error (ec_cannot_call_member_function_without_object, cand->fn);
if (DECL_VINDEX (cand->fn) && ! (flags & LOOKUP_NONVIRTUAL)
&& ((instance == current_class_ref && (dtor_label || ctor_label))
@@ -4327,9 +4326,9 @@ joust (cand1, cand2, warn)
if (warn)
{
- cp_warning ("passing `%T' chooses `%T' over `%T'",
+ cp_warning (ec_passing_chooses_over,
type, type1, type2);
- cp_warning (" in call to `%D'", w->fn);
+ cp_warning (ec_in_call_to, w->fn);
}
else
add_warning (w, l);
@@ -4368,10 +4367,10 @@ joust (cand1, cand2, warn)
tree source = source_type (TREE_VEC_ELT (w->convs, 0));
if (! DECL_CONSTRUCTOR_P (w->fn))
source = TREE_TYPE (source);
- cp_warning ("choosing `%D' over `%D'", w->fn, l->fn);
- cp_warning (" for conversion from `%T' to `%T'",
+ cp_warning (ec_choosing_over, w->fn, l->fn);
+ cp_warning (ec_for_conversion_from_to,
source, TREE_TYPE (w->second_conv));
- cp_warning (" because conversion sequence for the argument is better");
+ cp_warning (ec_because_conversion_sequence_for_the_argument_is_better);
}
else
add_warning (w, l);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 173c69a..edc46c8 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -285,7 +285,7 @@ build_vbase_path (code, type, expr, path, nonnull)
}
else
{
- cp_error ("cannot cast up from virtual baseclass `%T'",
+ cp_error (ec_cannot_cast_up_from_virtual_baseclass,
last_virtual);
return error_mark_node;
}
@@ -859,7 +859,7 @@ prepare_fresh_vtable (binfo, for_type)
ensure that the binfo is from for_type's binfos, not from any
base type's. We can remove all this code after a while. */
if (binfo1 != binfo)
- warning ("internal inconsistency: binfo offset error for rtti");
+ cp_warning (ec_internal_inconsistency_binfo_offset_error_for_rtti);
offset = BINFO_OFFSET (binfo1);
}
@@ -925,7 +925,7 @@ modify_vtable_entry (old_entry_in_list, new_entry, fndecl)
tree base_fndecl = TREE_OPERAND (FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (old_entry_in_list)), 0);
#ifdef NOTQUITE
- cp_warning ("replaced %D with %D", DECL_ASSEMBLER_NAME (base_fndecl),
+ cp_warning (ec_replaced_with, DECL_ASSEMBLER_NAME (base_fndecl),
DECL_ASSEMBLER_NAME (fndecl));
#endif
TREE_VALUE (old_entry_in_list) = new_entry;
@@ -980,10 +980,10 @@ add_virtual_function (pv, phv, has_virtual, fndecl, t)
#ifndef DUMB_USER
if (current_class_type == 0)
- cp_warning ("internal problem, current_class_type is zero when adding `%D', please report",
+ cp_warning (ec_internal_problem_current_class_type_is_zero_when_adding_please_report,
fndecl);
if (current_class_type && t != current_class_type)
- cp_warning ("internal problem, current_class_type differs when adding `%D', please report",
+ cp_warning (ec_internal_problem_current_class_type_differs_when_adding_please_report,
fndecl);
#endif
@@ -1218,17 +1218,17 @@ delete_duplicate_fields_1 (field, fields)
{
if (TREE_CODE (field) == CONST_DECL
&& TREE_CODE (x) == CONST_DECL)
- cp_error_at ("duplicate enum value `%D'", x);
+ cp_error_at (ec_duplicate_enum_value, x);
else if (TREE_CODE (field) == CONST_DECL
|| TREE_CODE (x) == CONST_DECL)
- cp_error_at ("duplicate field `%D' (as enum and non-enum)",
+ cp_error_at (ec_duplicate_field_as_enum_and_nonenum,
x);
else if (DECL_DECLARES_TYPE_P (field)
&& DECL_DECLARES_TYPE_P (x))
{
if (comptypes (TREE_TYPE (field), TREE_TYPE (x), 1))
continue;
- cp_error_at ("duplicate nested type `%D'", x);
+ cp_error_at (ec_duplicate_nested_type, x);
}
else if (DECL_DECLARES_TYPE_P (field)
|| DECL_DECLARES_TYPE_P (x))
@@ -1239,11 +1239,11 @@ delete_duplicate_fields_1 (field, fields)
|| (TREE_CODE (x) == TYPE_DECL
&& DECL_ARTIFICIAL (x)))
continue;
- cp_error_at ("duplicate field `%D' (as type and non-type)",
+ cp_error_at (ec_duplicate_field_as_type_and_nontype,
x);
}
else
- cp_error_at ("duplicate member `%D'", x);
+ cp_error_at (ec_duplicate_member, x);
if (prev == 0)
fields = TREE_CHAIN (fields);
else
@@ -1281,9 +1281,9 @@ alter_access (t, binfo, fdecl, access)
if (TREE_VALUE (elem) != access)
{
if (TREE_CODE (TREE_TYPE (fdecl)) == FUNCTION_DECL)
- cp_error_at ("conflicting access specifications for method `%D', ignored", TREE_TYPE (fdecl));
+ cp_error_at (ec_conflicting_access_specifications_for_method_ignored, TREE_TYPE (fdecl));
else
- error ("conflicting access specifications for field `%s', ignored",
+ cp_error (ec_conflicting_access_specifications_for_field_s_ignored,
IDENTIFIER_POINTER (DECL_NAME (fdecl)));
}
else
@@ -1332,13 +1332,13 @@ handle_using_decl (using_decl, t, method_vec, fields)
if (name == constructor_name (ctype)
|| name == constructor_name_full (ctype))
- cp_error_at ("using-declaration for constructor", using_decl);
+ cp_error_at (ec_usingdeclaration_for_constructor, using_decl);
fdecl = lookup_member (binfo, name, 0, 0);
if (!fdecl)
{
- cp_error_at ("no members matching `%D' in `%#T'", using_decl, ctype);
+ cp_error_at (ec_no_members_matching_in, using_decl, ctype);
return;
}
@@ -1362,8 +1362,8 @@ handle_using_decl (using_decl, t, method_vec, fields)
if (DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)))
== name)
{
- cp_error ("cannot adjust access to `%#D' in `%#T'", fdecl, t);
- cp_error_at (" because of local method `%#D' with same name",
+ cp_error (ec_cannot_adjust_access_to_in, fdecl, t);
+ cp_error_at (ec_because_of_local_method_with_same_name,
OVL_CURRENT (TREE_VEC_ELT (method_vec, i)));
return;
}
@@ -1375,8 +1375,8 @@ handle_using_decl (using_decl, t, method_vec, fields)
for (tmp = fields; tmp; tmp = TREE_CHAIN (tmp))
if (DECL_NAME (tmp) == name)
{
- cp_error ("cannot adjust access to `%#D' in `%#T'", fdecl, t);
- cp_error_at (" because of local field `%#D' with same name", tmp);
+ cp_error (ec_cannot_adjust_access_to_in, fdecl, t);
+ cp_error_at (ec_because_of_local_field_with_same_name, tmp);
return;
}
@@ -1606,7 +1606,7 @@ finish_base_struct (t, b)
dtor is handled in finish_struct_1. */
if (warn_ecpp && ! TYPE_VIRTUAL_P (basetype)
&& TYPE_HAS_DESTRUCTOR (basetype))
- cp_warning ("base class `%#T' has a non-virtual destructor", basetype);
+ cp_warning (ec_base_class_has_a_nonvirtual_destructor, basetype);
/* If the type of basetype is incomplete, then
we already complained about that fact
@@ -1634,9 +1634,9 @@ finish_base_struct (t, b)
b->cant_have_default_ctor = 1;
if (! TYPE_HAS_CONSTRUCTOR (t))
{
- cp_pedwarn ("base `%T' with only non-default constructor",
+ cp_pedwarn (ec_base_with_only_nondefault_constructor,
basetype);
- cp_pedwarn ("in class without a constructor");
+ cp_pedwarn (ec_in_class_without_a_constructor);
}
}
@@ -2037,7 +2037,7 @@ finish_struct_methods (t, fn_fields, nonprivate_method)
}
if (nonprivate_method == 0
&& warn_ctor_dtor_privacy)
- cp_warning ("all member functions in class `%T' are private", t);
+ cp_warning (ec_all_member_functions_in_class_are_private, t);
}
/* Warn if all destructors are private (in which case this class is
@@ -2053,7 +2053,7 @@ finish_struct_methods (t, fn_fields, nonprivate_method)
&& CLASSTYPE_FRIEND_CLASSES (t) == NULL_TREE
&& DECL_FRIENDLIST (TYPE_MAIN_DECL (t)) == NULL_TREE
&& warn_ctor_dtor_privacy)
- cp_warning ("`%#T' only defines a private destructor and has no friends",
+ cp_warning (ec_only_defines_a_private_destructor_and_has_no_friends,
t);
}
@@ -2091,8 +2091,8 @@ void
duplicate_tag_error (t)
tree t;
{
- cp_error ("redefinition of `%#T'", t);
- cp_error_at ("previous definition here", t);
+ cp_error (ec_redefinition_of, t);
+ cp_error_at (ec_previous_definition_here, t);
/* Pretend we haven't defined this type. */
@@ -2247,9 +2247,9 @@ get_class_offset_1 (parent, binfo, context, t, fndecl)
&& ! tree_int_cst_equal (nrval, rval))
{
/* Only give error if the two offsets are different */
- error ("every virtual function must have a unique final overrider");
- cp_error (" found two (or more) `%T' class subobjects in `%T'", context, t);
- cp_error (" with virtual `%D' from virtual base class", fndecl);
+ cp_error (ec_every_virtual_function_must_have_a_unique_final_overrider);
+ cp_error (ec_found_two_or_more_class_subobjects_in, context, t);
+ cp_error (ec_with_virtual_from_virtual_base_class, fndecl);
return rval;
}
rval = nrval;
@@ -2396,7 +2396,7 @@ modify_one_vtable (binfo, t, fndecl, pfn)
}
#ifdef NOTQUITE
- cp_warning ("in %D", DECL_NAME (BINFO_VTABLE (binfo)));
+ cp_warning (ec_in, DECL_NAME (BINFO_VTABLE (binfo)));
#endif
modify_vtable_entry (get_vtable_entry_n (BINFO_VIRTUALS (binfo), n),
build_vtable_entry (this_offset, pfn),
@@ -2829,9 +2829,9 @@ check_for_override (decl, ctype)
path to its virtual baseclass. */
if (TREE_CODE (TREE_TYPE (decl)) == FUNCTION_TYPE)
{
- cp_error_at ("method `%D' may not be declared static",
+ cp_error_at (ec_method_may_not_be_declared_static,
decl);
- cp_error_at ("(since `%D' declared virtual in base class.)",
+ cp_error_at (ec_since_declared_virtual_in_base_class,
tmp);
break;
}
@@ -2932,8 +2932,8 @@ warn_hidden (t)
TREE_PURPOSE (base_fndecls)))
{
/* Here we know it is a hider, and no overrider exists. */
- cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls));
- cp_warning_at (" by `%D'", TREE_PURPOSE (base_fndecls));
+ cp_warning_at (ec_was_hidden, TREE_VALUE (base_fndecls));
+ cp_warning_at (ec_by, TREE_PURPOSE (base_fndecls));
}
base_fndecls = TREE_CHAIN (base_fndecls);
@@ -2966,10 +2966,10 @@ finish_struct_anon (t)
continue;
if (TREE_PRIVATE (*uelt))
- cp_pedwarn_at ("private member `%#D' in anonymous union",
+ cp_pedwarn_at (ec_private_member_in_anonymous_union,
*uelt);
else if (TREE_PROTECTED (*uelt))
- cp_pedwarn_at ("protected member `%#D' in anonymous union",
+ cp_pedwarn_at (ec_protected_member_in_anonymous_union,
*uelt);
TREE_PRIVATE (*uelt) = TREE_PRIVATE (field);
@@ -3049,12 +3049,12 @@ finish_struct_1 (t, warn_anon)
int has_pointers = 0;
if (warn_anon && code != UNION_TYPE && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
- pedwarn ("anonymous class type not used to declare any objects");
+ cp_pedwarn (ec_anonymous_class_type_not_used_to_declare_any_objects);
if (TYPE_SIZE (t))
{
if (IS_AGGR_TYPE (t))
- cp_error ("redefinition of `%#T'", t);
+ cp_error (ec_redefinition_of, t);
else
my_friendly_abort (172);
popclass (0);
@@ -3161,7 +3161,7 @@ finish_struct_1 (t, warn_anon)
check_for_override (x, t);
if (DECL_ABSTRACT_VIRTUAL_P (x) && ! DECL_VINDEX (x))
- cp_error_at ("initializer specified for non-virtual method `%D'", x);
+ cp_error_at (ec_initializer_specified_for_nonvirtual_method, x);
/* The name of the field is the original field name
Save this in auxiliary field for later overloading. */
@@ -3218,24 +3218,24 @@ finish_struct_1 (t, warn_anon)
/* ``A local class cannot have static data members.'' ARM 9.4 */
if (current_function_decl && TREE_STATIC (x))
- cp_error_at ("field `%D' in local class cannot be static", x);
+ cp_error_at (ec_field_in_local_class_cannot_be_static, x);
/* Perform error checking that did not get done in
grokdeclarator. */
if (TREE_CODE (TREE_TYPE (x)) == FUNCTION_TYPE)
{
- cp_error_at ("field `%D' invalidly declared function type",
+ cp_error_at (ec_field_invalidly_declared_function_type,
x);
TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x));
}
else if (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE)
{
- cp_error_at ("field `%D' invalidly declared method type", x);
+ cp_error_at (ec_field_invalidly_declared_method_type, x);
TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x));
}
else if (TREE_CODE (TREE_TYPE (x)) == OFFSET_TYPE)
{
- cp_error_at ("field `%D' invalidly declared offset type", x);
+ cp_error_at (ec_field_invalidly_declared_offset_type, x);
TREE_TYPE (x) = build_pointer_type (TREE_TYPE (x));
}
@@ -3260,7 +3260,7 @@ finish_struct_1 (t, warn_anon)
{
if (TREE_CODE (t) == UNION_TYPE)
/* Unions cannot have static members. */
- cp_error_at ("field `%D' declared static in union", x);
+ cp_error_at (ec_field_declared_static_in_union, x);
continue;
}
@@ -3287,9 +3287,9 @@ finish_struct_1 (t, warn_anon)
if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings)
{
if (DECL_NAME (x))
- cp_warning_at ("non-static reference `%#D' in class without a constructor", x);
+ cp_warning_at (ec_nonstatic_reference_name_in_class_without_a_constructor, x);
else
- cp_warning_at ("non-static reference in class without a constructor", x);
+ cp_warning_at (ec_nonstatic_reference_in_class_without_a_constructor, x);
}
}
@@ -3314,9 +3314,9 @@ finish_struct_1 (t, warn_anon)
&& extra_warnings)
{
if (DECL_NAME (x))
- cp_warning_at ("non-static const member `%#D' in class without a constructor", x);
+ cp_warning_at (ec_nonstatic_const_member_name_in_class_without_a_constructor, x);
else
- cp_warning_at ("non-static const member in class without a constructor", x);
+ cp_warning_at (ec_nonstatic_const_member_in_class_without_a_constructor, x);
}
}
else
@@ -3346,7 +3346,7 @@ finish_struct_1 (t, warn_anon)
if (DECL_INITIAL (x)
&& ! INTEGRAL_TYPE_P (TREE_TYPE (x)))
{
- cp_error_at ("bit-field `%#D' with non-integral type", x);
+ cp_error_at (ec_bitfield_with_nonintegral_type, x);
DECL_INITIAL (x) = NULL;
}
@@ -3367,7 +3367,7 @@ finish_struct_1 (t, warn_anon)
if (TREE_CODE (w) != INTEGER_CST)
{
- cp_error_at ("bit-field `%D' width not an integer constant",
+ cp_error_at (ec_bitfield_width_not_an_integer_constant,
x);
DECL_INITIAL (x) = NULL_TREE;
}
@@ -3375,12 +3375,12 @@ finish_struct_1 (t, warn_anon)
width < 0)
{
DECL_INITIAL (x) = NULL;
- cp_error_at ("negative width in bit-field `%D'", x);
+ cp_error_at (ec_negative_width_in_bitfield, x);
}
else if (width == 0 && DECL_NAME (x) != 0)
{
DECL_INITIAL (x) = NULL;
- cp_error_at ("zero width for bit-field `%D'", x);
+ cp_error_at (ec_zero_width_for_bitfield, x);
}
else if (width
> TYPE_PRECISION (long_long_unsigned_type_node))
@@ -3390,13 +3390,13 @@ finish_struct_1 (t, warn_anon)
DECL_INITIAL (x) = NULL;
sorry ("bit-fields larger than %d bits",
TYPE_PRECISION (long_long_unsigned_type_node));
- cp_error_at (" in declaration of `%D'", x);
+ cp_error_at (ec_in_declaration_of, x);
}
else if (width > TYPE_PRECISION (TREE_TYPE (x))
&& TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE
&& TREE_CODE (TREE_TYPE (x)) != BOOLEAN_TYPE)
{
- cp_warning_at ("width of `%D' exceeds its type", x);
+ cp_warning_at (ec_width_of_exceeds_its_type, x);
}
else if (TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE
&& ((min_precision (TYPE_MIN_VALUE (TREE_TYPE (x)),
@@ -3404,7 +3404,7 @@ finish_struct_1 (t, warn_anon)
|| (min_precision (TYPE_MAX_VALUE (TREE_TYPE (x)),
TREE_UNSIGNED (TREE_TYPE (x))) > width)))
{
- cp_warning_at ("`%D' is too small to hold all values of `%#T'",
+ cp_warning_at (ec_is_too_small_to_hold_all_values_of,
x, TREE_TYPE (x));
}
@@ -3460,7 +3460,7 @@ finish_struct_1 (t, warn_anon)
else if (TYPE_HAS_REAL_ASSIGNMENT (type))
fie = "assignment operator";
if (fie)
- cp_error_at ("member `%#D' with %s not allowed in union", x,
+ cp_error_at (ec_member_with_s_not_allowed_in_union, x,
fie);
}
else
@@ -3486,10 +3486,10 @@ finish_struct_1 (t, warn_anon)
if (! TYPE_HAS_CONSTRUCTOR (t))
{
if (DECL_NAME (x))
- cp_pedwarn_at ("member `%#D' with only non-default constructor", x);
+ cp_pedwarn_at (ec_member_decl_with_only_nondefault_constructor, x);
else
- cp_pedwarn_at ("member with only non-default constructor", x);
- cp_pedwarn_at ("in class without a constructor",
+ cp_pedwarn_at (ec_member_with_only_nondefault_constructor, x);
+ cp_pedwarn_at (ec_in_class_without_a_constructor,
x);
}
#endif
@@ -3500,7 +3500,7 @@ finish_struct_1 (t, warn_anon)
/* `build_class_init_list' does not recognize
non-FIELD_DECLs. */
if (code == UNION_TYPE && any_default_members != 0)
- cp_error_at ("multiple fields in union `%T' initialized");
+ cp_error_at (ec_multiple_fields_in_union_initialized);
any_default_members = 1;
}
}
@@ -3548,16 +3548,16 @@ finish_struct_1 (t, warn_anon)
if (has_pointers && warn_ecpp && TYPE_HAS_CONSTRUCTOR (t)
&& ! (TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t)))
{
- cp_warning ("`%#T' has pointer data members", t);
+ cp_warning (ec_has_pointer_data_members, t);
if (! TYPE_HAS_INIT_REF (t))
{
- cp_warning (" but does not override `%T(const %T&)'", t, t);
+ cp_warning (ec_but_does_not_override_const, t, t);
if (! TYPE_HAS_ASSIGN_REF (t))
- cp_warning (" or `operator=(const %T&)'", t);
+ cp_warning (ec_or_operatorconst, t);
}
else if (! TYPE_HAS_ASSIGN_REF (t))
- cp_warning (" but does not override `operator=(const %T&)'", t);
+ cp_warning (ec_but_does_not_override_operatorconst, t);
}
TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_HAS_DESTRUCTOR (t);
@@ -3630,7 +3630,7 @@ finish_struct_1 (t, warn_anon)
}
if (nonprivate_ctor == 0 && warn_ctor_dtor_privacy)
- cp_warning ("`%#T' only defines private constructors and has no friends",
+ cp_warning (ec_only_defines_private_constructors_and_has_no_friends,
t);
}
}
@@ -3727,8 +3727,8 @@ finish_struct_1 (t, warn_anon)
if (DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)))
== name)
{
- cp_error_at ("data member `%#D' conflicts with", x);
- cp_error_at ("function member `%#D'",
+ cp_error_at (ec_data_member_conflicts_with, x);
+ cp_error_at (ec_function_member,
OVL_CURRENT (TREE_VEC_ELT (method_vec, i)));
break;
}
@@ -3845,7 +3845,7 @@ finish_struct_1 (t, warn_anon)
}
#ifdef NOTQUITE
- cp_warning ("Doing hard virtuals for %T...", t);
+ cp_warning (ec_oing_hard_virtuals_for, t);
#endif
if (has_virtual > max_has_virtual)
@@ -4075,7 +4075,7 @@ finish_struct_1 (t, warn_anon)
if (warn_nonvdtor && TYPE_HAS_DESTRUCTOR (t)
&& DECL_VINDEX (TREE_VEC_ELT (method_vec, 1)) == NULL_TREE)
- cp_warning ("`%#T' has virtual functions but non-virtual destructor",
+ cp_warning (ec_has_virtual_functions_but_nonvirtual_destructor,
t);
}
@@ -4242,9 +4242,9 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon)
&& !(TREE_CODE (icv) == TYPE_DECL
&& DECL_CONTEXT (icv) == t))
{
- cp_pedwarn_at ("declaration of identifier `%D' as `%+#D'",
+ cp_pedwarn_at (ec_declaration_of_identifier_as,
name, x);
- cp_pedwarn_at ("conflicts with other use in class as `%#D'",
+ cp_pedwarn_at (ec_conflicts_with_other_use_in_class_as,
icv);
}
}
@@ -4347,7 +4347,7 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon)
if (current_class_type)
popclass (0);
else
- error ("trying to finish struct, but kicked out due to previous parse errors.");
+ cp_error (ec_trying_to_finish_struct_but_kicked_out_due_to_previous_parse_errors);
return t;
}
@@ -4787,7 +4787,7 @@ push_lang_context (name)
current_lang_name = name;
}
else
- error ("language string `\"%s\"' not recognized", IDENTIFIER_POINTER (name));
+ cp_error (ec_language_string_not_recognized, IDENTIFIER_POINTER (name));
}
/* Get out of the current language scope. */
@@ -4821,7 +4821,7 @@ validate_lhs (lhstype, complain)
else
{
if (complain)
- error ("invalid type combination for overload");
+ cp_error (ec_invalid_type_combination_for_overload);
return error_mark_node;
}
}
@@ -4849,7 +4849,7 @@ instantiate_type (lhstype, rhs, complain)
if (TREE_CODE (lhstype) == UNKNOWN_TYPE)
{
if (complain)
- error ("not enough type information");
+ cp_error (ec_not_enough_type_information);
return error_mark_node;
}
@@ -4858,7 +4858,7 @@ instantiate_type (lhstype, rhs, complain)
if (comptypes (lhstype, TREE_TYPE (rhs), 1))
return rhs;
if (complain)
- cp_error ("argument of type `%T' does not match `%T'",
+ cp_error (ec_argument_of_type_does_not_match,
TREE_TYPE (rhs), lhstype);
return error_mark_node;
}
@@ -4960,14 +4960,14 @@ instantiate_type (lhstype, rhs, complain)
if (field)
{
if (complain)
- error ("ambiguous overload for COMPONENT_REF requested");
+ cp_error (ec_ambiguous_overload_for_requested);
return error_mark_node;
}
}
else
{
if (complain)
- error ("no appropriate overload exists for COMPONENT_REF");
+ cp_error (ec_no_appropriate_overload_exists_for);
return error_mark_node;
}
#endif
@@ -5004,9 +5004,8 @@ instantiate_type (lhstype, rhs, complain)
&& TREE_CODE (lhstype) != METHOD_TYPE)
{
if (complain)
- cp_error("cannot resolve overloaded function `%D' "
- "based on non-function type",
- DECL_NAME (OVL_FUNCTION (rhs)));
+ cp_error (ec_cannot_resolve_overloaded_function,
+ DECL_NAME (OVL_FUNCTION (rhs)));
return error_mark_node;
}
@@ -5048,7 +5047,7 @@ instantiate_type (lhstype, rhs, complain)
{
if (save_elem)
{
- cp_error ("ambiguous template instantiation converting to `%#T'", lhstype);
+ cp_error (ec_ambiguous_template_instantiation_converting_to, lhstype);
return error_mark_node;
}
save_elem = instantiate_template (elem, t);
@@ -5092,11 +5091,10 @@ instantiate_type (lhstype, rhs, complain)
{
if (complain)
{
- cp_error
- ("cannot resolve overload to target type `%#T'",
+ cp_error (ec_cannot_resolve_overload_to_target_type,
lhstype);
- cp_error_at (" ambiguity between `%#D'", save_elem);
- cp_error_at (" and `%#D', at least", elem);
+ cp_error_at (ec_ambiguity_between, save_elem);
+ cp_error_at (ec_and_at_least, elem);
}
return error_mark_node;
}
@@ -5108,9 +5106,8 @@ instantiate_type (lhstype, rhs, complain)
/* We failed to find a match. */
if (complain)
{
- cp_error ("cannot resolve overload to target type `%#T'", lhstype);
- cp_error
- (" because no suitable overload of function `%D' exists",
+ cp_error (ec_cannot_resolve_overload_to_target_type, lhstype);
+ cp_error (ec_because_no_suitable_overload_of_function_exists,
DECL_NAME (OVL_FUNCTION (rhs)));
}
return error_mark_node;
@@ -5179,7 +5176,7 @@ instantiate_type (lhstype, rhs, complain)
if (elem)
{
if (complain)
- error ("ambiguous overload for overloaded method requested");
+ cp_error (ec_ambiguous_overload_for_overloaded_method_requested);
return error_mark_node;
}
mark_used (save_elem);
@@ -5204,7 +5201,7 @@ instantiate_type (lhstype, rhs, complain)
#endif
}
if (complain)
- cp_error ("no compatible member functions named `%D'", name);
+ cp_error (ec_no_compatible_member_functions_named, name);
return error_mark_node;
}
@@ -5262,7 +5259,7 @@ instantiate_type (lhstype, rhs, complain)
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
if (complain)
- error ("invalid operation on uninstantiated type");
+ cp_error (ec_invalid_operation_on_uninstantiated_type);
return error_mark_node;
case TRUTH_AND_EXPR:
@@ -5278,14 +5275,14 @@ instantiate_type (lhstype, rhs, complain)
case TRUTH_ORIF_EXPR:
case TRUTH_NOT_EXPR:
if (complain)
- error ("not enough type information");
+ cp_error (ec_not_enough_type_information);
return error_mark_node;
case COND_EXPR:
if (type_unknown_p (TREE_OPERAND (rhs, 0)))
{
if (complain)
- error ("not enough type information");
+ cp_error (ec_not_enough_type_information);
return error_mark_node;
}
TREE_OPERAND (rhs, 1)
@@ -5315,7 +5312,7 @@ instantiate_type (lhstype, rhs, complain)
else if (TREE_CODE (lhstype) != POINTER_TYPE)
{
if (complain)
- error ("type for resolving address of overloaded function must be pointer type");
+ cp_error (ec_type_for_resolving_address_of_overloaded_function_must_be_pointer_type);
return error_mark_node;
}
{
diff --git a/gcc/cp/cp-error.def b/gcc/cp/cp-error.def
new file mode 100644
index 0000000..05ffca7
--- /dev/null
+++ b/gcc/cp/cp-error.def
@@ -0,0 +1,2469 @@
+/* C++ error messages.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ Written by Mark Mitchell (mark@markmitchell.com)
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This file contains descriptions for the warning and error messages
+ issued by the C++ front-end. Each message is defined by the use of
+ the DEFERROR macro. There are two arguments to this macro. The
+ first is the "code" for the macro. These codes become enumeration
+ constants of the enumeration type cp_error_code defined in
+ cp-tree.h. The second argument is the message text itself, which
+ may contain the format specifiers (like "%D") handled by cp_thing.
+
+ Some messages are defined with the DEFERRORNUM macro. The first
+ two arguments to this macro are as for DEFERROR, but the third
+ argument is a code for another error. The implication is that the
+ new error is "the same as" the previous error; i.e., that turning
+ off one should turn off both. There's no point in using this for
+ messages that are always errors; those messages will always be
+ emitted.
+
+ Users may control what warnings are emitted by use by numeric codes
+ assigned automatically to the error messages. Therefore, when an
+ error message is removed, it should *not* be removed from this
+ list. (That will change the numeric codes assigned to all
+ subsequent error messages). Instead, just make the string the
+ constant 0; this will automatically cause an internal error if that
+ error code is ever used again. It is also safe to change the name
+ of the code, as you see fit. Similarly, you should *not* insert
+ new error codes in the middle of this list; only at the end.
+
+ There is no need to have separate message codes if the same message
+ is used as an error in some places and as a warning in others. It
+ is the use of cp_error vs. cp_warning vs ... that makes that
+ distinction.
+
+ Be careful when introducing new format specifiers into an error
+ message that you change all uses of that error code, and not just
+ the one you are looking at. The same error code may be used in
+ multiple places. */
+
+DEFERROR(ec_this_has_no_member_named,
+ "`this' has no member named `%D'")
+DEFERROR(ec_qualified_type_does_not_match_destructor_name,
+ "qualified type `%T' does not match destructor name `~%T'")
+DEFERROR(ec_type_of_does_not_match_destructor_type_type_was,
+ "type of `%E' does not match destructor type `%T' (type was `%T')")
+DEFERROR(ec_base_object_of_scoped_method_call_is_of_nonaggregate_type,
+ "base object `%E' of scoped method call is of non-aggregate type `%T'")
+DEFERROR(ec_builtin_3,
+ "%s %D(%T, %T, %T) <builtin>")
+DEFERROR(ec_builtin_2,
+ "%s %D(%T, %T) <builtin>")
+DEFERROR(ec_builtin_1,
+ "%s %D(%T) <builtin>")
+DEFERROR(ec_candidate_1,
+ "%s %+D%s")
+DEFERROR(ec_no_viable_candidates,
+ "no viable candidates")
+DEFERROR(ec_conversion_from_to_is_ambiguous,
+ "conversion from `%T' to `%T' is ambiguous")
+DEFERROR(ec_no_matching_function_for_call_to,
+ "no matching function for call to `%D (%A)'")
+DEFERROR(ec_call_of_overloaded_is_ambiguous,
+ "call of overloaded `%D (%A)' is ambiguous")
+DEFERROR(ec_pointertomember_function_cannot_be_called,
+ "pointer-to-member function %E cannot be called")
+DEFERROR(ec_without_an_object_consider_using_or,
+ "without an object; consider using .* or ->*")
+DEFERROR(ec_no_match_for_call_to,
+ "no match for call to `(%T) (%A)'")
+DEFERROR(ec_call_of_is_ambiguous,
+ "call of `(%T) (%A)' is ambiguous")
+DEFERROR(ec_for_1,
+ "%s for `%T ? %T : %T'")
+DEFERROR(ec_for_2,
+ "%s for `%T%s'")
+DEFERROR(ec_for_3,
+ "%s for `%T[%T]'")
+DEFERROR(ec_for_4,
+ "%s for `%T %s %T'")
+DEFERROR(ec_for_5,
+ "%s for `%s%T'")
+DEFERROR(ec_must_be_declared_before_use,
+ "`%D' must be declared before use")
+DEFERROR(ec_no_int_declared_for_postfix_s_trying_prefix_operator_instead,
+ "no `%D (int)' declared for postfix `%s', trying prefix operator instead")
+DEFERROR(ec_using_synthesized_for_copy_assignment,
+ "using synthesized `%#D' for copy assignment")
+DEFERROR(ec_where_cfront_would_use,
+ " where cfront would use `%#D'")
+DEFERROR(ec_comparison_between_and,
+ "comparison between `%#T' and `%#T'")
+DEFERROR(ec_no_suitable_operator_delete_for,
+ "no suitable operator delete for `%T'")
+DEFERROR(ec_access_is_1,
+ "`%+#D' is %s")
+DEFERROR(ec_access_is_2,
+ "`%+#D' %s")
+DEFERROR(ec_could_not_convert_with_incomplete_type_to,
+ "could not convert `%E' (with incomplete type `%T') to `%T'")
+DEFERROR(ec_could_not_convert_to,
+ "could not convert `%E' to `%T'")
+DEFERROR(ec_cannot_pass_objects_of_type_through,
+ "cannot pass objects of type `%T' through `...'")
+DEFERROR(ec_passing_as_this_argument_of_discards_s,
+ "passing `%T' as `this' argument of `%#D' discards %s")
+DEFERROR(ec_converting_null_to_nonpointer_type,
+ "converting NULL to non-pointer type")
+DEFERROR(ec_request_for_member_in_which_is_of_nonaggregate_type,
+ "request for member `%D' in `%E', which is of non-aggregate type `%T'")
+DEFERROR(ec_no_matching_function_for_call_to_member,
+ "no matching function for call to `%T::%D (%A)%V'")
+DEFERROR(ec_call_of_overloaded_is_ambiguous_2,
+ "call of overloaded `%D(%A)' is ambiguous")
+DEFERROR(ec_abstract_virtual_called_from_constructor,
+ "abstract virtual `%#D' called from constructor")
+DEFERROR(ec_cannot_call_member_function_without_object,
+ "cannot call member function `%D' without object")
+DEFERROR(ec_passing_chooses_over,
+ "passing `%T' chooses `%T' over `%T'")
+DEFERROR(ec_in_call_to,
+ " in call to `%D'")
+DEFERROR(ec_choosing_over,
+ "choosing `%D' over `%D'")
+DEFERROR(ec_for_conversion_from_to,
+ " for conversion from `%T' to `%T'")
+DEFERROR(ec_because_conversion_sequence_for_the_argument_is_better,
+ " because conversion sequence for the argument is better")
+DEFERROR(ec_cannot_cast_up_from_virtual_baseclass,
+ "cannot cast up from virtual baseclass `%T'")
+DEFERROR(ec_replaced_with,
+ "replaced %D with %D")
+DEFERROR(ec_internal_problem_current_class_type_is_zero_when_adding_please_report,
+ "internal problem, current_class_type is zero when adding `%D', please report")
+DEFERROR(ec_internal_problem_current_class_type_differs_when_adding_please_report,
+ "internal problem, current_class_type differs when adding `%D', please report")
+DEFERROR(ec_duplicate_enum_value,
+ "duplicate enum value `%D'")
+DEFERROR(ec_duplicate_field_as_enum_and_nonenum,
+ "duplicate field `%D' (as enum and non-enum)")
+DEFERROR(ec_duplicate_nested_type,
+ "duplicate nested type `%D'")
+DEFERROR(ec_duplicate_field_as_type_and_nontype,
+ "duplicate field `%D' (as type and non-type)")
+DEFERROR(ec_duplicate_member,
+ "duplicate member `%D'")
+DEFERROR(ec_conflicting_access_specifications_for_method_ignored,
+ "conflicting access specifications for method `%D', ignored")
+DEFERROR(ec_usingdeclaration_for_constructor,
+ "using-declaration for constructor")
+DEFERROR(ec_no_members_matching_in,
+ "no members matching `%D' in `%#T'")
+DEFERROR(ec_cannot_adjust_access_to_in,
+ "cannot adjust access to `%#D' in `%#T'")
+DEFERROR(ec_because_of_local_method_with_same_name,
+ " because of local method `%#D' with same name")
+DEFERROR(ec_because_of_local_field_with_same_name,
+ " because of local field `%#D' with same name")
+DEFERROR(ec_base_class_has_a_nonvirtual_destructor,
+ "base class `%#T' has a non-virtual destructor")
+DEFERROR(ec_base_with_only_nondefault_constructor,
+ "base `%T' with only non-default constructor")
+DEFERROR(ec_in_class_without_a_constructor,
+ "in class without a constructor")
+DEFERROR(ec_all_member_functions_in_class_are_private,
+ "all member functions in class `%T' are private")
+DEFERROR(ec_only_defines_a_private_destructor_and_has_no_friends,
+ "`%#T' only defines a private destructor and has no friends")
+DEFERROR(ec_redefinition_of,
+ "redefinition of `%#T'")
+DEFERROR(ec_previous_definition_here,
+ "previous definition here")
+DEFERROR(ec_found_two_or_more_class_subobjects_in,
+ " found two (or more) `%T' class subobjects in `%T'")
+DEFERROR(ec_with_virtual_from_virtual_base_class,
+ " with virtual `%D' from virtual base class")
+DEFERROR(ec_in,
+ "in %D")
+DEFERROR(ec_method_may_not_be_declared_static,
+ "method `%D' may not be declared static")
+DEFERROR(ec_since_declared_virtual_in_base_class,
+ "(since `%D' declared virtual in base class.)")
+DEFERROR(ec_was_hidden,
+ "`%D' was hidden")
+DEFERROR(ec_by,
+ " by `%D'")
+DEFERROR(ec_initializer_specified_for_nonvirtual_method,
+ "initializer specified for non-virtual method `%D'")
+DEFERROR(ec_field_in_local_class_cannot_be_static,
+ "field `%D' in local class cannot be static")
+DEFERROR(ec_field_invalidly_declared_function_type,
+ "field `%D' invalidly declared function type")
+DEFERROR(ec_field_invalidly_declared_method_type,
+ "field `%D' invalidly declared method type")
+DEFERROR(ec_field_invalidly_declared_offset_type,
+ "field `%D' invalidly declared offset type")
+DEFERROR(ec_field_declared_static_in_union,
+ "field `%D' declared static in union")
+DEFERROR(ec_nonstatic_reference_name_in_class_without_a_constructor,
+ "non-static reference `%#D' in class without a constructor")
+DEFERRORNUM(ec_nonstatic_reference_in_class_without_a_constructor,
+ "non-static reference in class without a constructor",
+ ec_nonstatic_reference_name_in_class_without_a_constructor)
+DEFERROR(ec_nonstatic_const_member_name_in_class_without_a_constructor,
+ "non-static const member `%#D' in class without a constructor")
+DEFERRORNUM(ec_nonstatic_const_member_in_class_without_a_constructor,
+ "non-static const member in class without a constructor",
+ ec_nonstatic_const_member_name_in_class_without_a_constructor)
+DEFERROR(ec_bitfield_with_nonintegral_type,
+ "bit-field `%#D' with non-integral type")
+DEFERROR(ec_bitfield_width_not_an_integer_constant,
+ "bit-field `%D' width not an integer constant")
+DEFERROR(ec_negative_width_in_bitfield,
+ "negative width in bit-field `%D'")
+DEFERROR(ec_zero_width_for_bitfield,
+ "zero width for bit-field `%D'")
+DEFERROR(ec_in_declaration_of,
+ " in declaration of `%D'")
+DEFERROR(ec_width_of_exceeds_its_type,
+ "width of `%D' exceeds its type")
+DEFERROR(ec_is_too_small_to_hold_all_values_of,
+ "`%D' is too small to hold all values of `%#T'")
+DEFERROR(ec_member_with_s_not_allowed_in_union,
+ "member `%#D' with %s not allowed in union")
+DEFERROR(ec_multiple_fields_in_union_initialized,
+ "multiple fields in union `%T' initialized")
+DEFERROR(ec_has_pointer_data_members,
+ "`%#T' has pointer data members")
+DEFERROR(ec_but_does_not_override_const,
+ " but does not override `%T(const %T&)'")
+DEFERROR(ec_or_operatorconst,
+ " or `operator=(const %T&)'")
+DEFERROR(ec_but_does_not_override_operatorconst,
+ " but does not override `operator=(const %T&)'")
+DEFERROR(ec_only_defines_private_constructors_and_has_no_friends,
+ "`%#T' only defines private constructors and has no friends")
+DEFERROR(ec_data_member_conflicts_with,
+ "data member `%#D' conflicts with")
+DEFERROR(ec_function_member,
+ "function member `%#D'")
+DEFERROR(ec_oing_hard_virtuals_for,
+ "Doing hard virtuals for %T...")
+DEFERROR(ec_has_virtual_functions_but_nonvirtual_destructor,
+ "`%#T' has virtual functions but non-virtual destructor")
+DEFERROR(ec_argument_of_type_does_not_match,
+ "argument of type `%T' does not match `%T'")
+DEFERROR(ec_ambiguous_template_instantiation_converting_to,
+ "ambiguous template instantiation converting to `%#T'")
+DEFERROR(ec_ambiguity_between,
+ " ambiguity between `%#D'")
+DEFERROR(ec_and_at_least,
+ " and `%#D', at least")
+DEFERROR(ec_cannot_resolve_overload_to_target_type,
+ "cannot resolve overload to target type `%#T'")
+DEFERROR(ec_no_compatible_member_functions_named,
+ "no compatible member functions named `%D'")
+DEFERROR(ec_cant_convert_from_incomplete_type_to,
+ "can't convert from incomplete type `%T' to `%T'")
+DEFERROR(ec_conversion_of_from_to_is_ambiguous,
+ "conversion of `%E' from `%T' to `%T' is ambiguous")
+DEFERROR(ec_converting_from_to,
+ "converting from `%T' to `%T'")
+DEFERROR(ec_cannot_convert_from_type_to_type,
+ "cannot convert `%E' from type `%T' to type `%T'")
+DEFERROR(ec_type_is_ambiguous_baseclass_of_s,
+ "type `%T' is ambiguous baseclass of `%s'")
+DEFERROR(ec_initialization_of_nonconst_reference_from_rvalue,
+ "initialization of non-const reference `%#T' from rvalue `%T'")
+DEFERROR(ec_conversion_to_nonconst_from_rvalue,
+ "conversion to non-const `%T' from rvalue `%T'")
+DEFERROR(ec_conversion_from_to_discards_const,
+ "conversion from `%T' to `%T' discards const")
+DEFERROR(ec_conversion_from_to_discards_volatile,
+ "conversion from `%T' to `%T' discards volatile")
+DEFERROR(ec_casting_to_does_not_dereference_pointer,
+ "casting `%T' to `%T' does not dereference pointer")
+DEFERROR(ec_initializing_nonconst_with_will_use_a_temporary,
+ "initializing non-const `%T' with `%T' will use a temporary")
+DEFERROR(ec_cannot_convert_type_to_type,
+ "cannot convert type `%T' to type `%T'")
+DEFERROR(ec_cannot_convert_a_pointer_of_type_to_a_pointer_of_type,
+ "cannot convert a pointer of type `%T' to a pointer of type `%T'")
+DEFERROR(ec_because_is_an_ambiguous_base_class,
+ "because `%T' is an ambiguous base class")
+DEFERROR(ec_conversion_from_to,
+ "conversion from `%#T' to `%#T'")
+DEFERROR(ec_used_where_a_was_expected,
+ "`%#T' used where a `%T' was expected")
+DEFERROR(ec_the_address_of_will_always_be_true,
+ "the address of `%D', will always be `true'")
+DEFERROR(ec_used_where_a_floating_point_value_was_expected,
+ "`%#T' used where a floating point value was expected")
+DEFERROR(ec_conversion_from_to_nonscalar_type_requested,
+ "conversion from `%T' to non-scalar type `%T' requested")
+DEFERROR(ec_ambiguous_default_type_conversion_from,
+ "ambiguous default type conversion from `%T'")
+DEFERROR(ec_candidate_conversions_include_and,
+ " candidate conversions include `%D' and `%D'")
+DEFERROR(ec_label_used_but_not_defined,
+ "label `%D' used but not defined")
+DEFERROR(ec_label_defined_but_not_used,
+ "label `%D' defined but not used")
+DEFERROR(ec_namespace_alias_not_allowed_here_assuming,
+ "namespace alias `%D' not allowed here, assuming `%D'")
+DEFERROR(ec_redeclared_as_member_function,
+ "`%D' redeclared as member function")
+DEFERROR(ec_redeclared_as_nonmember_function,
+ "`%D' redeclared as non-member function")
+DEFERROR(ec_shadowing_s_function,
+ "shadowing %s function `%#D'")
+DEFERROR(ec_library_function_redeclared_as_nonfunction,
+ "library function `%#D' redeclared as non-function `%#D'")
+DEFERROR(ec_declaration_of,
+ "declaration of `%#D'")
+DEFERRORNUM(ec_conflicts_with_builtin_declaration,
+ "conflicts with built-in declaration `%#D'", ec_declaration_of)
+DEFERROR(ec_redeclared_as_different_kind_of_symbol,
+ "`%#D' redeclared as different kind of symbol")
+DEFERROR(ec_previous_declaration_of,
+ "previous declaration of `%#D'")
+DEFERROR(ec_declaration_of_template,
+ "declaration of template `%#D'")
+DEFERROR(ec_conflicts_with_previous_declaration,
+ "conflicts with previous declaration `%#D'")
+DEFERROR(ec_new_declaration,
+ "new declaration `%#D'")
+DEFERROR(ec_ambiguates_old_declaration,
+ "ambiguates old declaration `%#D'")
+DEFERROR(ec_declaration_of_function_conflicts_with,
+ "declaration of C function `%#D' conflicts with")
+DEFERROR(ec_previous_declaration_here,
+ "previous declaration `%#D' here")
+DEFERROR(ec_conflicting_types_for,
+ "conflicting types for `%#D'")
+DEFERROR(ec_previous_declaration_as,
+ "previous declaration as `%#D'")
+DEFERROR(ec_prototype_for,
+ "prototype for `%#D'")
+DEFERROR(ec_follows_nonprototype_definition_here,
+ "follows non-prototype definition here")
+DEFERROR(ec_previous_declaration_of_with_linkage,
+ "previous declaration of `%#D' with %L linkage")
+DEFERROR(ec_conflicts_with_new_declaration_with_linkage,
+ "conflicts with new declaration with %L linkage")
+DEFERROR(ec_default_argument_given_for_parameter_d_of,
+ "default argument given for parameter %d of `%#D'")
+DEFERROR(ec_after_previous_specification_in,
+ "after previous specification in `%#D'")
+DEFERROR(ec_was_used_before_it_was_declared_inline,
+ "`%#D' was used before it was declared inline")
+DEFERROR(ec_previous_noninline_declaration_here,
+ "previous non-inline declaration here")
+DEFERROR(ec_type_qualifiers_for,
+ "type qualifiers for `%#D'")
+DEFERROR(ec_redundant_redeclaration_of_in_same_scope,
+ "redundant redeclaration of `%D' in same scope")
+DEFERROR(ec_invalid_redeclaration_of,
+ "invalid redeclaration of %D")
+DEFERROR(ec_declaration_of_throws_different_exceptions,
+ "declaration of `%D' throws different exceptions")
+DEFERROR(ec_explicit_specialization_of_after_first_use,
+ "explicit specialization of %D after first use")
+DEFERROR(ec_used_prior_to_declaration,
+ "`%#D' used prior to declaration")
+DEFERROR(ec_redeclaration_of_wchar_t_as,
+ "redeclaration of wchar_t as `%T'")
+DEFERROR(ec_static_missing_from_declaration_of,
+ "`static' missing from declaration of `%D'")
+DEFERROR(ec_as,
+ "as `%D'")
+DEFERROR(ec_type_mismatch_with_previous_external_decl,
+ "type mismatch with previous external decl")
+DEFERROR(ec_extern_declaration_of_doesnt_match,
+ "extern declaration of `%#D' doesn't match")
+DEFERROR(ec_global_declaration,
+ "global declaration `%#D'")
+DEFERROR(ec_declaration_of_shadows_a_parameter,
+ "declaration of `%#D' shadows a parameter")
+DEFERROR(ec_this_is_the_shadowed_declaration,
+ " this is the shadowed declaration")
+DEFERROR(ec_reusing_name_of_template_parameter_in_this_scope,
+ "re-using name of template parameter `%T' in this scope")
+DEFERROR(ec_previously_declared_here,
+ " previously declared here `%#D'")
+DEFERROR(ec_declaration_of_identifier_as,
+ "declaration of identifier `%D' as `%+#D'")
+DEFERROR(ec_hides_constructor_for,
+ "`%#D' hides constructor for `%#T'")
+DEFERROR(ec_previous_nonfunction_declaration,
+ "previous non-function declaration `%#D'")
+DEFERROR(ec_conflicts_with_function_declaration,
+ "conflicts with function declaration `%#D'")
+DEFERROR(ec_implicit_declaration_of_function,
+ "implicit declaration of function `%#D'")
+DEFERROR(ec_label_named_wchar_t,
+ "label named wchar_t")
+DEFERROR(ec_duplicate_label,
+ "duplicate label `%D'")
+DEFERROR(ec_jump_to_label,
+ "jump to label `%D'")
+DEFERROR(ec_crosses_initialization_of,
+ " crosses initialization of `%#D'")
+DEFERROR(ec_destructor_needed_for,
+ "destructor needed for `%#D'")
+DEFERROR(ec_redeclared_as,
+ "`%#D' redeclared as %C")
+DEFERROR(ec_redeclared_as_in_class_scope,
+ "`%#D' redeclared as %C in class scope")
+DEFERROR(ec_undeclared_in_namespace,
+ "`%D' undeclared in namespace `%D'")
+DEFERROR(ec_no_class_template_named_in,
+ "no class template named `%#T' in `%#T'")
+DEFERROR(ec_no_type_named_in,
+ "no type named `%#T' in `%#T'")
+DEFERROR(ec_namespacescope_type,
+ "namespace-scope type `%#D'")
+DEFERROR(ec_use_typename_if_thats_what_you_meant,
+ " (use `typename %D' if that's what you meant)")
+DEFERROR(ec_lookup_of_in_the_scope_of,
+ "lookup of `%D' in the scope of `%#T' (`%#T')")
+DEFERROR(ec_does_not_match_lookup_in_the_current_scope,
+ " does not match lookup in the current scope (`%#T')")
+DEFERROR(ec_can_only_be_specified_for_functions,
+ "`%D' can only be specified for functions")
+DEFERROR(ec_can_only_be_specified_for_constructors,
+ "`%D' can only be specified for constructors")
+DEFERROR(ec_can_only_be_specified_for_objects_and_functions,
+ "`%D' can only be specified for objects and functions")
+DEFERROR(ec_abstract_declarator_used_as_declaration,
+ "abstract declarator used as declaration")
+DEFERROR(ec_typedef_is_initialized,
+ "typedef `%D' is initialized")
+DEFERROR(ec_function_is_initialized_like_a_variable,
+ "function `%#D' is initialized like a variable")
+DEFERROR(ec_declaration_of_has_extern_and_is_initialized,
+ "declaration of `%#D' has `extern' and is initialized")
+DEFERROR(ec_is_not_a_static_member_of,
+ "`%#D' is not a static member of `%#T'")
+DEFERROR(ec_does_not_permit_to_be_defined_as,
+ "ANSI C++ does not permit `%T::%D' to be defined as `%T::%D'")
+DEFERROR(ec_duplicate_initialization_of,
+ "duplicate initialization of %D")
+DEFERROR(ec_declaration_of_outside_of_class_is_not_definition,
+ "declaration of `%#D' outside of class is not definition")
+DEFERROR(ec_variable_has_initializer_but_incomplete_type,
+ "variable `%#D' has initializer but incomplete type")
+DEFERROR(ec_elements_of_array_have_incomplete_type,
+ "elements of array `%#D' have incomplete type")
+DEFERROR(ec_aggregate_has_incomplete_type_and_cannot_be_initialized,
+ "aggregate `%#D' has incomplete type and cannot be initialized")
+DEFERROR(ec_declared_as_reference_but_not_initialized,
+ "`%D' declared as reference but not initialized")
+DEFERROR(ec_forbids_use_of_initializer_list_to_initialize_reference,
+ "ANSI C++ forbids use of initializer list to initialize reference `%D'")
+DEFERROR(ec_cannot_initialize_from,
+ "cannot initialize `%T' from `%T'")
+DEFERROR(ec_annot_initialize_to_namespace,
+ "Cannot initialize `%D' to namespace `%D'")
+DEFERROR(ec_shadowing_previous_type_declaration_of,
+ "shadowing previous type declaration of `%#D'")
+DEFERROR(ec_must_be_initialized_by_constructor_not_by,
+ "`%D' must be initialized by constructor, not by `{...}'")
+DEFERROR(ec_structure_with_uninitialized_const_members,
+ "structure `%D' with uninitialized const members")
+DEFERROR(ec_structure_with_uninitialized_reference_members,
+ "structure `%D' with uninitialized reference members")
+DEFERROR(ec_uninitialized_const,
+ "uninitialized const `%#D'")
+DEFERROR(ec_initializer_fails_to_determine_size_of,
+ "initializer fails to determine size of `%D'")
+DEFERROR(ec_array_size_missing_in,
+ "array size missing in `%D'")
+DEFERROR(ec_zerosize_array,
+ "zero-size array `%D'")
+DEFERROR(ec_storage_size_of_isnt_known,
+ "storage size of `%D' isn't known")
+DEFERROR(ec_storage_size_of_isnt_constant,
+ "storage size of `%D' isn't constant")
+DEFERROR(ec_parser_lost_in_parsing_declaration_of,
+ "parser lost in parsing declaration of `%D'")
+DEFERROR(ec_multiple_initializations_given_for,
+ "multiple initializations given for `%D'")
+DEFERROR(ec_declared_as_a_virtual_s,
+ "`%D' declared as a `virtual' %s")
+DEFERROR(ec_declared_as_an_inline_s,
+ "`%D' declared as an `inline' %s")
+DEFERROR(ec_const_and_volatile_function_specifiers_on_invalid_in_s_declaration,
+ "`const' and `volatile' function specifiers on `%D' invalid in %s declaration")
+DEFERROR(ec_invalid_friend_declaration,
+ "invalid friend declaration")
+DEFERROR(ec_invalid_exception_specifications,
+ "invalid exception specifications")
+DEFERROR(ec_nonlocal_function_uses_anonymous_type,
+ "non-local function `%#D' uses anonymous type")
+DEFERROR(ec_nonlocal_function_uses_local_type,
+ "non-local function `%#D' uses local type `%T'")
+DEFERROR(ec_smember_function_cannot_have_method_qualifier,
+ "%smember function `%D' cannot have `%T' method qualifier")
+DEFERROR(ec_templateid_in_declaration_of_primary_template,
+ "template-id `%D' in declaration of primary template")
+DEFERROR(ec_definition_of_implicitlydeclared,
+ "definition of implicitly-declared `%D'")
+DEFERROR(ec_inconsistent_declarations_for,
+ "inconsistent declarations for `%D'")
+DEFERROR(ec_nonlocal_variable_uses_local_type,
+ "non-local variable `%#D' uses local type `%T'")
+DEFERROR(ec_destructor_must_match_class_name,
+ "destructor `%T' must match class name `%T'")
+DEFERROR(ec_declaratorid_missing_using_reserved_word,
+ "declarator-id missing; using reserved word `%D'")
+DEFERROR(ec_is_not_a_valid_declarator,
+ "`%T::%D' is not a valid declarator")
+DEFERROR(ec_perhaps_you_want_typename_to_make_it_a_type,
+ " perhaps you want `typename %T::%D' to make it a type")
+DEFERROR(ec_type_is_not_derived_from_type,
+ "type `%T' is not derived from type `%T'")
+DEFERROR(ec_specified_as_declaratorid,
+ "`%T' specified as declarator-id")
+DEFERROR(ec_perhaps_you_want_for_a_constructor,
+ " perhaps you want `%T' for a constructor")
+DEFERROR(ec_as_declarator,
+ "`%D' as declarator")
+DEFERROR(ec_declaration_of_as_nonfunction,
+ "declaration of `%D' as non-function")
+DEFERROR(ec_extraneous_ignored,
+ "extraneous `%T' ignored")
+DEFERROR(ec_multiple_declarations_and,
+ "multiple declarations `%T' and `%T'")
+DEFERROR(ec_returntype_of_defaults_to_int,
+ "return-type of `%D' defaults to `int'")
+DEFERROR(ec_forbids_declaration_with_no_type,
+ "ANSI C++ forbids declaration `%D' with no type")
+DEFERROR(ec_operator_declared_to_return,
+ "operator `%T' declared to return `%T'")
+DEFERROR(ec_return_type_specified_for_operator,
+ "return type specified for `operator %T'")
+DEFERROR(ec_operator_cannot_be_cvqualified,
+ "`operator %T' cannot be cv-qualified")
+DEFERROR(ec_member_cannot_be_declared_both_virtual_and_static,
+ "member `%D' cannot be declared both virtual and static")
+DEFERROR(ec_declaration_of_as_array_of_voids,
+ "declaration of `%D' as array of voids")
+DEFERROR(ec_declaration_of_as_array_of_functions,
+ "declaration of `%D' as array of functions")
+DEFERROR(ec_cannot_make_arrays_of_references,
+ "cannot make arrays of references")
+DEFERROR(ec_declaration_of_as_array_of_references,
+ "declaration of `%D' as array of references")
+DEFERROR(ec_declaration_of_as_array_of_data_members,
+ "declaration of `%D' as array of data members")
+DEFERROR(ec_declaration_of_as_array_of_function_members,
+ "declaration of `%D' as array of function members")
+DEFERROR(ec_size_of_array_has_noninteger_type,
+ "size of array `%D' has non-integer type")
+DEFERROR(ec_forbids_zerosize_array,
+ "ANSI C++ forbids zero-size array `%D'")
+DEFERROR(ec_size_of_array_is_negative,
+ "size of array `%D' is negative")
+DEFERROR(ec_forbids_variablesize_array_name,
+ "ANSI C++ forbids variable-size array `%D'")
+DEFERROR(ec_forbids_variablesize_array,
+ "ANSI C++ forbids variable-size array")
+DEFERROR(ec_cant_define_friend_function_s_in_a_local_class_definition,
+ "can't define friend function `%s' in a local class definition")
+DEFERROR(ec_cannot_declare_pointer_to_member,
+ "cannot declare pointer to `%#T' member")
+DEFERROR(ec_empty_signature_used_in_signature_reference_declaration,
+ "empty signature `%T' used in signature reference declaration")
+DEFERROR(ec_empty_signature_used_in_signature_pointer_declaration,
+ "empty signature `%T' used in signature pointer declaration")
+DEFERROR(ec_extra_qualification_on_member_s_ignored,
+ "extra qualification `%T::' on member `%s' ignored")
+DEFERROR(ec_cannot_declare_member_function_s_within,
+ "cannot declare member function `%T::%s' within `%T'")
+DEFERROR(ec_cannot_declare_member_s_within,
+ "cannot declare member `%T::%s' within `%T'")
+DEFERROR(ec_structure_not_yet_defined,
+ "structure `%T' not yet defined")
+DEFERROR(ec_forbids_nested_type_with_same_name_as_enclosing_class,
+ "ANSI C++ forbids nested type `%D' with same name as enclosing class")
+DEFERROR(ec_typedef_name_may_not_be_classqualified,
+ "typedef name may not be class-qualified")
+DEFERROR(ec_invalid_type_qualifier_for_nonmethod_type,
+ "invalid type qualifier for non-method type")
+DEFERROR(ec_volatile_specified_for_friend_class_declaration,
+ "`volatile' specified for friend class declaration")
+DEFERROR(ec_inline_specified_for_friend_class_declaration,
+ "`inline' specified for friend class declaration")
+DEFERROR(ec_abstract_declarator_type_used_as_declaration,
+ "abstract declarator `%T' used as declaration")
+DEFERROR(ec_invalid_use_of_scope,
+ "invalid use of `::'")
+DEFERROR(ec_function_cannot_be_declared_friend,
+ "function `%D' cannot be declared friend")
+DEFERROR(ec_cant_make_into_a_method_not_in_a_class,
+ "can't make `%D' into a method -- not in a class")
+DEFERROR(ec_function_declared_virtual_inside_a_union,
+ "function `%D' declared virtual inside a union")
+DEFERROR(ec_cannot_be_declared_virtual_since_it_is_always_static,
+ "`%D' cannot be declared virtual, since it is always static")
+DEFERROR(ec_field_has_incomplete_type,
+ "field `%D' has incomplete type")
+DEFERROR(ec_name_has_incomplete_type,
+ "name `%T' has incomplete type")
+DEFERROR(ec_in_instantiation_of_template,
+ " in instantiation of template `%T'")
+DEFERROR(ec_forbids_initialization_of_s,
+ "ANSI C++ forbids initialization of %s `%D'")
+DEFERROR(ec_making_static,
+ "making `%D' static")
+DEFERROR(ec_inclass_initialization_of_static_data_member_of_nonintegral_type,
+ "in-class initialization of static data member of non-integral type `%T'")
+DEFERROR(ec_forbids_inclass_initialization_of_nonconst_static_member,
+ "ANSI C++ forbids in-class initialization of non-const static member `%D'")
+DEFERROR(ec_forbids_initialization_of_member_constant_of_nonintegral_type,
+ "ANSI C++ forbids initialization of member constant `%D' of non-integral type `%T'")
+DEFERROR(ec_forbids_static_member_with_same_name_as_enclosing_class,
+ "ANSI C++ forbids static member `%D' with same name as enclosing class")
+DEFERROR(ec_cannot_declare_member_function_to_have_static_linkage,
+ "cannot declare member function `%D' to have static linkage")
+DEFERROR(ec_static_member_redeclared_as_static,
+ "static member `%D' re-declared as static")
+DEFERROR(ec_static_member_declared_register,
+ "static member `%D' declared `register'")
+DEFERROR(ec_cannot_explicitly_declare_member_to_have_extern_linkage,
+ "cannot explicitly declare member `%#D' to have extern linkage")
+DEFERROR(ec_invalid_string_constant,
+ "invalid string constant `%E'")
+DEFERROR(ec_parameter_invalidly_declared_method_type,
+ "parameter `%D' invalidly declared method type")
+DEFERROR(ec_parameter_invalidly_declared_offset_type,
+ "parameter `%D' invalidly declared offset type")
+DEFERROR(ec_parameter_type_includes_pointer_to_array_of_unknown_bound,
+ "parameter type `%T' includes pointer to array of unknown bound")
+DEFERROR(ec_local_variable_may_not_be_used_as_a_default_argument,
+ "local variable `%D' may not be used as a default argument")
+DEFERROR(ec_invalid_type_for_default_argument_to_decl,
+ "invalid type `%T' for default argument to `%#D'")
+DEFERROR(ec_invalid_type_for_default_argument_to,
+ "invalid type `%T' for default argument to `%T'")
+DEFERROR(ec_invalid_constructor_you_probably_meant_const,
+ "invalid constructor; you probably meant `%T (const %T&)'")
+DEFERROR(ec_must_be_a_nonstatic_member_function,
+ "`%D' must be a nonstatic member function")
+DEFERROR(ec_must_be_either_a_nonstatic_member_function_or_a_nonmember_function,
+ "`%D' must be either a non-static member function or a non-member function")
+DEFERROR(ec_must_take_exactly_one_argument,
+ "`%D' must take exactly one argument")
+DEFERROR(ec_must_take_exactly_three_arguments,
+ "`%D' must take exactly three arguments")
+DEFERROR(ec_postfix_must_take_int_as_its_argument,
+ "postfix `%D' must take `int' as its argument")
+DEFERROR(ec_must_take_either_zero_or_one_argument,
+ "`%D' must take either zero or one argument")
+DEFERROR(ec_must_take_either_one_or_two_arguments,
+ "`%D' must take either one or two arguments")
+DEFERROR(ec_prefix_should_return,
+ "prefix `%D' should return `%T'")
+DEFERROR(ec_postfix_should_return,
+ "postfix `%D' should return `%T'")
+DEFERROR(ec_must_take_void,
+ "`%D' must take `void'")
+DEFERROR(ec_must_take_exactly_two_arguments,
+ "`%D' must take exactly two arguments")
+DEFERROR(ec_userdefined_always_evaluates_both_arguments,
+ "user-defined `%D' always evaluates both arguments")
+DEFERROR(ec_should_return_by_value,
+ "`%D' should return by value")
+DEFERROR(ec_cannot_have_default_arguments,
+ "`%D' cannot have default arguments")
+DEFERROR(ec_redeclaration_of_template_typeparameter,
+ "redeclaration of template type-parameter `%T'")
+DEFERROR(ec_use_of_enum_without_previous_declaration,
+ "use of enum `%#D' without previous declaration")
+DEFERROR(ec_derived_union_invalid,
+ "derived union `%T' invalid")
+DEFERROR(ec_base_type_fails_to_be_a_struct_or_class_type,
+ "base type `%T' fails to be a struct or class type")
+DEFERROR(ec_base_class_has_incomplete_type,
+ "base class `%T' has incomplete type")
+DEFERROR(ec_recursive_type_undefined,
+ "recursive type `%T' undefined")
+DEFERROR(ec_duplicate_base_type_invalid,
+ "duplicate base type `%T' invalid")
+DEFERROR(ec_multiple_definition_of,
+ "multiple definition of `%#T'")
+DEFERROR(ec_enumerator_value_for_not_integer_constant,
+ "enumerator value for `%D' not integer constant")
+DEFERROR(ec_overflow_in_enumeration_values_at,
+ "overflow in enumeration values at `%D'")
+DEFERROR(ec_redeclaration_of,
+ "redeclaration of `%#D'")
+DEFERROR(ec_semicolon_missing_after_declaration_of,
+ "semicolon missing after declaration of `%#T'")
+DEFERROR(ec_implicitly_declared_before_its_definition,
+ "`%D' implicitly declared before its definition")
+DEFERROR(ec_returntype_is_an_incomplete_type,
+ "return-type `%#T' is an incomplete type")
+DEFERROR(ec_operator_should_return_a_reference_to_this,
+ "`operator=' should return a reference to `*this'")
+DEFERROR(ec_parameter_declared_void,
+ "parameter `%D' declared void")
+DEFERROR(ec_return_identifier_already_in_place,
+ "return identifier `%D' already in place")
+DEFERROR(ec_noreturn_function_does_return,
+ "`noreturn' function `%D' does return")
+DEFERROR(ec_control_reaches_end_of_nonvoid_function,
+ "control reaches end of non-void function `%D'")
+DEFERROR(ec_is_already_defined_in_class,
+ "`%D' is already defined in class %s")
+DEFERROR(ec_reference_not_call_to_function,
+ "reference, not call, to function `%D'")
+DEFERROR(ec_static_member_function_declared_const,
+ "static member function `%#D' declared const")
+DEFERROR(ec_static_member_function_declared_volatile,
+ "static member function `%#D' declared volatile")
+DEFERROR(ec_template_instantiated_in_file_without_pragma_interface,
+ "template `%#D' instantiated in file without #pragma interface")
+DEFERROR(ec_template_defined_in_file_without_pragma_interface,
+ "template `%#D' defined in file without #pragma interface")
+DEFERROR(ec_invalid_types_for_array_subscript,
+ "invalid types `%T[%T]' for array subscript")
+DEFERROR(ec_type_argument_given_to_delete_expected_pointer,
+ "type `%#T' argument given to `delete', expected pointer")
+DEFERROR(ec_deleting_array,
+ "deleting array `%#D'")
+DEFERROR(ec_declaration_of_member_template_in_local_class,
+ "declaration of member template `%#D' in local class")
+DEFERROR(ec_template_declaration_of,
+ "template declaration of `%#D'")
+DEFERROR(ec_ava_method_has_nonava_return_type,
+ "Java method '%D' has non-Java return type `%T'")
+DEFERROR(ec_ava_method_has_nonava_parameter_type,
+ "Java method '%D' has non-Java parameter type `%T'")
+DEFERROR(ec_prototype_for_does_not_match_any_in_class,
+ "prototype for `%#D' does not match any in class `%T'")
+DEFERROR(ec_candidates,
+ "candidate%s: %+#D")
+DEFERROR(ec_candidate_2,
+ " %#D")
+DEFERROR(ec_no_member_function_declared_in_class,
+ "no `%#D' member function declared in class `%T'")
+DEFERROR(ec_member_conflicts_with_virtual_function_table_field_name,
+ "member `%D' conflicts with virtual function table field name")
+DEFERROR(ec_is_already_defined_in_the_class,
+ "`%D' is already defined in the class %T")
+DEFERROR(ec_redeclaration_of_template_parameter,
+ "redeclaration of template parameter `%T'")
+DEFERROR(ec_method_of_local_class_must_be_defined_in_class_body,
+ "method `%#D' of local class must be defined in class body")
+DEFERROR(ec_cannot_declare_to_be_a_bitfield_type,
+ "cannot declare `%D' to be a bitfield type")
+DEFERROR(ec_cannot_declare_bitfield_with_funcion_type,
+ "cannot declare bitfield `%D' with funcion type")
+DEFERROR(ec_static_member_cannot_be_a_bitfield,
+ "static member `%D' cannot be a bitfield")
+DEFERROR(ec_initializer_specified_for_nonmember_function,
+ "initializer specified for non-member function `%D'")
+DEFERROR(ec_invalid_initializer_for_virtual_method,
+ "invalid initializer for virtual method `%D'")
+DEFERROR(ec_init_priority_for_ignored_without_finitpriority,
+ "init_priority for `%#D' ignored without -finit-priority")
+DEFERROR(ec_case_label_does_not_reduce_to_an_integer_constant,
+ "case label `%E' does not reduce to an integer constant")
+DEFERROR(ec_use_of_is_ambiguous,
+ "use of `%D' is ambiguous")
+DEFERROR(ec_first_declared_as_here,
+ " first declared as `%#D' here")
+DEFERROR(ec_also_declared_as_here,
+ " also declared as `%#D' here")
+DEFERROR(ec_denotes_an_ambiguous_type,
+ "`%D' denotes an ambiguous type")
+DEFERROR(ec_first_type_here,
+ " first type here")
+DEFERROR(ec_other_type_here,
+ " other type here")
+DEFERROR(ec_declaration_of_not_in_a_namespace_surrounding,
+ "declaration of `%D' not in a namespace surrounding `%D'")
+DEFERROR(ec_should_have_been_declared_inside,
+ "`%D' should have been declared inside `%D'")
+DEFERROR(ec_is_not_a_function,
+ "`%D' is not a function,")
+DEFERROR(ec_conflict_with,
+ " conflict with `%D'")
+DEFERROR(ec_unknown_namespace,
+ "unknown namespace `%D'")
+DEFERROR(ec_not_declared,
+ "`%D' not declared")
+DEFERROR(ec_using_directive_introduced_ambiguous_type,
+ "using directive `%D' introduced ambiguous type `%T'")
+DEFERROR(ec_usingdeclaration_for_nonmember_at_class_scope,
+ "using-declaration for non-member at class scope")
+DEFERROR(ec_usingdeclaration_for_destructor,
+ "using-declaration for destructor")
+DEFERROR(ec_namespace_undeclared,
+ "namespace `%T' undeclared")
+DEFERROR(ec_is_not_a_namespace,
+ "`%T' is not a namespace")
+DEFERROR(ec_default_argument_missing_for_parameter_of,
+ "default argument missing for parameter %P of `%+#D'")
+DEFERROR(ec_does_not_have_a_nested_type_named,
+ "`%T' does not have a nested type named `%D'")
+DEFERROR(ec_no_filescope_type_named,
+ "no file-scope type named `%D'")
+DEFERROR(ec_throwing_which_has_integral_not_pointer_type,
+ "throwing NULL, which has integral, not pointer type")
+DEFERROR(ec_case_label_not_within_a_switch_statement,
+ "case label `%E' not within a switch statement")
+DEFERROR(ec_this_is_the_first_entry_overlapping_that_value,
+ "this is the first entry overlapping that value")
+DEFERROR(ec_duplicate_case_value,
+ "duplicate case value `%E'")
+DEFERROR(ec_previously_used_here,
+ "previously used here")
+DEFERROR(ec_this_is_the_first_default_label,
+ "this is the first default label")
+DEFERROR(ec_case_label_within_scope_of_cleanup_or_variable_array,
+ "case label `%E' within scope of cleanup or variable array")
+DEFERROR(ec_is_already_a_friend_of_class,
+ "`%D' is already a friend of class `%T'")
+DEFERROR(ec_previous_friend_declaration_of,
+ "previous friend declaration of `%D'")
+DEFERROR(ec_partial_specialization_declared_friend,
+ "partial specialization `%T' declared `friend'")
+DEFERROR(ec_is_already_a_friend_of,
+ "`%T' is already a friend of `%T'")
+DEFERROR(ec_member_declared_as_friend_before_type_defined,
+ "member `%D' declared as friend before type `%T' defined")
+DEFERROR(ec_method_is_not_a_member_of_class,
+ "method `%D' is not a member of class `%T'")
+DEFERROR(ec_friend_declaration,
+ "friend declaration `%#D'")
+DEFERROR(ec_implicitly_declaring_as_struct,
+ "implicitly declaring `%T' as struct")
+DEFERROR(ec_friend_archaic_use_friend_class_instead,
+ "`friend %T' archaic, use `friend class %T' instead")
+DEFERROR(ec_defaultinitialization_of_which_has_reference_type,
+ "default-initialization of `%#D', which has reference type")
+DEFERROR(ec_uninitialized_reference_member,
+ "uninitialized reference member `%D'")
+DEFERROR(ec_member_initializers_for,
+ "member initializers for `%#D'")
+DEFERROR(ec_and,
+ " and `%#D'")
+DEFERROR(ec_multiple_initializations_given_for_member,
+ "multiple initializations given for member `%D'")
+DEFERROR(ec_does_not_have_a_base_class_to_initialize,
+ "`%T' does not have a base class to initialize")
+DEFERROR(ec_unnamed_initializer_ambiguous_for_which_uses_multiple_inheritance,
+ "unnamed initializer ambiguous for `%T' which uses multiple inheritance")
+DEFERROR(ec_is_not_an_immediate_base_class_of,
+ "`%T' is not an immediate base class of `%T'")
+DEFERROR(ec_base_initializers_for,
+ "base initializers for `%#T'")
+DEFERROR(ec_and_type,
+ " and `%#T'")
+DEFERROR(ec_base_class_should_be_explicitly_initialized_in_the_copy_constructor,
+ "base class `%#T' should be explicitly initialized in the copy constructor")
+DEFERROR(ec_should_be_initialized_in_the_member_initialization_list,
+ "`%D' should be initialized in the member initialization list")
+DEFERROR(ec_field_not_in_immediate_context,
+ "field `%D' not in immediate context")
+DEFERROR(ec_field_used_before_initialized_after_assignment_to_this,
+ "field `%D' used before initialized (after assignment to `this')")
+DEFERROR(ec_class_does_not_have_any_field_named_s,
+ "class `%T' does not have any field named `%s'")
+DEFERROR(ec_field_is_static_only_point_of_initialization_is_its_declaration,
+ "field `%#D' is static; only point of initialization is its declaration")
+DEFERROR(ec_type_uses_multiple_inheritance,
+ "(type `%T' uses multiple inheritance)")
+DEFERROR(ec_type_is_not_an_immediate_or_virtual_basetype_for,
+ "type `%T' is not an immediate or virtual basetype for `%T'")
+DEFERROR(ec_type_is_not_an_immediate_basetype_for,
+ "type `%T' is not an immediate basetype for `%T'")
+DEFERROR(ec_base_class_already_initialized,
+ "base class `%T' already initialized")
+DEFERROR(ec_base_initializer_for,
+ "base initializer for `%T'")
+DEFERROR(ec_field_already_initialized,
+ "field `%D' already initialized")
+DEFERROR(ec_is_not_an_aggregate_typedef,
+ "`%T' is not an aggregate typedef")
+DEFERROR(ec_is_not_an_aggregate_type,
+ "`%T' is not an aggregate type")
+DEFERROR(ec_fails_to_be_an_aggregate_typedef,
+ "`%T' fails to be an aggregate typedef")
+DEFERROR(ec_type_is_of_nonaggregate_type,
+ "type `%T' is of non-aggregate type")
+DEFERROR(ec_cannot_call_destructor_without_object,
+ "cannot call destructor `%T::~%T' without object")
+DEFERROR(ec_invalid_use_of_nonstatic_field,
+ "invalid use of non-static field `%D'")
+DEFERROR(ec_invalid_use_of_member,
+ "invalid use of member `%D'")
+DEFERROR(ec_no_method,
+ "no method `%T::%D'")
+DEFERROR(ec_incomplete_type_does_not_have_member,
+ "incomplete type `%T' does not have member `%D'")
+DEFERROR(ec_member_function_is_protected,
+ "member function `%#D' is protected")
+DEFERROR(ec_member_function_is_private,
+ "member function `%#D' is private")
+DEFERROR(ec_is_not_a_member_of_type,
+ "`%D' is not a member of type `%T'")
+DEFERROR(ec_illegal_pointer_to_bit_field,
+ "illegal pointer to bit field `%D'")
+DEFERROR(ec_assuming_on_overloaded_member_function,
+ "assuming & on overloaded member function")
+DEFERROR(ec_member_is_nonstatic_but_referenced_as_a_static_member,
+ "member `%D' is non-static but referenced as a static member")
+DEFERROR(ec_member_is_s,
+ "member `%D' is %s")
+DEFERROR(ec_in_this_context,
+ "in this context")
+DEFERROR(ec_object_missing_in,
+ "object missing in `%E'")
+DEFERROR(ec_initialization_in_array_new,
+ "initialization in array new")
+DEFERROR(ec_uninitialized_const_in_new_of,
+ "uninitialized const in `new' of `%#T'")
+DEFERROR(ec_invalid_use_of_member_from_base_class,
+ "invalid use of member `%D' from base class `%T'")
+DEFERROR(ec_not_defined,
+ "`%D' not defined")
+DEFERROR(ec_was_not_declared_in_this_scope,
+ "`%D' was not declared in this scope")
+DEFERROR(ec_undeclared_first_use_this_function,
+ "`%D' undeclared (first use this function)")
+DEFERROR(ec_matches_this_under_current_rules,
+ " matches this `%D' under current ANSI rules")
+DEFERROR(ec_matches_this_under_old_rules,
+ " matches this `%D' under old rules")
+DEFERROR(ec_cannot_use_obsolete_binding_at_because_it_has_a_destructor,
+ " cannot use obsolete binding at `%D' because it has a destructor")
+DEFERROR(ec_enum_is_private,
+ "enum `%D' is private")
+DEFERROR(ec_undeclared_first_use_here,
+ "`::%D' undeclared (first use here)")
+DEFERROR(ec_invalid_use_of_member_in_static_member_function,
+ "invalid use of member `%D' in static member function")
+DEFERROR(ec_use_of_namespace_as_expression,
+ "use of namespace `%D' as expression")
+DEFERROR(ec_use_of_class_template_as_expression,
+ "use of class template `%T' as expression")
+DEFERROR(ec_use_of_s_from_containing_function,
+ "use of %s from containing function")
+DEFERROR(ec_declared_here,
+ " `%#D' declared here")
+DEFERROR(ec_implementationreserved_name_used,
+ "implementation-reserved name `%D' used")
+DEFERROR(ec_generic_thunk_code_fails_for_method_which_uses,
+ "generic thunk code fails for method `%#D' which uses `...'")
+DEFERROR(ec_in_default_copy_constructor,
+ "in default copy constructor")
+DEFERROR(ec_nonstatic_const_member_cant_use_default_assignment_operator,
+ "non-static const member `%#D', can't use default assignment operator")
+DEFERROR(ec_nonstatic_const_member_in_type_cant_use_default_assignment_operator,
+ "non-static const member in type `%T', can't use default assignment operator")
+DEFERROR(ec_nonstatic_reference_member_cant_use_default_assignment_operator,
+ "non-static reference member `%#D', can't use default assignment operator")
+DEFERROR(ec_nonstatic_reference_member_in_type_cant_use_default_assignment_operator,
+ "non-static reference member in type `%T', can't use default assignment operator")
+DEFERROR(ec_use_of_linkage_spec_is_different_from_previous_spec,
+ "use of linkage spec `%D' is different from previous spec `%D'")
+DEFERROR(ec_definition_of_class_in_condition,
+ "definition of class `%T' in condition")
+DEFERROR(ec_definition_of_enum_in_condition,
+ "definition of enum `%T' in condition")
+DEFERROR(ec_definition_of_array_in_condition,
+ "definition of array `%#D' in condition")
+DEFERROR(ec_old_style_placement_syntax_use_instead,
+ "old style placement syntax, use () instead")
+DEFERROR(ec_is_not_a_valid_expression,
+ "`%T' is not a valid expression")
+DEFERROR(ec_using_typename_outside_of_template,
+ "using `typename' outside of template")
+DEFERROR(ec_is_not_a_class_type,
+ "%T is not a class type")
+DEFERROR(ec_base_clause_without_member_specification_for,
+ "base clause without member specification for `%#T'")
+DEFERROR(ec_union_tag_used_in_declaring,
+ "`union' tag used in declaring `%#T'")
+DEFERROR(ec_nonunion_tag_used_in_declaring,
+ "non-`union' tag used in declaring `%#T'")
+DEFERROR(ec_access,
+ "`%D' access")
+DEFERROR(ec_is_not_a_class_or_namespace,
+ "`%T' is not a class or namespace")
+DEFERROR(ec_perhaps_you_want_typename_expr_to_make_it_a_type,
+ " perhaps you want `typename %E' to make it a type")
+DEFERROR(ec_invalid_member_template_declaration,
+ "invalid member template declaration `%D'")
+DEFERROR(ec_explicit_specialization_in_nonnamespace_scope,
+ "explicit specialization in non-namespace scope `%D'")
+DEFERROR(ec_enclosing_class_templates_are_not_explicit_specialized,
+ "enclosing class templates are not explicitly specialized")
+DEFERROR(ec_specialization_of_type_after_instantiation,
+ "specialization of `%T' after instantiation")
+DEFERROR(ec_specialization_of_decl_after_instantiation,
+ "specialization of `%D' after instantiation")
+DEFERROR(ec_decl,
+ "%s %+#D")
+DEFERROR(ec_templateid_for_does_not_match_any_template_declaration,
+ "template-id `%D' for `%+D' does not match any template declaration")
+DEFERROR(ec_ambiguous_template_specialization_for,
+ "ambiguous template specialization `%D' for `%+D'")
+DEFERROR(ec_too_many_template_parameter_lists_in_declaration_of,
+ "too many template parameter lists in declaration of `%D'")
+DEFERROR(ec_template_parameter_list_used_in_explicit_instantiation,
+ "template parameter list used in explicit instantiation")
+DEFERROR(ec_definition_provided_for_explicit_instantiation,
+ "definition provided for explicit instantiation")
+DEFERROR(ec_template_parameters_specified_in_specialization,
+ "template parameters specified in specialization")
+DEFERROR(ec_specialization_of_implicitlydeclared_special_member_function,
+ "specialization of implicitly-declared special member function")
+DEFERROR(ec_no_member_function_s_declared_in,
+ "no member function `%s' declared in `%T'")
+DEFERROR(ec_too_many_template_parameter_lists_in_declaration_of_type,
+ "too many template parameter lists in declaration of `%T'")
+DEFERROR(ec_is_not_a_valid_type_for_a_template_constant_parameter,
+ "`%#T' is not a valid type for a template constant parameter")
+DEFERROR(ec_default_argument_in_partial_specialization,
+ "default argument in partial specialization `%T'")
+DEFERROR(ec_template_parameters_not_used_in_partial_specialization,
+ "template parameters not used in partial specialization:")
+DEFERROR(ec_template_parm,
+ " `%D'")
+DEFERROR(ec_partial_specialization_does_not_specialize_any_template_arguments,
+ "partial specialization `%T' does not specialize any template arguments")
+DEFERROR(ec_template_argument_involves_template_parameters,
+ "template argument `%E' involves template parameter(s)")
+DEFERROR(ec_type_of_template_argument_depends_on_template_paramters,
+ "type `%T' of template argument `%E' depends on template paramter(s)")
+DEFERROR(ec_template_with_linkage,
+ "template with C linkage")
+DEFERROR(ec_template_class_without_a_name,
+ "template class without a name")
+DEFERROR(ec_template_declaration_of_type,
+ "template declaration of `%#T'")
+DEFERROR(ec_must_specialize_before_defining_member,
+ "must specialize `%#T' before defining member `%#D'")
+DEFERROR(ec_does_not_declare_a_template_type,
+ "`%D' does not declare a template type")
+DEFERROR(ec_template_definition_of_nontemplate,
+ "template definition of non-template `%#D'")
+DEFERROR(ec_got_d_template_parameters_for,
+ "got %d template parameters for `%#D'")
+DEFERROR(ec_but_d_required,
+ " but %d required")
+DEFERROR(ec_but_has_d,
+ " but `%#T' has %d")
+DEFERROR(ec_previous_declaration,
+ "previous declaration `%D'")
+DEFERROR(ec_used_d_template_parameters_instead_of_d,
+ "used %d template parameter%s instead of %d")
+DEFERROR(ec_template_parameter,
+ "template parameter `%#D'")
+DEFERROR(ec_redeclared_here_as,
+ "redeclared here as `%#D'")
+DEFERROR(ec_redefinition_of_default_argument_for,
+ "redefinition of default argument for `%#D'")
+DEFERROR(ec_original_definition_appeared_here,
+ " original definition appeared here")
+DEFERROR(ec_nonconstant_cannot_be_used_as_template_argument,
+ "non-constant `%E' cannot be used as template argument")
+DEFERROR(ec_is_not_a_valid_template_argument,
+ "`%E' is not a valid template argument")
+DEFERROR(ec_string_literal_is_not_a_valid_template_argument,
+ "string literal %E is not a valid template argument")
+DEFERROR(ec_address_of_nonextern_cannot_be_used_as_template_argument,
+ "address of non-extern `%E' cannot be used as template argument")
+DEFERROR(ec_object_cannot_be_used_as_template_argument,
+ "object `%E' cannot be used as template argument")
+DEFERROR(ec_to_refer_to_a_type_member_of_a_template_parameter,
+ "to refer to a type member of a template parameter,")
+DEFERROR(ec_use_typename,
+ " use `typename %E'")
+DEFERROR(ec_typevalue_mismatch_at_argument_d_in_template_parameter_list_for,
+ "type/value mismatch at argument %d in template parameter list for `%D'")
+DEFERROR(ec_expected_a_constant_of_type_got,
+ " expected a constant of type `%T', got `%T'")
+DEFERROR(ec_expected_a_type_got_expr,
+ " expected a type, got `%E'")
+DEFERROR(ec_expected_a_type_got_type,
+ " expected a type, got `%T'")
+DEFERROR(ec_expected_a_class_template_got,
+ " expected a class template, got `%T'")
+DEFERROR(ec_expected_a_template_of_type_got,
+ " expected a template of type `%D', got `%D'")
+DEFERROR(ec_could_not_convert_template_argument_to,
+ "could not convert template argument `%E' to `%T'")
+DEFERROR(ec_wrong_number_of_template_arguments_d_should_be_d,
+ "wrong number of template arguments (%d, should be %d)")
+DEFERROR(ec_provided_for,
+ "provided for `%D'")
+DEFERROR(ec_template_argument_d_is_invalid,
+ "template argument %d is invalid")
+DEFERROR(ec_nontemplate_used_as_template,
+ "non-template used as template")
+DEFERROR(ec_nontemplate_type_used_as_a_template,
+ "non-template type `%T' used as a template")
+DEFERROR(ec_for_template_declaration,
+ "for template declaration `%D'")
+DEFERROR(ec_invalid_use_of,
+ "invalid use of `%D'")
+DEFERROR(ec_instantiating,
+ " instantiating `%D'")
+DEFERROR(ec_ambiguous_class_template_instantiation_for,
+ "ambiguous class template instantiation for `%#T'")
+DEFERROR(ec_type,
+ "%s %+#T")
+DEFERROR(ec_base_class_of_has_incomplete_type,
+ "base class `%T' of `%T' has incomplete type")
+DEFERROR(ec_instantiation_of_as_type_void,
+ "instantiation of `%D' as type void")
+DEFERROR(ec_cannot_form_type_s_to_reference_type_during_template_instantiation,
+ "cannot form type %s to reference type %T during template instantiation")
+DEFERROR(ec_type_composed_from_a_local_class_is_not_a_valid_templateargument,
+ "type `%T' composed from a local class is not a valid template-argument")
+DEFERROR(ec_trying_to_instantiate,
+ " trying to instantiate `%D'")
+DEFERROR(ec_explicit_instantiation_of_nontemplate,
+ "explicit instantiation of non-template `%#D'")
+DEFERROR(ec_no_matching_template_for_found,
+ "no matching template for `%D' found")
+DEFERROR(ec_explicit_instantiation_of,
+ "explicit instantiation of `%#D'")
+DEFERROR(ec_explicit_instantiation_of_after,
+ "explicit instantiation of `%#D' after")
+DEFERROR(ec_explicit_specialization_here,
+ "explicit specialization here")
+DEFERROR(ec_duplicate_explicit_instantiation_of,
+ "duplicate explicit instantiation of `%#D'")
+DEFERROR(ec_forbids_the_use_of_extern_on_explicit_instantiations,
+ "ANSI C++ forbids the use of `extern' on explicit instantiations")
+DEFERROR(ec_explicit_instantiation_of_nontemplate_type,
+ "explicit instantiation of non-template type `%T'")
+DEFERROR(ec_explicit_instantiation_of_before_definition_of_template,
+ "explicit instantiation of `%#T' before definition of template")
+DEFERROR(ec_storage_class_applied_to_template_instantiation,
+ "storage class `%D' applied to template instantiation")
+DEFERROR(ec_explicit_instantiation_of_type_after,
+ "explicit instantiation of `%#T' after")
+DEFERROR(ec_duplicate_explicit_instantiation_of_type,
+ "duplicate explicit instantiation of `%#T'")
+DEFERROR(ec_explicit_instantiation_of_but_no_definition_available,
+ "explicit instantiation of `%D' but no definition available")
+DEFERROR(ec_ambiguous_template_instantiation_for,
+ "ambiguous template instantiation for `%D'")
+DEFERROR(ec_dynamic_cast_of_to_can_never_succeed,
+ "dynamic_cast of `%#D' to `%#T' can never succeed")
+DEFERROR(ec_cannot_dynamic_cast_of_type_to_type,
+ "cannot dynamic_cast `%E' (of type `%#T') to type `%#T'")
+DEFERROR(ec_fields_of_are_inaccessible_in_due_to_private_inheritance,
+ "fields of `%T' are inaccessible in `%T' due to private inheritance")
+DEFERROR(ec_type_is_ambiguous_base_class_for_type,
+ "type `%T' is ambiguous base class for type `%T'")
+DEFERROR(ec_assignment_to_nonstatic_member_of_enclosing_class,
+ "assignment to non-static member `%D' of enclosing class `%T'")
+DEFERROR(ec_overriding,
+ " overriding `%#D'")
+DEFERROR(ec_with,
+ " with `%#D'")
+DEFERROR(ec_conflicting_return_type_specified_for_virtual_function,
+ "conflicting return type specified for virtual function `%#D'")
+DEFERROR(ec_overriding_definition_as,
+ " overriding definition as `%#D'")
+DEFERROR(ec_member_is_shadowed,
+ "member `%#D' is shadowed")
+DEFERROR(ec_by_member_function,
+ "by member function `%#D'")
+DEFERROR(ec_break_statement_not_within_loop_or_switch,
+ "break statement not within loop or switch")
+DEFERROR(ec_continue_statement_not_within_a_loop,
+ "continue statement not within a loop")
+DEFERROR(ec_qualifier_ignored_on_asm,
+ "%s qualifier ignored on asm")
+DEFERROR(ec_calling_type_like_a_method,
+ "calling type `%T' like a method")
+DEFERROR(ec_destructor_specifier_must_have_matching_names,
+ "destructor specifier `%T::~%T' must have matching names")
+DEFERROR(ec_is_not_of_type,
+ "`%E' is not of type `%T'")
+DEFERROR(ec_class_does_not_contain_type,
+ "class `%T' does not contain type `%T'")
+DEFERROR(ec_class_does_not_contain_method,
+ "class `%T' does not contain method `%D'")
+DEFERROR(ec_undefined_signature_used_in_signature_s_declaration,
+ "undefined signature `%T' used in signature %s declaration")
+DEFERROR(ec_direct_base_inaccessible_in_due_to_ambiguity,
+ "direct base `%T' inaccessible in `%T' due to ambiguity")
+DEFERROR(ec_virtual_base_inaccessible_in_due_to_ambiguity,
+ "virtual base `%T' inaccessible in `%T' due to ambiguity")
+DEFERROR(ec_prohibits_conversion_from_to,
+ "ANSI C++ prohibits conversion from `(%#T)' to `(...)'")
+DEFERROR(ec_sizeof_applied_to_incomplete_type,
+ "`sizeof' applied to incomplete type `%T'")
+DEFERROR(ec_assuming_on,
+ "assuming & on `%E'")
+DEFERROR(ec_deprecated_conversion_from_string_constant_to_char,
+ "deprecated conversion from string constant to `char *'")
+DEFERROR(ec_request_for_member_in_expression_of_nonaggregate_type,
+ "request for member `%T::%D' in expression of non-aggregate type `%T'")
+DEFERROR(ec_type_has_no_destructor,
+ "type `%T' has no destructor")
+DEFERROR(ec_invalid_use_of_type_decl_as_expression,
+ "invalid use of type decl `%#D' as expression")
+DEFERROR(ec_has_no_member_named,
+ "`%#T' has no member named `%D'")
+DEFERROR(ec_function_declared_overloaded_but_no_definitions_appear_with_which_to_resolve_it,
+ "function `%D' declared overloaded, but no definitions appear with which to resolve it?!?")
+DEFERROR(ec_must_use_or_to_call_pointertomember_function_in,
+ "must use .* or ->* to call pointer-to-member function in `%E (...)'")
+DEFERROR(ec_cannot_be_used_as_a_function,
+ "`%E' cannot be used as a function")
+DEFERROR(ec_too_many_arguments_to_s,
+ "too many arguments to %s `%+D'")
+DEFERROR(ec_insufficient_type_information_to_resolve_address_of_overloaded_function,
+ "insufficient type information to resolve address of overloaded function `%D'")
+DEFERROR(ec_division_by_zero_in_div,
+ "division by zero in `%E / 0'")
+DEFERROR(ec_division_by_zero_in_mod,
+ "division by zero in `%E %% 0'")
+DEFERROR(ec_comparison_of_distinct_pointer_types_and_lacks_a_cast,
+ "comparison of distinct pointer types `%T' and `%T' lacks a cast")
+DEFERROR(ec_invalid_operands_and_to_binary,
+ "invalid operands `%T' and `%T' to binary `%O'")
+DEFERROR(ec_used_in_arithmetic,
+ "NULL used in arithmetic")
+DEFERROR(ec_cannot_s_a_pointer_to_incomplete_type,
+ "cannot %s a pointer to incomplete type `%T'")
+DEFERROR(ec_forbids_sing_a_pointer_of_type,
+ "ANSI C++ forbids %sing a pointer of type `%T'")
+DEFERROR(ec_invalid_use_of_on_bool_variable,
+ "invalid use of `--' on bool variable `%D'")
+DEFERROR(ec_taking_address_of_destructor,
+ "taking address of destructor")
+DEFERROR(ec_address_requested_for_which_is_declared_register,
+ "address requested for `%D', which is declared `register'")
+DEFERROR(ec_enumeral_mismatch_in_conditional_expression_vs,
+ "enumeral mismatch in conditional expression: `%T' vs `%T'")
+DEFERROR(ec_common_base_type_of_types_and_is_ambiguous,
+ "common base type of types `%T' and `%T' is ambiguous")
+DEFERROR(ec_and_converted_to_in_conditional_expression,
+ "`%T' and `%T' converted to `%T *' in conditional expression")
+DEFERROR(ec_aggregate_mismatch_in_conditional_expression_vs,
+ "aggregate mismatch in conditional expression: `%T' vs `%T'")
+DEFERROR(ec_incompatible_types_and_in,
+ "incompatible types `%T' and `%T' in `?:'")
+DEFERROR(ec_static_cast_from_to,
+ "static_cast from `%T' to `%T'")
+DEFERROR(ec_reinterpret_cast_from_rvalue_to,
+ "reinterpret_cast from `%T' rvalue to `%T'")
+DEFERROR(ec_reinterpret_cast_from_to_loses_precision,
+ "reinterpret_cast from `%T' to `%T' loses precision")
+DEFERROR(ec_reinterpret_cast_from_to_casts_away_const_or_volatile,
+ "reinterpret_cast from `%T' to `%T' casts away const (or volatile)")
+DEFERROR(ec_reinterpret_cast_from_to,
+ "reinterpret_cast from `%T' to `%T'")
+DEFERROR(ec_const_cast_from_rvalue_to,
+ "const_cast from `%T' rvalue to `%T'")
+DEFERROR(ec_const_cast_from_to,
+ "const_cast from `%T' to `%T'")
+DEFERROR(ec_casting_to_function_type,
+ "casting to function type `%T'")
+DEFERROR(ec_in_evaluation_of,
+ " in evaluation of `%Q(%#T, %#T)'")
+DEFERROR(ec_incompatible_types_in_assignment_of_to,
+ "incompatible types in assignment of `%T' to `%T'")
+DEFERROR(ec_pointer_to_member_cast_to_virtual_base,
+ "pointer to member cast to virtual base `%T'")
+DEFERROR(ec_pointer_to_member_cast_from_virtual_base,
+ "pointer to member cast from virtual base `%T'")
+DEFERROR(ec_pointer_to_member_conversion_from_virtual_base,
+ "pointer to member conversion from virtual base `%T'")
+DEFERROR(ec_conversion_to_from,
+ "conversion to `%T' from `%T'")
+DEFERROR(ec_used_for_argument_of,
+ "`%T' used for argument %P of `%D'")
+DEFERROR(ec_s_to_from,
+ "%s to `%T' from `%T'")
+DEFERROR(ec_negative_value_passed_as_argument_of,
+ "negative value `%E' passed as argument %P of `%D'")
+DEFERROR(ec_s_of_negative_value_to,
+ "%s of negative value `%E' to `%T'")
+DEFERROR(ec_passing_as_argument_of_discards_const,
+ "passing `%T' as argument %P of `%D' discards const")
+DEFERROR(ec_s_to_from_discards_const,
+ "%s to `%T' from `%T' discards const")
+DEFERROR(ec_passing_as_argument_of_discards_volatile,
+ "passing `%T' as argument %P of `%D' discards volatile")
+DEFERROR(ec_s_to_from_discards_volatile,
+ "%s to `%T' from `%T' discards volatile")
+DEFERROR(ec_no_standard_conversion_from_to_void,
+ "no standard conversion from `%T' to `void *'")
+DEFERROR(ec_converting_to_is_a_contravariance_violation,
+ "converting `%T' to `%T' is a contravariance violation")
+DEFERROR(ec_implicit_conversion_of_signature_pointer_to_type,
+ "implicit conversion of signature pointer to type `%T'")
+DEFERROR(ec_passing_as_argument_of_changes_signedness,
+ "passing `%T' as argument %P of `%D' changes signedness")
+DEFERROR(ec_s_to_from_changes_signedness,
+ "%s to `%T' from `%T' changes signedness")
+DEFERROR(ec_passing_as_argument_of_adds_cvquals_without_intervening_const,
+ "passing `%T' as argument %P of `%D' adds cv-quals without intervening `const'")
+DEFERROR(ec_s_to_from_adds_cvquals_without_intervening_const,
+ "%s to `%T' from `%T' adds cv-quals without intervening `const'")
+DEFERROR(ec_passing_as_argument_of_changes_signed_to_unsigned,
+ "passing `%T' as argument %P of `%D' changes signed to unsigned")
+DEFERROR(ec_s_to_from_changes_signed_to_unsigned,
+ "%s to `%T' from `%T' changes signed to unsigned")
+DEFERROR(ec_s_to_from_changes_unsigned_to_signed,
+ "%s to `%T' from `%T' changes unsigned to signed")
+DEFERROR(ec_passing_as_argument_of_changes_unsigned_to_signed,
+ "passing `%T' as argument %P of `%D' changes unsigned to signed")
+DEFERROR(ec_t,
+ "\t`%T' != `%T'")
+DEFERROR(ec_passing_as_argument_of,
+ "passing `%T' as argument %P of `%D'")
+DEFERROR(ec_passing_to_argument_of_lacks_a_cast,
+ "passing `%T' to argument %P of `%D' lacks a cast")
+DEFERROR(ec_s_to_from_lacks_a_cast,
+ "%s to `%T' from `%T' lacks a cast")
+DEFERROR(ec_in_passing_argument_of,
+ "in passing argument %P of `%+D'")
+DEFERROR(ec_reference_to_local_variable_returned,
+ "reference to local variable `%D' returned")
+DEFERROR(ec_address_of_local_variable_returned,
+ "address of local variable `%D' returned")
+DEFERROR(ec_type_is_not_a_base_type_for_type,
+ "type `%T' is not a base type for type `%T'")
+DEFERROR(ec_cannot_declare_variable_to_be_of_type,
+ "cannot declare variable `%D' to be of type `%T'")
+DEFERROR(ec_cannot_declare_parameter_to_be_of_type,
+ "cannot declare parameter `%D' to be of type `%T'")
+DEFERROR(ec_cannot_declare_field_to_be_of_type,
+ "cannot declare field `%D' to be of type `%T'")
+DEFERROR(ec_cannot_allocate_an_object_of_type,
+ "cannot allocate an object of type `%T'")
+DEFERROR(ec_virtual,
+ "\t%#D")
+DEFERROR(ec_since_type_has_abstract_virtual_functions_and_must_override_virtual_functions,
+ " since type `%T' has abstract virtual functions and must override virtual functions")
+DEFERROR(ec_since_type_has_abstract_virtual_functions,
+ " since type `%T' has abstract virtual functions")
+DEFERROR(ec_since_type_must_override_virtual_functions,
+ " since type `%T' must override virtual functions")
+DEFERROR(ec_cannot_declare_variable_to_be_of_signature_type,
+ "cannot declare variable `%D' to be of signature type `%T'")
+DEFERROR(ec_cannot_declare_parameter_to_be_of_signature_type,
+ "cannot declare parameter `%D' to be of signature type `%T'")
+DEFERROR(ec_cannot_declare_field_to_be_of_signature_type,
+ "cannot declare field `%D' to be of signature type `%T'")
+DEFERROR(ec_invalid_return_type_for_method,
+ "invalid return type for method `%#D'")
+DEFERROR(ec_invalid_return_type_for_function,
+ "invalid return type for function `%#D'")
+DEFERROR(ec_cannot_allocate_an_object_of_signature_type,
+ "cannot allocate an object of signature type `%T'")
+DEFERROR(ec_has_incomplete_type,
+ "`%D' has incomplete type")
+DEFERROR(ec_constructor_syntax_cannot_be_used_with_signature_type,
+ "constructor syntax cannot be used with signature type `%T'")
+DEFERROR(ec_constructor_syntax_used_but_no_constructor_declared_for_type,
+ "constructor syntax used, but no constructor declared for type `%T'")
+DEFERROR(ec_initializer_list_construction_invalid_for_derived_class_object,
+ "initializer list construction invalid for derived class object `%D'")
+DEFERROR(ec_initializer_list_construction_invalid_for_polymorphic_class_object,
+ "initializer list construction invalid for polymorphic class object `%D'")
+DEFERROR(ec_initializer_list_construction_invalid_for,
+ "initializer list construction invalid for `%D'")
+DEFERROR(ec_due_to_nonpublic_access_of_member,
+ "due to non-public access of member `%D'")
+DEFERROR(ec_braces_around_scalar_initializer_for,
+ "braces around scalar initializer for `%T'")
+DEFERROR(ec_ignoring_extra_initializers_for,
+ "ignoring extra initializers for `%T'")
+DEFERROR(ec_variablesized_object_of_type_may_not_be_initialized,
+ "variable-sized object of type `%T' may not be initialized")
+DEFERROR(ec_subobject_of_type_must_be_initialized_by_constructor_not_by,
+ "subobject of type `%T' must be initialized by constructor, not by `%E'")
+DEFERROR(ec_union_with_no_named_members_cannot_be_initialized,
+ "union `%T' with no named members cannot be initialized")
+DEFERROR(ec_base_operand_of_has_nonpointer_type,
+ "base operand of `->' has non-pointer type `%T'")
+DEFERROR(ec_cannot_be_used_as_a_member_pointer_since_it_is_of_type,
+ "`%E' cannot be used as a member pointer, since it is of type `%T'")
+DEFERROR(ec_cannot_apply_member_pointer_to,
+ "cannot apply member pointer `%E' to `%E'")
+DEFERROR(ec_which_is_of_nonaggregate_type,
+ "which is of non-aggregate type `%T'")
+DEFERROR(ec_member_type_incompatible_with_object_type,
+ "member type `%T::' incompatible with object type `%T'")
+DEFERROR(ec_fails_to_be_a_typedef_or_builtin_type,
+ "`%T' fails to be a typedef or built-in type")
+DEFERROR(ec_type_is_not_yet_defined,
+ "type `%T' is not yet defined")
+DEFERROR(ec_destructor_name_does_not_match_type,
+ "destructor name `~%T' does not match type `%T' of expression")
+DEFERROR(ec_explicit_extern_static,
+ "`%D' was declared `extern' and later `static'")
+DEFERROR(ec_implicit_extern_static,
+ "`%D' was declared implicitly `extern' and later `static'")
+DEFERROR(ec_not_declared_in_class,
+ "`%#D' not declared in class")
+DEFERROR(ec_conflicts_with_used_function,
+ "`%D' conflicts with used function")
+DEFERROR(ec_previously_defined_here,
+ "`%#D' previously defined here")
+DEFERROR(ec_previously_declared_here_2,
+ "`%#D' previously declared here")
+DEFERROR(ec_used_instead_of_decl_from_base,
+ " is used instead of `%D' from dependent base class")
+DEFERROR(ec_conflict_with_previous_decl,
+ "conflict with previous decl `%#D'")
+DEFERROR(ec_previous_external_decl_of,
+ "previous external decl of `%#D'")
+DEFERROR(ec_was_previously_implicitly_declared_to_return_int,
+ "`%D' was previously implicitly declared to return `int'")
+DEFERROR(ec_too_few_template_parameter_lists_in_declaration_of,
+ "too few template parameter lists in declaration of `%D'")
+DEFERROR(ec_explicit_specialization_not_preceded_by_template,
+ "explicit specialization not preceded by `template <>'")
+DEFERROR(ec_default_argument_specified_in_explicit_specialization,
+ "default argument specified in explicit specialization")
+DEFERROR(ec_templateargument_uses_anonymous_type,
+ "template-argument `%T' uses anonymous type")
+DEFERROR(ec_templateargument_uses_local_type,
+ "template-argument `%T' uses local type `%T'")
+DEFERROR(ec_base_type_of_fails_to_be_a_struct_or_class_type,
+ "base type `%T' of `%T' fails to be a struct or class type")
+DEFERROR(ec_forbids_the_use_of_s_on_explicit_instantiations,
+ "ANSI C++ forbids the use of `%s' on explicit instantiations")
+DEFERROR(ec_conflicts_with_previous_use_in_class_as,
+ "conflicts with previous use in class as `%#D'")
+DEFERROR(ec_variablesized_object_may_not_be_initialized,
+ "variable-sized object `%D' may not be initialized")
+DEFERROR(ec_defining_explicit_specialization_in_friend_declaration,
+ "defining explicit specialization `%D' in friend declaration")
+DEFERROR(ec_must_have_an_argument_of_class_or_enumerated_type,
+ "`%D' must have an argument of class or enumerated type")
+DEFERROR(ec_postfix_must_take_int_as_its_second_argument,
+ "postfix `%D' must take `int' as its second argument")
+DEFERROR(ec_invalid_use_of_undefined_type,
+ "invalid use of undefined type `%#T'")
+DEFERROR(ec_member_in_readonly_structure,
+ "%s of member `%D' in read-only structure")
+DEFERROR(ec_readonly_member,
+ "%s of read-only member `%D'")
+DEFERROR(ec_constant_field,
+ "%s of constant field `%D'")
+DEFERROR(ec_readonly_variable,
+ "%s of read-only variable `%D'")
+DEFERROR(ec_readonly_parameter,
+ "%s of read-only parameter `%D'")
+DEFERROR(ec_readonly_reference,
+ "%s of read-only reference `%D'")
+DEFERROR(ec_readonly_named_return_val,
+ "%s of read-only named return value `%D'")
+DEFERROR(ec_readonly_location,
+ "%s of read-only location")
+DEFERROR(ec_private_member_in_anonymous_union,
+ "private member `%#D' in anonymous union")
+DEFERROR(ec_protected_member_in_anonymous_union,
+ "protected member `%#D' in anonymous union")
+DEFERROR(ec_member_decl_with_only_nondefault_constructor,
+ "member `%#D' with only non-default constructor")
+DEFERROR(ec_member_with_only_nondefault_constructor,
+ "member with only non-default constructor")
+DEFERROR(ec_conflicts_with_other_use_in_class_as,
+ "conflicts with other use in class as `%#D'")
+DEFERROR(ec_cannot_resolve_overloaded_function,
+ "cannot resolve overloaded function `%D' based on non-function type")
+DEFERROR(ec_because_no_suitable_overload_of_function_exists,
+ " because no suitable overload of function `%D' exists")
+DEFERROR(ec_invalid_use_of_virtual_in_template_declaration_of,
+ "invalid use of `virtual' in template declaration of `%#D'")
+DEFERROR(ec_using_obsolete_binding_at,
+ " using obsolete binding at `%D'")
+DEFERROR(ec_too_few_arguments,
+ "too few arguments to %s `%+#D'")
+DEFERROR(ec_private_in_class,
+ "`%D' is private in `%T'")
+DEFERROR(ec_protected_in_class,
+ "`%D' is protected in `%T'")
+DEFERROR(ec_ambiguous_member,
+ "request for member `%D' is ambiguous")
+DEFERROR(ec_conflicting_access,
+ "conflicting access to member `%D'")
+DEFERROR(ec_member_private,
+ "member `%D' declared private")
+DEFERROR(ec_member_protected,
+ "member `%D' declared private")
+DEFERROR(ec_member_in_private_base,
+ "member `%D' is from private base class")
+DEFERROR(ec_member_in_protected_base,
+ "member `%D' is from protected base class")
+DEFERROR(ec_invalid_covariant_return_type_for_must_be_pointer_or_reference_to_class,
+ "invalid covariant return type for `%#D' (must be pointer or reference to class)")
+DEFERROR(ec_a_template_type_parameter_must_begin_with_class_or_typename,
+ " a template type parameter must begin with `class' or `typename'")
+DEFERROR(ec_it_must_be_ss_with_external_linkage,
+ "it must be %s%s with external linkage")
+DEFERROR(ec_because_it_is_the_address_of_an_object_with_static_linkage,
+ "because it is the address of an object with static linkage")
+DEFERROR(ec_template_instantiation_depth_exceeds_maximum_of_d,
+ "template instantiation depth exceeds maximum of %d")
+DEFERROR(ec_use_ftemplatedepth_to_increase_the_maximum,
+ " (use -ftemplate-depth-NN to increase the maximum)")
+DEFERROR(ec_incomplete_type_unification,
+ "incomplete type unification")
+DEFERROR(ec_invalid_call_via_pointertomember_function,
+ "invalid call via pointer-to-member function")
+DEFERROR(ec_destructors_take_no_parameters,
+ "destructors take no parameters")
+DEFERROR(ec_invalid_use_of_void_expression,
+ "invalid use of void expression")
+DEFERROR(ec_within_this_context,
+ "within this context")
+DEFERROR(ec_internal_inconsistency_binfo_offset_error_for_rtti,
+ "internal inconsistency: binfo offset error for rtti")
+DEFERROR(ec_conflicting_access_specifications_for_field_s_ignored,
+ "conflicting access specifications for field `%s', ignored")
+DEFERROR(ec_every_virtual_function_must_have_a_unique_final_overrider,
+ "every virtual function must have a unique final overrider")
+DEFERROR(ec_anonymous_class_type_not_used_to_declare_any_objects,
+ "anonymous class type not used to declare any objects")
+DEFERROR(ec_trying_to_finish_struct_but_kicked_out_due_to_previous_parse_errors,
+ "trying to finish struct, but kicked out due to previous parse errors.")
+DEFERROR(ec_language_string_not_recognized,
+ "language string `\"%s\"' not recognized")
+DEFERROR(ec_invalid_type_combination_for_overload,
+ "invalid type combination for overload")
+DEFERROR(ec_not_enough_type_information,
+ "not enough type information")
+DEFERROR(ec_ambiguous_overload_for_requested,
+ "ambiguous overload for COMPONENT_REF requested")
+DEFERROR(ec_no_appropriate_overload_exists_for,
+ "no appropriate overload exists for COMPONENT_REF")
+DEFERROR(ec_ambiguous_overload_for_overloaded_method_requested,
+ "ambiguous overload for overloaded method requested")
+DEFERROR(ec_invalid_operation_on_uninstantiated_type,
+ "invalid operation on uninstantiated type")
+DEFERROR(ec_type_for_resolving_address_of_overloaded_function_must_be_pointer_type,
+ "type for resolving address of overloaded function must be pointer type")
+DEFERROR(ec_internal_compiler_error_debugging_info_corrupted,
+ "internal compiler error: debugging info corrupted")
+DEFERROR(ec_variable_s_shadows_local,
+ "variable `%s' shadows local")
+DEFERROR(ec_label_s_referenced_outside_of_any_function,
+ "label `%s' referenced outside of any function")
+DEFERROR(ec_where_case_label_appears_here,
+ "where case label appears here")
+DEFERROR(ec_enclose_actions_of_previous_case_statements_requiring,
+ "(enclose actions of previous case statements requiring")
+DEFERROR(ec_destructors_in_their_own_binding_contours,
+ "destructors in their own binding contours.)")
+DEFERROR(ec_jump_to_case_label,
+ "jump to case label")
+DEFERROR(ec_multiple_types_in_one_declaration,
+ "multiple types in one declaration")
+DEFERROR(ec_assignment_not_initialization_in_declaration,
+ "assignment (not initialization) in declaration")
+DEFERROR(ec_cannot_declare_main_to_be_inline,
+ "cannot declare `main' to be inline")
+DEFERROR(ec_cannot_declare_main_to_be_static,
+ "cannot declare `main' to be static")
+DEFERROR(ec_destructors_must_be_member_functions,
+ "destructors must be member functions")
+DEFERROR(ec_bool_is_now_a_keyword,
+ "`bool' is now a keyword")
+DEFERROR(ec_does_not_support_long_long,
+ "ANSI C++ does not support `long long'")
+DEFERROR(ec_long_long_long_is_too_long_for,
+ "`long long long' is too long for GCC")
+DEFERROR(ec_duplicate_s,
+ "duplicate `%s'")
+DEFERROR(ec_two_or_more_data_types_in_declaration_of_s,
+ "two or more data types in declaration of `%s'")
+DEFERROR(ec_s_fails_to_be_a_typedef_or_built_in_type,
+ "`%s' fails to be a typedef or built in type")
+DEFERROR(ec_forbids_typedef_which_does_not_specify_a_type,
+ "ANSI C++ forbids typedef which does not specify a type")
+DEFERROR(ec_return_type_specification_for_destructor_invalid,
+ "return type specification for destructor invalid")
+DEFERROR(ec_return_type_specification_for_constructor_invalid,
+ "return type specification for constructor invalid")
+DEFERROR(ec_short_signed_or_unsigned_invalid_for_s,
+ "short, signed or unsigned invalid for `%s'")
+DEFERROR(ec_long_short_signed_or_unsigned_invalid_for_s,
+ "long, short, signed or unsigned invalid for `%s'")
+DEFERROR(ec_long_and_short_specified_together_for_s,
+ "long and short specified together for `%s'")
+DEFERROR(ec_long_or_short_specified_with_char_for_s,
+ "long or short specified with char for `%s'")
+DEFERROR(ec_long_or_short_specified_with_floating_type_for_s,
+ "long or short specified with floating type for `%s'")
+DEFERROR(ec_signed_and_unsigned_given_together_for_s,
+ "signed and unsigned given together for `%s'")
+DEFERROR(ec_long_short_signed_or_unsigned_used_invalidly_for_s,
+ "long, short, signed or unsigned used invalidly for `%s'")
+DEFERROR(ec_complex_invalid_for_s,
+ "complex invalid for `%s'")
+DEFERROR(ec_nonmember_s_cannot_be_declared_mutable,
+ "non-member `%s' cannot be declared `mutable'")
+DEFERROR(ec_nonobject_member_s_cannot_be_declared_mutable,
+ "non-object member `%s' cannot be declared `mutable'")
+DEFERROR(ec_storage_class_specifiers_invalid_in_parameter_declarations,
+ "storage class specifiers invalid in parameter declarations")
+DEFERROR(ec_typedef_declaration_invalid_in_parameter_declaration,
+ "typedef declaration invalid in parameter declaration")
+DEFERROR(ec_virtual_outside_class_declaration,
+ "virtual outside class declaration")
+DEFERROR(ec_only_members_can_be_declared_mutable,
+ "only members can be declared mutable")
+DEFERROR(ec_const_specified_for_signature_member_function_s,
+ "`const' specified for signature member function `%s'")
+DEFERROR(ec_volatile_specified_for_signature_member_function_s,
+ "`volatile' specified for signature member function `%s'")
+DEFERROR(ec_inline_specified_for_signature_member_function_s,
+ "`inline' specified for signature member function `%s'")
+DEFERROR(ec_friend_declaration_in_signature_definition,
+ "`friend' declaration in signature definition")
+DEFERROR(ec_virtual_specified_for_signature_member_function_s,
+ "`virtual' specified for signature member function `%s'")
+DEFERROR(ec_multiple_storage_classes_in_declaration_of_s,
+ "multiple storage classes in declaration of `%s'")
+DEFERROR(ec_storage_class_specified_for_s_s,
+ "storage class specified for %s `%s'")
+DEFERROR(ec_s_initialized_and_declared_extern,
+ "`%s' initialized and declared `extern'")
+DEFERROR(ec_s_has_both_extern_and_initializer,
+ "`%s' has both `extern' and initializer")
+DEFERROR(ec_nested_function_s_declared_extern,
+ "nested function `%s' declared `extern'")
+DEFERROR(ec_toplevel_declaration_of_s_specifies_auto,
+ "top-level declaration of `%s' specifies `auto'")
+DEFERROR(ec_storage_class_specifiers_invalid_in_friend_function_declarations,
+ "storage class specifiers invalid in friend function declarations")
+DEFERROR(ec_overflow_in_array_dimension,
+ "overflow in array dimension")
+DEFERROR(ec_function_declared_to_return_const_or_volatile_result,
+ "function declared to return const or volatile result")
+DEFERROR(ec_s_declared_as_function_returning_a_function,
+ "`%s' declared as function returning a function")
+DEFERROR(ec_s_declared_as_function_returning_an_array,
+ "`%s' declared as function returning an array")
+DEFERROR(ec_destructor_cannot_be_static_member_function,
+ "destructor cannot be static member function")
+DEFERROR(ec_destructors_cannot_be_declared_const_or_volatile,
+ "destructors cannot be declared `const' or `volatile'")
+DEFERROR(ec_constructor_cannot_be_static_member_function,
+ "constructor cannot be static member function")
+DEFERROR(ec_constructors_cannot_be_declared_virtual,
+ "constructors cannot be declared virtual")
+DEFERROR(ec_constructors_cannot_be_declared_const_or_volatile,
+ "constructors cannot be declared `const' or `volatile'")
+DEFERROR(ec_return_value_type_specifier_for_constructor_ignored,
+ "return value type specifier for constructor ignored")
+DEFERROR(ec_constructor_not_allowed_in_signature,
+ "constructor not allowed in signature")
+DEFERROR(ec_cant_initialize_friend_function_s,
+ "can't initialize friend function `%s'")
+DEFERROR(ec_virtual_functions_cannot_be_friends,
+ "virtual functions cannot be friends")
+DEFERROR(ec_friend_declaration_not_in_class_definition,
+ "friend declaration not in class definition")
+DEFERROR(ec_destructors_cannot_be_specified_with_parameters,
+ "destructors cannot be specified with parameters")
+DEFERROR(ec_cannot_declare_s_to_references,
+ "cannot declare %s to references")
+DEFERROR(ec_cannot_declare_references_to_functions_use_pointer_to_function_instead,
+ "cannot declare references to functions; use pointer to function instead")
+DEFERROR(ec_invalid_type_void,
+ "invalid type: `void &'")
+DEFERROR(ec_invalid_type_modifier_within_s_declarator,
+ "invalid type modifier within %s declarator")
+DEFERROR(ec_duplicate_const,
+ "duplicate `const'")
+DEFERROR(ec_duplicate_volatile,
+ "duplicate `volatile'")
+DEFERROR(ec_discarding_const_applied_to_a_reference,
+ "discarding `const' applied to a reference")
+DEFERROR(ec_discarding_volatile_applied_to_a_reference,
+ "discarding `volatile' applied to a reference")
+DEFERROR(ec_only_constructors_can_be_declared_explicit,
+ "only constructors can be declared `explicit'")
+DEFERROR(ec_const_s_cannot_be_declared_mutable,
+ "const `%s' cannot be declared `mutable'")
+DEFERROR(ec_static_s_cannot_be_declared_mutable,
+ "static `%s' cannot be declared `mutable'")
+DEFERROR(ec_typedef_declaration_includes_an_initializer,
+ "typedef declaration includes an initializer")
+DEFERROR(ec_const_or_volatile_specified_with_signature_type,
+ "`const' or `volatile' specified with signature type")
+DEFERROR(ec_trying_to_make_class_s_a_friend_of_global_scope,
+ "trying to make class `%s' a friend of global scope")
+DEFERROR(ec_unnamed_variable_or_field_declared_void,
+ "unnamed variable or field declared void")
+DEFERROR(ec_variable_or_field_s_declared_void,
+ "variable or field `%s' declared void")
+DEFERROR(ec_variable_or_field_declared_void,
+ "variable or field declared void")
+DEFERROR(ec_cannot_use_in_parameter_declaration,
+ "cannot use `::' in parameter declaration")
+DEFERROR(ec_declaration_of_s_as_void,
+ "declaration of `%s' as void")
+DEFERROR(ec_parameter_of_signature_member_function_declared_inline,
+ "parameter of signature member function declared `inline'")
+DEFERROR(ec_parameter_of_signature_member_function_declared_auto,
+ "parameter of signature member function declared `auto'")
+DEFERROR(ec_parameter_of_signature_member_function_declared_register,
+ "parameter of signature member function declared `register'")
+DEFERROR(ec_s_is_neither_function_nor_method_cannot_be_declared_friend,
+ "`%s' is neither function nor method; cannot be declared friend")
+DEFERROR(ec_member_functions_are_implicitly_friends_of_their_class,
+ "member functions are implicitly friends of their class")
+DEFERROR(ec_storage_class_auto_invalid_for_function_s,
+ "storage class `auto' invalid for function `%s'")
+DEFERROR(ec_storage_class_register_invalid_for_function_s,
+ "storage class `register' invalid for function `%s'")
+DEFERROR(ec_storage_class_static_invalid_for_function_s_declared_out_of_global_scope,
+ "storage class `static' invalid for function `%s' declared out of global scope")
+DEFERROR(ec_storage_class_inline_invalid_for_function_s_declared_out_of_global_scope,
+ "storage class `inline' invalid for function `%s' declared out of global scope")
+DEFERROR(ec_virtual_nonclass_function_s,
+ "virtual non-class function `%s'")
+DEFERROR(ec_cannot_declare_static_function_inside_another_function,
+ "cannot declare static function inside another function")
+DEFERROR(ec_s_cannot_be_declared_mutable,
+ "`%s' cannot be declared mutable")
+DEFERROR(ec_parameter_s_has_incomplete_type,
+ "parameter `%s' has incomplete type")
+DEFERROR(ec_parameter_has_incomplete_type,
+ "parameter has incomplete type")
+DEFERROR(ec_parameter_s_points_to_incomplete_type,
+ "parameter `%s' points to incomplete type")
+DEFERROR(ec_parameter_points_to_incomplete_type,
+ "parameter points to incomplete type")
+DEFERROR(ec_parameter_names_without_types_in_function_declaration,
+ "parameter names (without types) in function declaration")
+DEFERROR(ec_invalid_integer_constant_in_parameter_list_did_you_forget_to_give_parameter_name,
+ "invalid integer constant in parameter list, did you forget to give parameter name?")
+DEFERROR(ec_void_in_parameter_list_must_be_entire_list,
+ "`void' in parameter list must be entire list")
+DEFERROR(ec_void_is_not_a_valid_type_conversion_operator,
+ "void is not a valid type conversion operator")
+DEFERROR(ec_conversion_to_ss_will_never_use_a_type_conversion_operator,
+ "conversion to %s%s will never use a type conversion operator")
+DEFERROR(ec_prohibits_overloading_operator,
+ "ANSI C++ prohibits overloading operator ?:")
+DEFERROR(ec_return_type_for_main_changed_to_int,
+ "return type for `main' changed to `int'")
+DEFERROR(ec_returntype_defaults_to_int,
+ "return-type defaults to `int'")
+DEFERROR(ec_does_not_permit_named_return_values,
+ "ANSI C++ does not permit named return values")
+DEFERROR(ec_cant_redefine_default_return_value_for_constructors,
+ "can't redefine default return value for constructors")
+DEFERROR(ec_this_function_may_return_with_or_without_a_value,
+ "this function may return with or without a value")
+DEFERROR(ec_address_of_overloaded_function_with_no_contextual_type_information,
+ "address of overloaded function with no contextual type information")
+DEFERROR(ec_useless_reference_to_a_member_function_name_did_you_forget_the,
+ "useless reference to a member function name, did you forget the ()?")
+DEFERROR(ec_at_this_point_in_file,
+ "at this point in file")
+DEFERROR(ec_fhandleexceptions_has_been_renamed_to_fexceptions_and_is_now_on_by_default,
+ "-fhandle-exceptions has been renamed to -fexceptions (and is now on by default)")
+DEFERROR(ec_fs_is_no_longer_supported,
+ "-f%s is no longer supported")
+DEFERROR(ec_invalid_option_s,
+ "Invalid option `%s'")
+DEFERROR(ec_duplicate_s_s,
+ "duplicate `%s' %s")
+DEFERROR(ec_error_in_component_specification,
+ "error in component specification")
+DEFERROR(ec_an_anonymous_union_cannot_have_function_members,
+ "an anonymous union cannot have function members")
+DEFERROR(ec_empty_component_declaration,
+ "empty component declaration")
+DEFERROR(ec_name_missing_for_member_function,
+ "name missing for member function")
+DEFERROR(ec_alignof_applied_to_a_bitfield,
+ "`__alignof__' applied to a bit-field")
+DEFERROR(ec_parser_may_be_lost_is_there_a_missing_somewhere,
+ "parser may be lost: is there a '{' missing somewhere?")
+DEFERROR(ec_ambiguous_conversion_for_array_subscript,
+ "ambiguous conversion for array subscript")
+DEFERROR(ec_anachronistic_use_of_array_size_in_vector_delete,
+ "anachronistic use of array size in vector delete")
+DEFERROR(ec_cannot_delete_a_function,
+ "cannot delete a function")
+DEFERROR(ec_field_declaration_not_allowed_in_signature,
+ "field declaration not allowed in signature")
+DEFERROR(ec_function_declarations_cannot_have_initializers_in_signature,
+ "function declarations cannot have initializers in signature")
+DEFERROR(ec_field_initializer_is_not_constant,
+ "field initializer is not constant")
+DEFERROR(ec_initializer_invalid_for_static_member_with_constructor,
+ "initializer invalid for static member with constructor")
+DEFERROR(ec_you_really_want_to_initialize_it_separately,
+ "(you really want to initialize it separately)")
+DEFERROR(ec_global_anonymous_unions_must_be_declared_static,
+ "global anonymous unions must be declared static")
+DEFERROR(ec_anonymous_union_with_no_members,
+ "anonymous union with no members")
+DEFERROR(ec_operator_new_must_return_type_void,
+ "`operator new' must return type `void *'")
+DEFERROR(ec_operator_new_takes_type_size_t_parameter,
+ "`operator new' takes type `size_t' parameter")
+DEFERROR(ec_operator_new_takes_type_size_t_as_first_parameter,
+ "`operator new' takes type `size_t' as first parameter")
+DEFERROR(ec_operator_delete_must_return_type_void,
+ "`operator delete' must return type `void'")
+DEFERROR(ec_operator_delete_takes_type_void_as_first_parameter,
+ "`operator delete' takes type `void *' as first parameter")
+DEFERROR(ec_second_argument_to_operator_delete_must_be_of_type_size_t,
+ "second argument to `operator delete' must be of type `size_t'")
+DEFERROR(ec_too_many_arguments_in_declaration_of_operator_delete,
+ "too many arguments in declaration of `operator delete'")
+DEFERROR(ec_invalid_in_specification_of_operator_delete,
+ "`...' invalid in specification of `operator delete'")
+DEFERROR(ec_cast_specifies_signature_type,
+ "cast specifies signature type")
+DEFERROR(ec_use_of_oldstyle_cast,
+ "use of old-style cast")
+DEFERROR(ec_invalid_catch_parameter,
+ "invalid catch parameter")
+DEFERROR(ec_in_thrown_expression,
+ " in thrown expression")
+DEFERROR(ec_pointers_are_not_permitted_as_case_values,
+ "pointers are not permitted as case values")
+DEFERROR(ec_forbids_range_expressions_in_switch_statement,
+ "ANSI C++ forbids range expressions in switch statement")
+DEFERROR(ec_default_label_not_within_a_switch_statement,
+ "default label not within a switch statement")
+DEFERROR(ec_duplicate_or_overlapping_case_value,
+ "duplicate (or overlapping) case value")
+DEFERROR(ec_multiple_default_labels_in_one_switch,
+ "multiple default labels in one switch")
+DEFERROR(ec_empty_range_specified,
+ "empty range specified")
+DEFERROR(ec_default_label_within_scope_of_cleanup_or_variable_array,
+ "`default' label within scope of cleanup or variable array")
+DEFERROR(ec_method_ss_is_already_a_friend_of_class,
+ "method `%s::%s' is already a friend of class")
+DEFERROR(ec_function_s_is_already_a_friend_of_class_s,
+ "function `%s' is already a friend of class `%s'")
+DEFERROR(ec_signature_type_s_declared_friend,
+ "signature type `%s' declared `friend'")
+DEFERROR(ec_class_s_is_implicitly_friends_with_itself,
+ "class `%s' is implicitly friends with itself")
+DEFERROR(ec_declares_a_nontemplate_function,
+ " declares a non-template function")
+DEFERROR(ec_if_this_is_not_what_you_intended_make_sure,
+ " (if this is not what you intended, make sure")
+DEFERROR(ec_the_function_template_has_already_been_declared,
+ " the function template has already been declared,")
+DEFERROR(ec_and_add_after_the_function_name_here,
+ " and add <> after the function name here)")
+DEFERROR(ec_o_disable_warning_use_nonontemplatefriend,
+ " To disable warning use -Wno-non-template-friend")
+DEFERROR(ec_initializer_list_treated_as_compound_expression,
+ "initializer list treated as compound expression")
+DEFERROR(ec_will_be_reordered_to_match_declaration_order,
+ " will be re-ordered to match declaration order")
+DEFERROR(ec_will_be_reordered_to_match_inheritance_order,
+ " will be re-ordered to match inheritance order")
+DEFERROR(ec_base_class_initializer_specified_but_no_base_class_to_initialize,
+ "base class initializer specified, but no base class to initialize")
+DEFERROR(ec_initializer_for_unnamed_base_class_ambiguous,
+ "initializer for unnamed base class ambiguous")
+DEFERROR(ec_no_base_class_to_initialize,
+ "no base class to initialize")
+DEFERROR(ec_will_be_reordered_to_precede_member_initializations,
+ " will be re-ordered to precede member initializations")
+DEFERROR(ec_bad_array_initializer,
+ "bad array initializer")
+DEFERROR(ec_object_missing_in_use_of_pointertomember_construct,
+ "object missing in use of pointer-to-member construct")
+DEFERROR(ec_new_of_array_type_fails_to_specify_size,
+ "new of array type fails to specify size")
+DEFERROR(ec_zero_size_array_reserves_no_space,
+ "zero size array reserves no space")
+DEFERROR(ec_new_cannot_be_applied_to_a_reference_type,
+ "new cannot be applied to a reference type")
+DEFERROR(ec_new_cannot_be_applied_to_a_function_type,
+ "new cannot be applied to a function type")
+DEFERROR(ec_invalid_type_void_for_new,
+ "invalid type `void' for new")
+DEFERROR(ec_constructors_take_parameter_lists,
+ "constructors take parameter lists")
+DEFERROR(ec_initializer_list_being_treated_as_compound_expression,
+ "initializer list being treated as compound expression")
+DEFERROR(ec_initializer_list_appears_where_operand_should_be_used,
+ "initializer list appears where operand should be used")
+DEFERROR(ec_initializer_ends_prematurely,
+ "initializer ends prematurely")
+DEFERROR(ec_unknown_array_size_in_delete,
+ "unknown array size in delete")
+DEFERROR(ec_type_to_vector_delete_is_neither_pointer_or_array_type,
+ "type to vector delete is neither pointer or array type")
+DEFERROR(ec_type_name_expected_before_star,
+ "type name expected before `*'")
+DEFERROR(ec_cannot_declare_references_to_references,
+ "cannot declare references to references")
+DEFERROR(ec_cannot_declare_pointers_to_references,
+ "cannot declare pointers to references")
+DEFERROR(ec_type_name_expected_before_amp,
+ "type name expected before `&'")
+DEFERROR(ec_yydebug_not_defined,
+ "YYDEBUG not defined.")
+DEFERROR(ec_parse_error_at_end_of_saved_function_text,
+ "parse error at end of saved function text")
+DEFERROR(ec_end_of_file_encountered_inside_string_constant,
+ "end of file encountered inside string constant")
+DEFERROR(ec_end_of_file_encountered_inside_character_constant,
+ "end of file encountered inside character constant")
+DEFERROR(ec_forbids_newline_in_string_constant,
+ "ANSI C++ forbids newline in string constant")
+DEFERROR(ec_parse_error_in_method_specification,
+ "parse error in method specification")
+DEFERROR(ec_function_body_for_constructor_missing,
+ "function body for constructor missing")
+DEFERROR(ec_semicolon_missing_after_s_declaration,
+ "semicolon missing after %s declaration")
+DEFERROR(ec_stray_in_program,
+ "stray '\\' in program")
+DEFERROR(ec_ignoring_pragma_s,
+ "ignoring pragma: %s")
+DEFERROR(ec_invalid_ident,
+ "invalid #ident")
+DEFERROR(ec_undefined_or_invalid_directive,
+ "undefined or invalid # directive")
+DEFERROR(ec_invalid_line,
+ "invalid #line")
+DEFERROR(ec_badly_nested_headers_from_preprocessor,
+ "badly nested C headers from preprocessor")
+DEFERROR(ec_lines_for_entering_and_leaving_files_dont_match,
+ "#-lines for entering and leaving files don't match")
+DEFERROR(ec_x_used_with_no_following_hex_digits,
+ "\\x used with no following hex digits")
+DEFERROR(ec_hex_escape_out_of_range,
+ "hex escape out of range")
+DEFERROR(ec_nonstandard_escape_sequence_c,
+ "non-ANSI-standard escape sequence, `\\%c'")
+DEFERROR(ec_unknown_escape_sequence_c,
+ "unknown escape sequence `\\%c'")
+DEFERROR(ec_unknown_escape_sequence_followed_by_char_code_0xx,
+ "unknown escape sequence: `\\' followed by char code 0x%x")
+DEFERROR(ec_ach_undeclared_identifier_is_reported_only_once,
+ "(Each undeclared identifier is reported only once")
+DEFERROR(ec_for_each_function_it_appears_in,
+ "for each function it appears in.)")
+DEFERROR(ec_name_lookup_of_s_changed,
+ "name lookup of `%s' changed")
+DEFERROR(ec_in_identifier,
+ "`$' in identifier")
+DEFERROR(ec_invalid_modifier_s_for_language_string,
+ "invalid modifier `%s' for language string")
+DEFERROR(ec_identifier_name_s_conflicts_with_internal_naming_strategy,
+ "identifier name `%s' conflicts with GNU C++ internal naming strategy")
+DEFERROR(ec_parse_error_at,
+ "parse error at `..'")
+DEFERROR(ec_floating_constant_may_not_be_in_radix_16,
+ "floating constant may not be in radix 16")
+DEFERROR(ec_malformed_floating_constant,
+ "malformed floating constant")
+DEFERROR(ec_nondigits_in_number_and_not_hexadecimal,
+ "nondigits in number and not hexadecimal")
+DEFERROR(ec_numeric_constant_with_no_digits,
+ "numeric constant with no digits")
+DEFERROR(ec_numeric_constant_contains_digits_beyond_the_radix,
+ "numeric constant contains digits beyond the radix")
+DEFERROR(ec_floating_constant_exponent_has_no_digits,
+ "floating constant exponent has no digits")
+DEFERROR(ec_floating_constant_out_of_range,
+ "floating constant out of range")
+DEFERROR(ec_more_than_one_f_in_numeric_constant,
+ "more than one `f' in numeric constant")
+DEFERROR(ec_more_than_one_l_in_numeric_constant,
+ "more than one `l' in numeric constant")
+DEFERROR(ec_more_than_one_i_or_j_in_numeric_constant,
+ "more than one `i' or `j' in numeric constant")
+DEFERROR(ec_forbids_imaginary_numeric_constants,
+ "ANSI C++ forbids imaginary numeric constants")
+DEFERROR(ec_both_f_and_l_in_floating_constant,
+ "both `f' and `l' in floating constant")
+DEFERROR(ec_floating_point_number_exceeds_range_of_float,
+ "floating point number exceeds range of `float'")
+DEFERROR(ec_floating_point_number_exceeds_range_of_long_double,
+ "floating point number exceeds range of `long double'")
+DEFERROR(ec_floating_point_number_exceeds_range_of_double,
+ "floating point number exceeds range of `double'")
+DEFERROR(ec_floating_point_number_exceeds_range_of_s,
+ "floating point number exceeds range of `%s'")
+DEFERROR(ec_two_us_in_integer_constant,
+ "two `u's in integer constant")
+DEFERROR(ec_three_ls_in_integer_constant,
+ "three `l's in integer constant")
+DEFERROR(ec_forbids_long_long_integer_constants,
+ "ANSI C++ forbids long long integer constants")
+DEFERROR(ec_integer_constant_out_of_range,
+ "integer constant out of range")
+DEFERROR(ec_decimal_integer_constant_is_so_large_that_it_is_unsigned,
+ "decimal integer constant is so large that it is unsigned")
+DEFERROR(ec_complex_integer_constant_is_too_wide_for_complex_int,
+ "complex integer constant is too wide for `__complex int'")
+DEFERROR(ec_escape_sequence_out_of_range_for_character,
+ "escape sequence out of range for character")
+DEFERROR(ec_forbids_newline_in_character_constant,
+ "ANSI C forbids newline in character constant")
+DEFERROR(ec_gnoring_invalid_multibyte_character,
+ "ignoring invalid multibyte character")
+DEFERROR(ec_malformatted_character_constant,
+ "malformatted character constant")
+DEFERROR(ec_empty_character_constant,
+ "empty character constant")
+DEFERROR(ec_character_constant_too_long,
+ "character constant too long")
+DEFERROR(ec_multicharacter_character_constant,
+ "multi-character character constant")
+DEFERROR(ec_nterminated_string,
+ "unterminated string")
+DEFERROR(ec_use_of_operator_s_is_not_standard,
+ "use of `operator %s' is not standard C++")
+DEFERROR(ec_invalid_pragma_vtable,
+ "invalid #pragma vtable")
+DEFERROR(ec_use_e2_option_to_enable_pragma_vtable,
+ "use `+e2' option to enable #pragma vtable")
+DEFERROR(ec_trailing_characters_ignored,
+ "trailing characters ignored")
+DEFERROR(ec_invalid_pragma_unit,
+ "invalid #pragma unit")
+DEFERROR(ec_invalid_pragma_interface,
+ "invalid `#pragma interface'")
+DEFERROR(ec_garbage_after_pragma_interface_ignored,
+ "garbage after `#pragma interface' ignored")
+DEFERROR(ec_invalid_pragma_implementation,
+ "invalid `#pragma implementation'")
+DEFERROR(ec_garbage_after_pragma_implementation_ignored,
+ "garbage after `#pragma implementation' ignored")
+DEFERROR(ec_pragma_implementation_can_only_appear_at_toplevel,
+ "`#pragma implementation' can only appear at top-level")
+DEFERROR(ec_forbids_floatingpoint_template_arguments,
+ "ANSI C++ forbids floating-point template arguments")
+DEFERROR(ec_methods_cannot_be_converted_to_function_pointers,
+ "methods cannot be converted to function pointers")
+DEFERROR(ec_ambiguous_request_for_method_pointer_s,
+ "ambiguous request for method pointer `%s'")
+DEFERROR(ec_static_member_s_is_s,
+ "static member `%s' is %s")
+DEFERROR(ec_enum_s_is_from_private_base_class,
+ "enum `%s' is from private base class")
+DEFERROR(ec_request_for_member_s_is_ambiguous_in_multiple_inheritance_lattice,
+ "request for member `%s' is ambiguous in multiple inheritance lattice")
+DEFERROR(ec_syntax_error,
+ "syntax error")
+DEFERROR(ec_invalid_default_template_argument,
+ "invalid default template argument")
+DEFERROR(ec_empty_declaration,
+ "empty declaration")
+DEFERROR(ec_no_base_initializers_given_following,
+ "no base initializers given following ':'")
+DEFERROR(ec_base_initializers_not_allowed_for_nonmember_functions,
+ "base initializers not allowed for non-member functions")
+DEFERROR(ec_only_constructors_take_base_initializers,
+ "only constructors take base initializers")
+DEFERROR(ec_anachronistic_old_style_base_class_initializer,
+ "anachronistic old style base class initializer")
+DEFERROR(ec_should_be_in_template_class_name,
+ "`>>' should be `> >' in template class name")
+DEFERROR(ec_forbids_an_empty_condition_for_s,
+ "ANSI C++ forbids an empty condition for `%s'")
+DEFERROR(ec_forbids,
+ "ANSI C++ forbids `&&'")
+DEFERROR(ec_forbids_initialization_of_new_expression_with,
+ "ANSI C++ forbids initialization of new expression with `='")
+DEFERROR(ec_forbids_constructorexpressions,
+ "ANSI C++ forbids constructor-expressions")
+DEFERROR(ec_bracedgroup_within_expression_allowed_only_inside_a_function,
+ "braced-group within expression allowed only inside a function")
+DEFERROR(ec_forbids_bracedgroups_within_expressions,
+ "ANSI C++ forbids braced-groups within expressions")
+DEFERROR(ec_cannot_cast_null_list_to_type_s,
+ "cannot cast null list to type `%s'")
+DEFERROR(ec_cannot_cast_expression_to_friend_type,
+ "cannot cast expression to `friend' type")
+DEFERROR(ec_s_is_not_at_beginning_of_declaration,
+ "`%s' is not at beginning of declaration")
+DEFERROR(ec_sigof_applied_to_nonaggregate_expression,
+ "`sigof' applied to non-aggregate expression")
+DEFERROR(ec_sigof_applied_to_nonaggregate_type,
+ "`sigof' applied to non-aggregate type")
+DEFERROR(ec_comma_at_end_of_enumerator_list,
+ "comma at end of enumerator list")
+DEFERROR(ec_storage_class_specifier_s_not_allowed_after_struct_or_class,
+ "storage class specifier `%s' not allowed after struct or class")
+DEFERROR(ec_type_specifier_s_not_allowed_after_struct_or_class,
+ "type specifier `%s' not allowed after struct or class")
+DEFERROR(ec_type_qualifier_s_not_allowed_after_struct_or_class,
+ "type qualifier `%s' not allowed after struct or class")
+DEFERROR(ec_no_body_nor_separates_two_class_struct_or_union_declarations,
+ "no body nor ';' separates two class, struct or union declarations")
+DEFERROR(ec_sigof_in_struct_or_class_declaration,
+ "`sigof' in struct or class declaration")
+DEFERROR(ec_multiple_access_specifiers,
+ "multiple access specifiers")
+DEFERROR(ec_multiple_virtual_specifiers,
+ "multiple `virtual' specifiers")
+DEFERROR(ec_access_specifier_not_allowed_in_signature,
+ "access specifier not allowed in signature")
+DEFERROR(ec_missing_before_right_brace,
+ "missing ';' before right brace")
+DEFERROR(ec_forbids_array_dimensions_with_parenthesized_type_in_new,
+ "ANSI C++ forbids array dimensions with parenthesized type in new")
+DEFERROR(ec_forbids_label_declarations,
+ "ANSI C++ forbids label declarations")
+DEFERROR(ec_forbids_computed_gotos,
+ "ANSI C++ forbids computed gotos")
+DEFERROR(ec_label_must_be_followed_by_statement,
+ "label must be followed by statement")
+DEFERROR(ec_forbids_compound_statements_inside_for_initializations,
+ "ANSI C++ forbids compound statements inside for initializations")
+DEFERROR(ec_possibly_missing,
+ "possibly missing ')'")
+DEFERROR(ec_type_specifier_omitted_for_parameter,
+ "type specifier omitted for parameter")
+DEFERROR(ec_frepo_must_be_used_with_c,
+ "-frepo must be used with -c")
+DEFERROR(ec_mysterious_repository_information_in_s,
+ "mysterious repository information in %s")
+DEFERROR(ec_cant_create_repository_information_file_s,
+ "can't create repository information file `%s'")
+DEFERROR(ec_headof_applied_to_nonpointer_type,
+ "`headof' applied to non-pointer type")
+DEFERROR(ec_typeid_of_overloaded_function,
+ "typeid of overloaded function")
+DEFERROR(ec_taking_dynamic_typeid_of_object_without_frtti,
+ "taking dynamic typeid of object without -frtti")
+DEFERROR(ec_requesting_typeid_of_object_without_frtti,
+ "requesting typeid of object without -frtti")
+DEFERROR(ec_invalid_covariant_return_type_must_use_pointer_or_reference,
+ "invalid covariant return type (must use pointer or reference)")
+DEFERROR(ec_recoverable_compiler_error_fixups_for_virtual_function,
+ "recoverable compiler error, fixups for virtual function")
+DEFERROR(ec_recoverable_internal_compiler_error_nobodys_in_charge,
+ "recoverable internal compiler error, nobody's in charge!")
+DEFERROR(ec_this_is_unavailable_for_static_member_functions,
+ "`this' is unavailable for static member functions")
+DEFERROR(ec_invalid_use_of_this_in_nonmember_function,
+ "invalid use of `this' in non-member function")
+DEFERROR(ec_invalid_use_of_this_at_top_level,
+ "invalid use of `this' at top level")
+DEFERROR(ec_signature_name_in_scope_resolution_ignored,
+ "signature name in scope resolution ignored")
+DEFERROR(ec_template_type_parameters_must_use_the_keyword_class_or_typename,
+ "template type parameters must use the keyword `class' or `typename'")
+DEFERROR(ec_invalid_base_class,
+ "invalid base class")
+DEFERROR(ec_access_and_source_specifiers_not_allowed_in_signature,
+ "access and source specifiers not allowed in signature")
+DEFERROR(ec_class_name_not_allowed_as_base_signature,
+ "class name not allowed as base signature")
+DEFERROR(ec_signature_name_not_allowed_as_base_class,
+ "signature name not allowed as base class")
+DEFERROR(ec_class_s_does_not_contain_a_method_conforming_to_s,
+ "class `%s' does not contain a method conforming to `%s'")
+DEFERROR(ec_signature_with_opaque_type_implemented_by_multiple_classes,
+ "signature with opaque type implemented by multiple classes")
+DEFERROR(ec_invalid_assignment_to_signature_pointer_or_reference,
+ "invalid assignment to signature pointer or reference")
+DEFERROR(ec_cannot_build_call_of_signature_member_function_s,
+ "cannot build call of signature member function `%s'")
+DEFERROR(ec_nonlvalue_in_s,
+ "non-lvalue in %s")
+DEFERROR(ec_base_class_s_ambiguous_in_binfo_value,
+ "base class `%s' ambiguous in binfo_value")
+DEFERROR(ec_argument_list_may_not_have_an_initializer_list,
+ "argument list may not have an initializer list")
+DEFERROR(ec_common_type_called_with_uncommon_aggregate_types,
+ "common_type called with uncommon aggregate types")
+DEFERROR(ec_common_type_called_with_uncommon_method_types,
+ "common_type called with uncommon method types")
+DEFERROR(ec_common_type_called_with_uncommon_member_types,
+ "common_type called with uncommon member types")
+DEFERROR(ec_forbids_taking_the_sizeof_a_function_type,
+ "ANSI C++ forbids taking the sizeof a function type")
+DEFERROR(ec_forbids_taking_the_sizeof_a_method_type,
+ "ANSI C++ forbids taking the sizeof a method type")
+DEFERROR(ec_forbids_taking_the_sizeof_a_void_type,
+ "ANSI C++ forbids taking the sizeof a void type")
+DEFERROR(ec_sizeof_applied_to_a_signature_type,
+ "`sizeof' applied to a signature type")
+DEFERROR(ec_sizeof_applied_to_a_bitfield,
+ "sizeof applied to a bit-field")
+DEFERROR(ec_alignof_applied_to_a_signature_type,
+ "`__alignof' applied to a signature type")
+DEFERROR(ec_void_value_not_ignored_as_it_ought_to_be,
+ "void value not ignored as it ought to be")
+DEFERROR(ec_invalid_use_of_nonlvalue_array,
+ "invalid use of non-lvalue array")
+DEFERROR(ec_invalid_reference_to_ptr_use_ptrtomember_instead,
+ "invalid reference to NULL ptr, use ptr-to-member instead")
+DEFERROR(ec_invalid_use_of_s_on_pointer_to_member_function,
+ "invalid use of `%s' on pointer to member function")
+DEFERROR(ec_cannot_dereference_signature_pointerreference,
+ "cannot dereference signature pointer/reference")
+DEFERROR(ec_invalid_type_argument_of_s,
+ "invalid type argument of `%s'")
+DEFERROR(ec_invalid_type_argument,
+ "invalid type argument")
+DEFERROR(ec_subscript_missing_in_array_reference,
+ "subscript missing in array reference")
+DEFERROR(ec_array_subscript_has_type_char,
+ "array subscript has type `char'")
+DEFERROR(ec_forbids_subscripting_nonlvalue_array,
+ "ANSI C++ forbids subscripting non-lvalue array")
+DEFERROR(ec_subscripting_array_declared_register,
+ "subscripting array declared `register'")
+DEFERROR(ec_subscripted_value_is_neither_array_nor_pointer,
+ "subscripted value is neither array nor pointer")
+DEFERROR(ec_array_subscript_is_not_an_integer,
+ "array subscript is not an integer")
+DEFERROR(ec_pointer_to_member_function_called_but_not_in_class_scope,
+ "pointer to member function called, but not in class scope")
+DEFERROR(ec_object_missing_in_call_to_method_s,
+ "object missing in call to method `%s'")
+DEFERROR(ec_invalid_call_to_member_function_needing_this_in_static_member_function_scope,
+ "invalid call to member function needing `this' in static member function scope")
+DEFERROR(ec_forbids_calling_main_from_within_program,
+ "ANSI C++ forbids calling `main' from within program")
+DEFERROR(ec_too_many_arguments_to_function,
+ "too many arguments to function")
+DEFERROR(ec_insufficient_type_information_in_parameter_list,
+ "insufficient type information in parameter list")
+DEFERROR(ec_parameter_type_of_called_function_is_incomplete,
+ "parameter type of called function is incomplete")
+DEFERROR(ec_too_few_arguments_to_function,
+ "too few arguments to function")
+DEFERROR(ec_right_shift_count_is_negative,
+ "right shift count is negative")
+DEFERROR(ec_right_shift_count_width_of_type,
+ "right shift count >= width of type")
+DEFERROR(ec_left_shift_count_is_negative,
+ "left shift count is negative")
+DEFERROR(ec_left_shift_count_width_of_type,
+ "left shift count >= width of type")
+DEFERROR(ec_s_rotate_count_is_negative,
+ "%s rotate count is negative")
+DEFERROR(ec_s_rotate_count_width_of_type,
+ "%s rotate count >= width of type")
+DEFERROR(ec_forbids_comparison_of_void_with_function_pointer,
+ "ANSI C++ forbids comparison of `void *' with function pointer")
+DEFERROR(ec_forbids_conversion_of_a_pointer_to_member_to_void,
+ "ANSI C++ forbids conversion of a pointer to member to `void *'")
+DEFERROR(ec_forbids_comparison_between_pointer_and_integer,
+ "ANSI C++ forbids comparison between pointer and integer")
+DEFERROR(ec_comparison_between_signed_and_unsigned,
+ "comparison between signed and unsigned")
+DEFERROR(ec_comparison_of_promoted_unsigned_with_constant,
+ "comparison of promoted ~unsigned with constant")
+DEFERROR(ec_comparison_of_promoted_unsigned_with_unsigned,
+ "comparison of promoted ~unsigned with unsigned")
+DEFERROR(ec_forbids_using_pointer_of_type_void_in_arithmetic,
+ "ANSI C++ forbids using pointer of type `void *' in arithmetic")
+DEFERROR(ec_forbids_using_pointer_to_a_function_in_arithmetic,
+ "ANSI C++ forbids using pointer to a function in arithmetic")
+DEFERROR(ec_forbids_using_pointer_to_a_method_in_arithmetic,
+ "ANSI C++ forbids using pointer to a method in arithmetic")
+DEFERROR(ec_forbids_using_pointer_to_a_member_in_arithmetic,
+ "ANSI C++ forbids using pointer to a member in arithmetic")
+DEFERROR(ec_forbids_using_pointer_of_type_void_in_subtraction,
+ "ANSI C++ forbids using pointer of type `void *' in subtraction")
+DEFERROR(ec_forbids_using_pointer_to_a_function_in_subtraction,
+ "ANSI C++ forbids using pointer to a function in subtraction")
+DEFERROR(ec_forbids_using_pointer_to_a_method_in_subtraction,
+ "ANSI C++ forbids using pointer to a method in subtraction")
+DEFERROR(ec_forbids_using_pointer_to_a_member_in_subtraction,
+ "ANSI C++ forbids using pointer to a member in subtraction")
+DEFERROR(ec_arithmetic_on_pointer_to_an_incomplete_type,
+ "arithmetic on pointer to an incomplete type")
+DEFERROR(ec_taking_address_of_temporary,
+ "taking address of temporary")
+DEFERROR(ec_forbids_sing_an_enum,
+ "ANSI C++ forbids %sing an enum")
+DEFERROR(ec_cast_to_nonreference_type_used_as_lvalue,
+ "cast to non-reference type used as lvalue")
+DEFERROR(ec_taking_address_of_function_main,
+ "taking address of function `main'")
+DEFERROR(ec_taking_the_address_of_a_cast_to_nonreference_type,
+ "taking the address of a cast to non-reference type")
+DEFERROR(ec_address_of_this_not_available,
+ "address of `this' not available")
+DEFERROR(ec_forbids_omitting_the_middle_term_of_a_expression,
+ "ANSI C++ forbids omitting the middle term of a ?: expression")
+DEFERROR(ec_enumeral_and_nonenumeral_type_in_conditional_expression,
+ "enumeral and non-enumeral type in conditional expression")
+DEFERROR(ec_forbids_conditional_expr_with_only_one_void_side,
+ "ANSI C++ forbids conditional expr with only one void side")
+DEFERROR(ec_forbids_conditional_expr_between_void_and_function_pointer,
+ "ANSI C++ forbids conditional expr between `void *' and function pointer")
+DEFERROR(ec_pointer_type_mismatch_in_conditional_expression,
+ "pointer type mismatch in conditional expression")
+DEFERROR(ec_pointerinteger_type_mismatch_in_conditional_expression,
+ "pointer/integer type mismatch in conditional expression")
+DEFERROR(ec_ambiguous_pointer_conversion,
+ "ambiguous pointer conversion")
+DEFERROR(ec_type_mismatch_in_conditional_expression,
+ "type mismatch in conditional expression")
+DEFERROR(ec_lefthand_operand_of_comma_expression_has_no_effect,
+ "left-hand operand of comma expression has no effect")
+DEFERROR(ec_forbids_casting_between_pointers_to_functions_and_objects,
+ "ANSI C++ forbids casting between pointers to functions and objects")
+DEFERROR(ec_forbids_casting_to_an_array_type,
+ "ANSI C++ forbids casting to an array type")
+DEFERROR(ec_cast_discards_volatile_from_pointer_target_type,
+ "cast discards `volatile' from pointer target type")
+DEFERROR(ec_cast_discards_const_from_pointer_target_type,
+ "cast discards `const' from pointer target type")
+DEFERROR(ec_cast_increases_required_alignment_of_target_type,
+ "cast increases required alignment of target type")
+DEFERROR(ec_cast_from_pointer_to_integer_of_different_size,
+ "cast from pointer to integer of different size")
+DEFERROR(ec_cast_to_pointer_from_integer_of_different_size,
+ "cast to pointer from integer of different size")
+DEFERROR(ec_invalid_static_class_member,
+ "invalid static class member")
+DEFERROR(ec_forbids_cast_to_nonreference_type_used_as_lvalue,
+ "ANSI C++ forbids cast to non-reference type used as lvalue")
+DEFERROR(ec_assignment_to_this_not_in_constructor_or_destructor,
+ "assignment to `this' not in constructor or destructor")
+DEFERROR(ec_forbids_assignment_of_arrays,
+ "ANSI C++ forbids assignment of arrays")
+DEFERROR(ec_return_value_from_function_receives_multiple_initializations,
+ "return value from function receives multiple initializations")
+DEFERROR(ec_in_pointer_to_member_function_conversion,
+ " in pointer to member function conversion")
+DEFERROR(ec_in_pointer_to_member_conversion,
+ " in pointer to member conversion")
+DEFERROR(ec_will_only_work_if_you_are_very_careful,
+ " will only work if you are very careful")
+DEFERROR(ec_assuming_pointer_to_member_function_is_nonvirtual,
+ "assuming pointer to member function is non-virtual")
+DEFERROR(ec_forbids_implicit_conversion_from_void_in_s,
+ "ANSI C++ forbids implicit conversion from `void *' in %s")
+DEFERROR(ec_s_between_pointer_to_members_converting_across_virtual_baseclasses,
+ "%s between pointer to members converting across virtual baseclasses")
+DEFERROR(ec_conflicting_function_types_in_s,
+ "conflicting function types in %s:")
+DEFERROR(ec_function_declared_noreturn_has_a_return_statement,
+ "function declared `noreturn' has a `return' statement")
+DEFERROR(ec_returning_a_value_from_a_destructor,
+ "returning a value from a destructor")
+DEFERROR(ec_return_with_no_value_in_function_returning_nonvoid,
+ "`return' with no value, in function returning non-void")
+DEFERROR(ec_return_from_a_constructor_use_this_instead,
+ "return from a constructor: use `this = ...' instead")
+DEFERROR(ec_returning_a_value_from_a_constructor,
+ "returning a value from a constructor")
+DEFERROR(ec_return_with_a_value_in_function_returning_void,
+ "`return' with a value, in function returning void")
+DEFERROR(ec_return_of_void_value_in_function_returning_nonvoid,
+ "return of void value in function returning non-void")
+DEFERROR(ec_returning_reference_to_temporary,
+ "returning reference to temporary")
+DEFERROR(ec_reference_to_nonlvalue_returned,
+ "reference to non-lvalue returned")
+DEFERROR(ec_switch_quantity_not_an_integer,
+ "switch quantity not an integer")
+DEFERROR(ec_since_the_following_virtual_functions_are_abstract,
+ " since the following virtual functions are abstract:")
+DEFERROR(ec_and_the_following_virtual_functions_need_a_final_overrider,
+ " and the following virtual functions need a final overrider:")
+DEFERROR(ec_since_the_following_virtual_functions_need_a_final_overrider,
+ " since the following virtual functions need a final overrider:")
+DEFERROR(ec_invalid_use_of_array_with_unspecified_bounds,
+ "invalid use of array with unspecified bounds")
+DEFERROR(ec_invalid_use_of_member_type_did_you_forget_the,
+ "invalid use of member type (did you forget the `&' ?)")
+DEFERROR(ec_invalid_use_of_template_type_parameter,
+ "invalid use of template type parameter")
+DEFERROR(ec_confused_by_earlier_errors_bailing_out,
+ "confused by earlier errors, bailing out")
+DEFERROR(ec_nternal_compiler_error,
+ "Internal compiler error.")
+DEFERROR(ec_nternal_compiler_error_d,
+ "Internal compiler error %d.")
+DEFERROR(ec_due_to_the_presence_of_a_constructor,
+ "due to the presence of a constructor")
+DEFERROR(ec_comma_expression_used_to_initialize_return_value,
+ "comma expression used to initialize return value")
+DEFERROR(ec_cannot_initialize_arrays_using_this_syntax,
+ "cannot initialize arrays using this syntax")
+DEFERROR(ec_forbids_nonconstant_aggregate_initializer_expressions,
+ "ANSI C++ forbids non-constant aggregate initializer expressions")
+DEFERROR(ec_initializing_array_with_parameter_list,
+ "initializing array with parameter list")
+DEFERROR(ec_chararray_initialized_from_wide_string,
+ "char-array initialized from wide string")
+DEFERROR(ec_intarray_initialized_from_nonwide_string,
+ "int-array initialized from non-wide string")
+DEFERROR(ec_initializerstring_for_array_of_chars_is_too_long,
+ "initializer-string for array of chars is too long")
+DEFERROR(ec_initializer_for_scalar_variable_requires_one_element,
+ "initializer for scalar variable requires one element")
+DEFERROR(ec_invalid_initializer,
+ "invalid initializer")
+DEFERROR(ec_aggregate_has_a_partly_bracketed_initializer,
+ "aggregate has a partly bracketed initializer")
+DEFERROR(ec_nonempty_initializer_for_array_of_empty_elements,
+ "non-empty initializer for array of empty elements")
+DEFERROR(ec_uninitialized_const_member_s,
+ "uninitialized const member `%s'")
+DEFERROR(ec_member_s_with_uninitialized_const_fields,
+ "member `%s' with uninitialized const fields")
+DEFERROR(ec_member_s_is_uninitialized_reference,
+ "member `%s' is uninitialized reference")
+DEFERROR(ec_missing_initializer_for_member_s,
+ "missing initializer for member `%s'")
+DEFERROR(ec_index_value_instead_of_field_name_in_union_initializer,
+ "index value instead of field name in union initializer")
+DEFERROR(ec_no_field_s_in_union_being_initialized,
+ "no field `%s' in union being initialized")
+DEFERROR(ec_excess_elements_in_aggregate_initializer,
+ "excess elements in aggregate initializer")
+DEFERROR(ec_circular_pointer_delegation_detected,
+ "circular pointer delegation detected")
+DEFERROR(ec_result_of_operator_yields_nonpointer_result,
+ "result of `operator->()' yields non-pointer result")
+DEFERROR(ec_base_operand_of_is_not_a_pointer,
+ "base operand of `->' is not a pointer")
+DEFERROR(ec_signature_type_not_allowed_in_cast_or_constructor_expression,
+ "signature type not allowed in cast or constructor expression")
+DEFERROR(ec_duplicate_label_s_in_switch_statement,
+ "duplicate label `%s' in switch statement")
+DEFERROR(ec_duplicate_label_d_in_switch_statement,
+ "duplicate label (%d) in switch statement")
+DEFERROR(ec_case_value_out_of_range_for_enum_s,
+ "case value out of range for enum %s")
+DEFERROR(ec_case_value_out_of_range,
+ "case value out of range")
+DEFERROR(ec_range_values_s_and_s_reversed,
+ "range values `%s' and `%s' reversed")
+DEFERROR(ec_range_values_reversed,
+ "range values reversed")
+DEFERROR(ec_forbids_defining_types_within_s,
+ "ANSI C++ forbids defining types within %s")
+DEFERROR(ec_ant_create_crossreference_file_s,
+ "can't create cross-reference file `%s'")
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3c3a858..829eeb37 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -493,6 +493,16 @@ enum cplus_tree_code {
};
#undef DEFTREECODE
+/* Error codes. */
+typedef enum error_code {
+#undef DEFERROR
+#undef DEFERRORNUM
+#define DEFERROR(code, string) code,
+#define DEFERRORNUM(code, string, num) DEFERROR(code, string)
+#include "cp-error.def"
+ ec_last_error_code
+} error_code;
+
enum languages { lang_c, lang_cplusplus, lang_java };
/* Macros to make error reporting functions' lives easier. */
@@ -2240,6 +2250,9 @@ extern int flag_new_abi;
extern int flag_honor_std;
+/* Nonzero means show diagnostic codes when printing error messages. */
+extern int flag_diag_codes;
+
/* Nonzero if we're done parsing and into end-of-file activities. */
extern int at_eof;
@@ -2627,6 +2640,7 @@ extern tree handle_class_head PROTO((tree, tree, tree));
extern tree lookup_arg_dependent PROTO((tree, tree, tree));
/* in errfn.c */
+#ifndef NO_CP_ERROR_FNS
extern void cp_error ();
extern void cp_error_at ();
extern void cp_warning ();
@@ -2635,6 +2649,8 @@ extern void cp_pedwarn ();
extern void cp_pedwarn_at ();
extern void cp_compiler_error ();
extern void cp_sprintf ();
+#endif
+extern void cp_enable_warning PROTO((int, int));
/* in error.c */
extern void init_error PROTO((void));
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index edb2d5b..0580f68 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -80,7 +80,7 @@ cp_convert_to_pointer (type, expr)
intype = complete_type (intype);
if (TYPE_SIZE (intype) == NULL_TREE)
{
- cp_error ("can't convert from incomplete type `%T' to `%T'",
+ cp_error (ec_cant_convert_from_incomplete_type_to,
intype, type);
return error_mark_node;
}
@@ -89,7 +89,7 @@ cp_convert_to_pointer (type, expr)
if (rval)
{
if (rval == error_mark_node)
- cp_error ("conversion of `%E' from `%T' to `%T' is ambiguous",
+ cp_error (ec_conversion_of_from_to_is_ambiguous,
expr, intype, type);
return rval;
}
@@ -134,7 +134,7 @@ cp_convert_to_pointer (type, expr)
{
if (TREE_CODE (TREE_TYPE (TREE_TYPE (expr))) == METHOD_TYPE)
if (pedantic || warn_pmf2ptr)
- cp_pedwarn ("converting from `%T' to `%T'", TREE_TYPE (expr),
+ cp_pedwarn (ec_converting_from_to, TREE_TYPE (expr),
type);
return build1 (NOP_EXPR, type, expr);
}
@@ -223,7 +223,7 @@ cp_convert_to_pointer (type, expr)
|| (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE))
{
- cp_error ("cannot convert `%E' from type `%T' to type `%T'",
+ cp_error (ec_cannot_convert_from_type_to_type,
expr, intype, type);
return error_mark_node;
}
@@ -262,7 +262,7 @@ cp_convert_to_pointer (type, expr)
return convert_to_pointer (type, expr);
}
- cp_error ("cannot convert `%E' from type `%T' to type `%T'",
+ cp_error (ec_cannot_convert_from_type_to_type,
expr, intype, type);
return error_mark_node;
}
@@ -311,7 +311,7 @@ convert_to_pointer_force (type, expr)
if (distance == -2)
{
ambig:
- cp_error ("type `%T' is ambiguous baseclass of `%s'",
+ cp_error (ec_type_is_ambiguous_baseclass_of_s,
TREE_TYPE (type),
TYPE_NAME_STRING (TREE_TYPE (intype)));
return error_mark_node;
@@ -454,19 +454,19 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
{
if (decl)
/* Ensure semantics of [dcl.init.ref] */
- cp_pedwarn ("initialization of non-const reference `%#T' from rvalue `%T'",
+ cp_pedwarn (ec_initialization_of_nonconst_reference_from_rvalue,
reftype, intype);
else
- cp_pedwarn ("conversion to non-const `%T' from rvalue `%T'",
+ cp_pedwarn (ec_conversion_to_nonconst_from_rvalue,
reftype, intype);
}
else if (! (convtype & CONV_CONST))
{
if (! TYPE_READONLY (ttl) && TYPE_READONLY (ttr))
- cp_pedwarn ("conversion from `%T' to `%T' discards const",
+ cp_pedwarn (ec_conversion_from_to_discards_const,
ttr, reftype);
else if (! TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
- cp_pedwarn ("conversion from `%T' to `%T' discards volatile",
+ cp_pedwarn (ec_conversion_from_to_discards_volatile,
ttr, reftype);
}
}
@@ -485,7 +485,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
meant. */
if (TREE_CODE (intype) == POINTER_TYPE
&& (comptypes (TREE_TYPE (intype), type, -1)))
- cp_warning ("casting `%T' to `%T' does not dereference pointer",
+ cp_warning (ec_casting_to_does_not_dereference_pointer,
intype, reftype);
rval = build_unary_op (ADDR_EXPR, expr, 0);
@@ -504,7 +504,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
rval = build_up_reference (reftype, rval, flags, 1);
if (rval && ! TYPE_READONLY (TREE_TYPE (reftype)))
- cp_pedwarn ("initializing non-const `%T' with `%T' will use a temporary",
+ cp_pedwarn (ec_initializing_nonconst_with_will_use_a_temporary,
reftype, intype);
}
@@ -517,7 +517,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
my_friendly_assert (TREE_CODE (intype) != OFFSET_TYPE, 189);
if (flags & LOOKUP_COMPLAIN)
- cp_error ("cannot convert type `%T' to type `%T'", intype, reftype);
+ cp_error (ec_cannot_convert_type_to_type, intype, reftype);
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
@@ -592,11 +592,11 @@ convert_pointer_to_real (binfo, expr)
but if it is, give them an error message that they can read. */
if (distance < 0)
{
- cp_error ("cannot convert a pointer of type `%T' to a pointer of type `%T'",
+ cp_error (ec_cannot_convert_a_pointer_of_type_to_a_pointer_of_type,
intype, type);
if (distance == -2)
- cp_error ("because `%T' is an ambiguous base class", type);
+ cp_error (ec_because_is_an_ambiguous_base_class, type);
return error_mark_node;
}
@@ -704,7 +704,7 @@ ocp_convert (type, expr, convtype, flags)
&& ((ARITHMETIC_TYPE_P (intype) && ! (convtype & CONV_STATIC))
|| (TREE_CODE (intype) == POINTER_TYPE)))
{
- cp_pedwarn ("conversion from `%#T' to `%#T'", intype, type);
+ cp_pedwarn (ec_conversion_from_to, intype, type);
if (flag_pedantic_errors)
return error_mark_node;
@@ -716,7 +716,7 @@ ocp_convert (type, expr, convtype, flags)
if (rval)
return rval;
if (flags & LOOKUP_COMPLAIN)
- cp_error ("`%#T' used where a `%T' was expected", intype, type);
+ cp_error (ec_used_where_a_was_expected, intype, type);
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
return error_mark_node;
@@ -726,7 +726,7 @@ ocp_convert (type, expr, convtype, flags)
/* Common Ada/Pascal programmer's mistake. We always warn
about this since it is so bad. */
if (TREE_CODE (expr) == FUNCTION_DECL)
- cp_warning ("the address of `%D', will always be `true'", expr);
+ cp_warning (ec_the_address_of_will_always_be_true, expr);
return truthvalue_conversion (e);
}
return fold (convert_to_integer (type, e));
@@ -744,7 +744,7 @@ ocp_convert (type, expr, convtype, flags)
return rval;
else
if (flags & LOOKUP_COMPLAIN)
- cp_error ("`%#T' used where a floating point value was expected",
+ cp_error (ec_used_where_a_floating_point_value_was_expected,
TREE_TYPE (e));
}
if (code == REAL_TYPE)
@@ -818,7 +818,7 @@ ocp_convert (type, expr, convtype, flags)
return e;
if (flags & LOOKUP_COMPLAIN)
- cp_error ("conversion from `%T' to non-scalar type `%T' requested",
+ cp_error (ec_conversion_from_to_nonscalar_type_requested,
TREE_TYPE (expr), type);
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
@@ -948,7 +948,7 @@ build_expr_type_conversion (desires, expr, complain)
if (expr == null_node
&& (desires & WANT_INT)
&& !(desires & WANT_NULL))
- cp_warning ("converting NULL to non-pointer type");
+ cp_warning (ec_converting_null_to_nonpointer_type);
if (TREE_CODE (basetype) == OFFSET_TYPE)
expr = resolve_offset_ref (expr);
@@ -1021,9 +1021,9 @@ build_expr_type_conversion (desires, expr, complain)
{
if (complain)
{
- cp_error ("ambiguous default type conversion from `%T'",
+ cp_error (ec_ambiguous_default_type_conversion_from,
basetype);
- cp_error (" candidate conversions include `%D' and `%D'",
+ cp_error (ec_candidate_conversions_include_and,
winner, cand);
}
return error_mark_node;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 42748ff..89cfc2d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -133,7 +133,7 @@ static struct stack_level *decl_stack;
static tree grokparms PROTO((tree, int));
static tree lookup_nested_type PROTO((tree, tree));
-static char *redeclaration_error_message PROTO((tree, tree));
+static error_code redeclaration_error_message PROTO((tree, tree));
static tree push_overloaded_decl PROTO((tree, int));
static struct stack_level *push_decl_level PROTO((struct stack_level *,
@@ -1117,7 +1117,7 @@ poplevel (keep, reverse, functionbody)
{
if (BLOCK_VARS (block) || BLOCK_TYPE_TAGS (block))
{
- warning ("internal compiler error: debugging info corrupted");
+ cp_warning (ec_internal_compiler_error_debugging_info_corrupted);
}
BLOCK_VARS (block) = decls;
BLOCK_TYPE_TAGS (block) = tags;
@@ -1257,12 +1257,12 @@ poplevel (keep, reverse, functionbody)
if (DECL_INITIAL (label) == NULL_TREE)
{
- cp_error_at ("label `%D' used but not defined", label);
+ cp_error_at (ec_label_used_but_not_defined, label);
/* Avoid crashing later. */
define_label (input_filename, 1, DECL_NAME (label));
}
else if (warn_unused && !TREE_USED (label))
- cp_warning_at ("label `%D' defined but not used", label);
+ cp_warning_at (ec_label_defined_but_not_used, label);
SET_IDENTIFIER_LABEL_VALUE (DECL_NAME (label), NULL_TREE);
/* Put the labels into the "variables" of the
@@ -1808,7 +1808,7 @@ push_namespace (name)
need_new = 0;
if (DECL_NAMESPACE_ALIAS (d))
{
- cp_error ("namespace alias `%D' not allowed here, assuming `%D'",
+ cp_error (ec_namespace_alias_not_allowed_here_assuming,
d, DECL_NAMESPACE_ALIAS (d));
d = DECL_NAMESPACE_ALIAS (d);
}
@@ -2520,9 +2520,9 @@ decls_match (newdecl, olddecl)
if (TREE_CODE (f1) != TREE_CODE (f2))
{
if (TREE_CODE (f1) == OFFSET_TYPE)
- cp_compiler_error ("`%D' redeclared as member function", newdecl);
+ cp_compiler_error (ec_redeclared_as_member_function, newdecl);
else
- cp_compiler_error ("`%D' redeclared as non-member function", newdecl);
+ cp_compiler_error (ec_redeclared_as_nonmember_function, newdecl);
return 0;
}
@@ -2603,11 +2603,6 @@ warn_extern_redeclared_static (newdecl, olddecl)
{
tree name;
- static char *explicit_extern_static_warning
- = "`%D' was declared `extern' and later `static'";
- static char *implicit_extern_static_warning
- = "`%D' was declared implicitly `extern' and later `static'";
-
if (TREE_CODE (newdecl) == TYPE_DECL)
return;
@@ -2623,10 +2618,10 @@ warn_extern_redeclared_static (newdecl, olddecl)
|| DECL_BUILT_IN_NONANSI (olddecl))))
{
cp_pedwarn (IDENTIFIER_IMPLICIT_DECL (name)
- ? implicit_extern_static_warning
- : explicit_extern_static_warning, newdecl);
+ ? ec_implicit_extern_static
+ : ec_explicit_extern_static, newdecl);
if (olddecl != NULL_TREE)
- cp_pedwarn_at ("previous declaration of `%D'", olddecl);
+ cp_pedwarn_at (ec_previous_declaration_of, olddecl);
}
}
}
@@ -2674,7 +2669,7 @@ duplicate_decls (newdecl, olddecl)
&& DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl)))
{
if (warn_shadow)
- cp_warning ("shadowing %s function `%#D'",
+ cp_warning (ec_shadowing_s_function,
DECL_BUILT_IN (olddecl) ? "built-in" : "library",
olddecl);
/* Discard the old built-in function. */
@@ -2687,19 +2682,19 @@ duplicate_decls (newdecl, olddecl)
/* If the built-in is not ansi, then programs can override
it even globally without an error. */
if (! DECL_BUILT_IN (olddecl))
- cp_warning ("library function `%#D' redeclared as non-function `%#D'",
+ cp_warning (ec_library_function_redeclared_as_nonfunction,
olddecl, newdecl);
else
{
- cp_error ("declaration of `%#D'", newdecl);
- cp_error ("conflicts with built-in declaration `%#D'",
+ cp_error (ec_declaration_of, newdecl);
+ cp_error (ec_conflicts_with_builtin_declaration,
olddecl);
}
return 0;
}
- cp_warning ("declaration of `%#D'", newdecl);
- cp_warning ("conflicts with built-in declaration `%#D'",
+ cp_warning (ec_declaration_of, newdecl);
+ cp_warning (ec_conflicts_with_builtin_declaration,
olddecl);
}
}
@@ -2729,10 +2724,10 @@ duplicate_decls (newdecl, olddecl)
&& DECL_FUNCTION_TEMPLATE_P (newdecl)))
return 0;
- cp_error ("`%#D' redeclared as different kind of symbol", newdecl);
+ cp_error (ec_redeclared_as_different_kind_of_symbol, newdecl);
if (TREE_CODE (olddecl) == TREE_LIST)
olddecl = TREE_VALUE (olddecl);
- cp_error_at ("previous declaration of `%#D'", olddecl);
+ cp_error_at (ec_previous_declaration_of, olddecl);
/* New decl is completely inconsistent with the old one =>
tell caller to replace the old one. */
@@ -2749,8 +2744,8 @@ duplicate_decls (newdecl, olddecl)
if (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == TYPE_DECL
|| TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL)
{
- cp_error ("declaration of template `%#D'", newdecl);
- cp_error_at ("conflicts with previous declaration `%#D'",
+ cp_error (ec_declaration_of_template, newdecl);
+ cp_error_at (ec_conflicts_with_previous_declaration,
olddecl);
}
else if (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == FUNCTION_DECL
@@ -2760,8 +2755,8 @@ duplicate_decls (newdecl, olddecl)
&& comp_template_parms (DECL_TEMPLATE_PARMS (newdecl),
DECL_TEMPLATE_PARMS (olddecl)))
{
- cp_error ("new declaration `%#D'", newdecl);
- cp_error_at ("ambiguates old declaration `%#D'", olddecl);
+ cp_error (ec_new_declaration, newdecl);
+ cp_error_at (ec_ambiguates_old_declaration, olddecl);
}
return 0;
}
@@ -2770,15 +2765,15 @@ duplicate_decls (newdecl, olddecl)
if (DECL_LANGUAGE (newdecl) == lang_c
&& DECL_LANGUAGE (olddecl) == lang_c)
{
- cp_error ("declaration of C function `%#D' conflicts with",
+ cp_error (ec_declaration_of_function_conflicts_with,
newdecl);
- cp_error_at ("previous declaration `%#D' here", olddecl);
+ cp_error_at (ec_previous_declaration_here, olddecl);
}
else if (compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)),
TYPE_ARG_TYPES (TREE_TYPE (olddecl)), 3))
{
- cp_error ("new declaration `%#D'", newdecl);
- cp_error_at ("ambiguates old declaration `%#D'", olddecl);
+ cp_error (ec_new_declaration, newdecl);
+ cp_error_at (ec_ambiguates_old_declaration, olddecl);
}
else
return 0;
@@ -2788,8 +2783,8 @@ duplicate_decls (newdecl, olddecl)
else if (current_class_type == NULL_TREE
|| IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type)
{
- cp_error ("conflicting types for `%#D'", newdecl);
- cp_error_at ("previous declaration as `%#D'", olddecl);
+ cp_error (ec_conflicting_types_for, newdecl);
+ cp_error_at (ec_previous_declaration_as, olddecl);
}
}
else if (TREE_CODE (newdecl) == FUNCTION_DECL
@@ -2825,15 +2820,15 @@ duplicate_decls (newdecl, olddecl)
return 1;
else
{
- char *errmsg = redeclaration_error_message (newdecl, olddecl);
- if (errmsg)
+ error_code ec = redeclaration_error_message (newdecl, olddecl);
+ if (ec != ec_last_error_code)
{
- cp_error (errmsg, newdecl);
+ cp_error (ec, newdecl);
if (DECL_NAME (olddecl) != NULL_TREE)
cp_error_at ((DECL_INITIAL (olddecl)
&& namespace_bindings_p ())
- ? "`%#D' previously defined here"
- : "`%#D' previously declared here", olddecl);
+ ? ec_previously_defined_here
+ : ec_previously_declared_here_2, olddecl);
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_INITIAL (olddecl) != NULL_TREE
@@ -2841,8 +2836,8 @@ duplicate_decls (newdecl, olddecl)
&& TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != NULL_TREE)
{
/* Prototype decl follows defn w/o prototype. */
- cp_warning_at ("prototype for `%#D'", newdecl);
- cp_warning_at ("follows non-prototype definition here", olddecl);
+ cp_warning_at (ec_prototype_for, newdecl);
+ cp_warning_at (ec_follows_nonprototype_definition_here, olddecl);
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl))
@@ -2854,9 +2849,9 @@ duplicate_decls (newdecl, olddecl)
DECL_LANGUAGE (newdecl) = DECL_LANGUAGE (olddecl);
else
{
- cp_error_at ("previous declaration of `%#D' with %L linkage",
+ cp_error_at (ec_previous_declaration_of_with_linkage,
olddecl, DECL_LANGUAGE (olddecl));
- cp_error ("conflicts with new declaration with %L linkage",
+ cp_error (ec_conflicts_with_new_declaration_with_linkage,
DECL_LANGUAGE (newdecl));
}
}
@@ -2881,17 +2876,17 @@ duplicate_decls (newdecl, olddecl)
{
if (pedantic)
{
- cp_pedwarn ("default argument given for parameter %d of `%#D'",
+ cp_pedwarn (ec_default_argument_given_for_parameter_d_of,
i, newdecl);
- cp_pedwarn_at ("after previous specification in `%#D'",
+ cp_pedwarn_at (ec_after_previous_specification_in,
olddecl);
}
}
else
{
- cp_error ("default argument given for parameter %d of `%#D'",
+ cp_error (ec_default_argument_given_for_parameter_d_of,
i, newdecl);
- cp_error_at ("after previous specification in `%#D'",
+ cp_error_at (ec_after_previous_specification_in,
olddecl);
}
}
@@ -2899,9 +2894,9 @@ duplicate_decls (newdecl, olddecl)
if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl)
&& TREE_ADDRESSABLE (olddecl) && warn_inline)
{
- cp_warning ("`%#D' was used before it was declared inline",
+ cp_warning (ec_was_used_before_it_was_declared_inline,
newdecl);
- cp_warning_at ("previous non-inline declaration here",
+ cp_warning_at (ec_previous_noninline_declaration_here,
olddecl);
}
}
@@ -2909,8 +2904,8 @@ duplicate_decls (newdecl, olddecl)
else if (TREE_READONLY (newdecl) != TREE_READONLY (olddecl)
|| TREE_THIS_VOLATILE (newdecl) != TREE_THIS_VOLATILE (olddecl))
{
- cp_pedwarn ("type qualifiers for `%#D'", newdecl);
- cp_pedwarn_at ("conflict with previous decl `%#D'", olddecl);
+ cp_pedwarn (ec_type_qualifiers_for, newdecl);
+ cp_pedwarn_at (ec_conflict_with_previous_decl, olddecl);
}
}
@@ -2950,8 +2945,8 @@ duplicate_decls (newdecl, olddecl)
/* Don't warn about friends, let add_friend take care of it. */
&& ! DECL_FRIEND_P (newdecl))
{
- cp_warning ("redundant redeclaration of `%D' in same scope", newdecl);
- cp_warning_at ("previous declaration of `%D'", olddecl);
+ cp_warning (ec_redundant_redeclaration_of_in_same_scope, newdecl);
+ cp_warning_at (ec_previous_declaration_of, olddecl);
}
}
@@ -2979,7 +2974,7 @@ duplicate_decls (newdecl, olddecl)
{
if (! duplicate_decls (DECL_TEMPLATE_RESULT (newdecl),
DECL_TEMPLATE_RESULT (olddecl)))
- cp_error ("invalid redeclaration of %D", newdecl);
+ cp_error (ec_invalid_redeclaration_of, newdecl);
TREE_TYPE (olddecl) = TREE_TYPE (DECL_TEMPLATE_RESULT (olddecl));
DECL_TEMPLATE_PARMS (olddecl) = DECL_TEMPLATE_PARMS (newdecl);
if (DECL_TEMPLATE_INFO (newdecl))
@@ -3027,9 +3022,9 @@ duplicate_decls (newdecl, olddecl)
&& flag_exceptions
&& ! compexcepttypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl)))
{
- cp_pedwarn ("declaration of `%D' throws different exceptions",
+ cp_pedwarn (ec_declaration_of_throws_different_exceptions,
newdecl);
- cp_pedwarn_at ("previous declaration here", olddecl);
+ cp_pedwarn_at (ec_previous_declaration_here, olddecl);
}
}
TREE_TYPE (newdecl) = TREE_TYPE (olddecl) = newtype;
@@ -3143,7 +3138,7 @@ duplicate_decls (newdecl, olddecl)
that specialization that would cause an implicit
instantiation to take place, in every translation unit in
which such a use occurs. */
- cp_error ("explicit specialization of %D after first use",
+ cp_error (ec_explicit_specialization_of_after_first_use,
olddecl);
SET_DECL_TEMPLATE_SPECIALIZATION (olddecl);
@@ -3364,7 +3359,7 @@ pushdecl (x)
{
/* error_mark_node is 0 for a while during initialization! */
t = NULL_TREE;
- cp_error_at ("`%#D' used prior to declaration", x);
+ cp_error_at (ec_used_prior_to_declaration, x);
}
else if (t != NULL_TREE)
@@ -3391,7 +3386,7 @@ pushdecl (x)
else if (t == wchar_decl_node)
{
if (pedantic && ! DECL_IN_SYSTEM_HEADER (x))
- cp_pedwarn ("redeclaration of wchar_t as `%T'", TREE_TYPE (x));
+ cp_pedwarn (ec_redeclaration_of_wchar_t_as, TREE_TYPE (x));
/* Throw away the redeclaration. */
return t;
@@ -3415,7 +3410,7 @@ pushdecl (x)
if (extra_warnings)
{
- cp_warning ("`static' missing from declaration of `%D'",
+ cp_warning (ec_static_missing_from_declaration_of,
t);
warning_with_file_and_line (file, line,
"previous declaration of `%s'",
@@ -3448,8 +3443,8 @@ pushdecl (x)
[basic.start.main]
This function shall not be overloaded. */
- cp_error_at ("invalid redeclaration of `%D'", t);
- cp_error ("as `%D'", x);
+ cp_error_at (ec_invalid_redeclaration_of, t);
+ cp_error (ec_as, x);
/* We don't try to push this declaration since that
causes a crash. */
return x;
@@ -3517,8 +3512,8 @@ pushdecl (x)
&& TREE_CODE (decl) == TREE_CODE (x)
&& ! comptypes (TREE_TYPE (x), TREE_TYPE (decl), 1))
{
- cp_pedwarn ("type mismatch with previous external decl", x);
- cp_pedwarn_at ("previous external decl of `%#D'", decl);
+ cp_pedwarn (ec_type_mismatch_with_previous_external_decl, x);
+ cp_pedwarn_at (ec_previous_external_decl_of, decl);
}
}
@@ -3561,8 +3556,7 @@ pushdecl (x)
/* If this real decl matches the implicit, don't complain. */
&& ! (TREE_CODE (x) == FUNCTION_DECL
&& TREE_TYPE (TREE_TYPE (x)) == integer_type_node))
- cp_warning
- ("`%D' was previously implicitly declared to return `int'", x);
+ cp_warning (ec_was_previously_implicitly_declared_to_return_int, x);
/* If new decl is `static' and an `extern' was seen previously,
warn about it. */
@@ -3605,8 +3599,8 @@ pushdecl (x)
/* OK */;
else
{
- cp_warning ("extern declaration of `%#D' doesn't match", x);
- cp_warning_at ("global declaration `%#D'", oldglobal);
+ cp_warning (ec_extern_declaration_of_doesnt_match, x);
+ cp_warning_at (ec_global_declaration, oldglobal);
}
}
/* If we have a local external declaration,
@@ -3637,14 +3631,14 @@ pushdecl (x)
/* ARM $8.3 */
if (b->parm_flag == 1)
- cp_error ("declaration of `%#D' shadows a parameter", name);
+ cp_error (ec_declaration_of_shadows_a_parameter, name);
}
else if (warn_shadow && oldlocal != NULL_TREE && b->is_for_scope
&& !DECL_DEAD_FOR_LOCAL (oldlocal))
{
- warning ("variable `%s' shadows local",
+ cp_warning (ec_variable_s_shadows_local,
IDENTIFIER_POINTER (name));
- cp_warning_at (" this is the shadowed declaration", oldlocal);
+ cp_warning_at (ec_this_is_the_shadowed_declaration, oldlocal);
}
/* Maybe warn if shadowing something else. */
else if (warn_shadow && !DECL_EXTERNAL (x)
@@ -3676,8 +3670,8 @@ pushdecl (x)
{
if (decl_template_parm_p (oldlocal))
{
- cp_error ("re-using name of template parameter `%T' in this scope", name);
- cp_error_at (" previously declared here `%#D'", oldlocal);
+ cp_error (ec_reusing_name_of_template_parameter_in_this_scope, name);
+ cp_error_at (ec_previously_declared_here, oldlocal);
}
}
}
@@ -3825,8 +3819,8 @@ pushdecl_class_level (x)
&& !(DECL_DECLARES_TYPE_P (icv)
&& DECL_CONTEXT (icv) == current_class_type))
{
- cp_pedwarn ("declaration of identifier `%D' as `%#D'", name, x);
- cp_pedwarn_at ("conflicts with previous use in class as `%#D'",
+ cp_pedwarn (ec_declaration_of_identifier_as, name, x);
+ cp_pedwarn_at (ec_conflicts_with_previous_use_in_class_as,
icv);
}
@@ -3837,8 +3831,8 @@ pushdecl_class_level (x)
{
if (decl_template_parm_p (ilv))
{
- cp_error ("re-using name of template parameter `%T' in this scope", name);
- cp_error_at (" previously declared here `%#D'", ilv);
+ cp_error (ec_reusing_name_of_template_parameter_in_this_scope, name);
+ cp_error_at (ec_previously_declared_here, ilv);
}
}
}
@@ -4006,7 +4000,7 @@ push_overloaded_decl (decl, forgettable)
if (IS_AGGR_TYPE (t) && warn_shadow
&& (! DECL_IN_SYSTEM_HEADER (decl)
|| ! DECL_IN_SYSTEM_HEADER (old)))
- cp_warning ("`%#D' hides constructor for `%#T'", decl, t);
+ cp_warning (ec_hides_constructor_for, decl, t);
old = NULL_TREE;
}
else if (is_overloaded_fn (old))
@@ -4020,8 +4014,8 @@ push_overloaded_decl (decl, forgettable)
}
else
{
- cp_error_at ("previous non-function declaration `%#D'", old);
- cp_error ("conflicts with function declaration `%#D'", decl);
+ cp_error_at (ec_previous_nonfunction_declaration, old);
+ cp_error (ec_conflicts_with_function_declaration, decl);
return decl;
}
}
@@ -4079,7 +4073,7 @@ implicitly_declare (functionid)
/* Only one warning per identifier. */
&& IDENTIFIER_IMPLICIT_DECL (functionid) == NULL_TREE)
{
- cp_pedwarn ("implicit declaration of function `%#D'", decl);
+ cp_pedwarn (ec_implicit_declaration_of_function, decl);
}
SET_IDENTIFIER_IMPLICIT_DECL (functionid, decl);
@@ -4089,13 +4083,13 @@ implicitly_declare (functionid)
return decl;
}
-/* Return zero if the declaration NEWDECL is valid
+/* Return ec_last_error_code if the declaration NEWDECL is valid
when the declaration OLDDECL (assumed to be for the same name)
has already been seen.
Otherwise return an error message format string with a %s
where the identifier should go. */
-static char *
+static error_code
redeclaration_error_message (newdecl, olddecl)
tree newdecl, olddecl;
{
@@ -4105,9 +4099,9 @@ redeclaration_error_message (newdecl, olddecl)
constructs like "typedef struct foo { ... } foo"
would look like an erroneous redeclaration. */
if (comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl), 0))
- return 0;
+ return ec_last_error_code;
else
- return "redefinition of `%#D'";
+ return ec_redefinition_of;
}
else if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
@@ -4115,13 +4109,13 @@ redeclaration_error_message (newdecl, olddecl)
the original initialization to `0' (which we force to call
abort()). Don't complain about redefinition in this case. */
if (DECL_LANG_SPECIFIC (olddecl) && DECL_ABSTRACT_VIRTUAL_P (olddecl))
- return 0;
+ return ec_last_error_code;
/* If both functions come from different namespaces, this is not
a redeclaration - this is a conflict with a used function. */
if (DECL_NAMESPACE_SCOPE_P (olddecl)
&& DECL_CONTEXT (olddecl) != DECL_CONTEXT (newdecl))
- return "`%D' conflicts with used function";
+ return ec_conflicts_with_used_function;
/* We'll complain about linkage mismatches in
warn_extern_redeclared_static. */
@@ -4131,11 +4125,11 @@ redeclaration_error_message (newdecl, olddecl)
&& DECL_INITIAL (newdecl) != NULL_TREE)
{
if (DECL_NAME (olddecl) == NULL_TREE)
- return "`%#D' not declared in class";
+ return ec_not_declared_in_class;
else
- return "redefinition of `%#D'";
+ return ec_redefinition_of;
}
- return 0;
+ return ec_last_error_code;
}
else if (TREE_CODE (newdecl) == TEMPLATE_DECL)
{
@@ -4145,17 +4139,17 @@ redeclaration_error_message (newdecl, olddecl)
|| (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL
&& TYPE_SIZE (TREE_TYPE (newdecl))
&& TYPE_SIZE (TREE_TYPE (olddecl))))
- return "redefinition of `%#D'";
- return 0;
+ return ec_redefinition_of;
+ return ec_last_error_code;
}
else if (toplevel_bindings_p ())
{
/* Objects declared at top level: */
/* If at least one is a reference, it's ok. */
if (DECL_EXTERNAL (newdecl) || DECL_EXTERNAL (olddecl))
- return 0;
+ return ec_last_error_code;
/* Reject two definitions. */
- return "redefinition of `%#D'";
+ return ec_redefinition_of;
}
else
{
@@ -4163,8 +4157,8 @@ redeclaration_error_message (newdecl, olddecl)
/* Reject two definitions, and reject a definition
together with an external reference. */
if (!(DECL_EXTERNAL (newdecl) && DECL_EXTERNAL (olddecl)))
- return "redeclaration of `%#D'";
- return 0;
+ return ec_redeclaration_of;
+ return ec_last_error_code;
}
}
@@ -4180,7 +4174,7 @@ lookup_label (id)
if (current_function_decl == NULL_TREE)
{
- error ("label `%s' referenced outside of any function",
+ cp_error (ec_label_s_referenced_outside_of_any_function,
IDENTIFIER_POINTER (id));
return NULL_TREE;
}
@@ -4297,11 +4291,11 @@ define_label (filename, line, name)
}
if (name == get_identifier ("wchar_t"))
- cp_pedwarn ("label named wchar_t");
+ cp_pedwarn (ec_label_named_wchar_t);
if (DECL_INITIAL (decl) != NULL_TREE)
{
- cp_error ("duplicate label `%D'", decl);
+ cp_error (ec_duplicate_label, decl);
return 0;
}
else
@@ -4340,13 +4334,13 @@ define_label (filename, line, name)
{
if (! identified)
{
- cp_error ("jump to label `%D'", decl);
+ cp_error (ec_jump_to_label, decl);
error_with_file_and_line (uses->filename_o_goto,
uses->lineno_o_goto,
" from here");
identified = 1;
}
- cp_error_at (" crosses initialization of `%#D'",
+ cp_error_at (ec_crosses_initialization_of,
new_decls);
}
new_decls = TREE_CHAIN (new_decls);
@@ -4411,12 +4405,12 @@ define_case_label (decl)
if (cleanup)
{
static int explained = 0;
- cp_warning_at ("destructor needed for `%#D'", TREE_PURPOSE (cleanup));
- warning ("where case label appears here");
+ cp_warning_at (ec_destructor_needed_for, TREE_PURPOSE (cleanup));
+ cp_warning (ec_where_case_label_appears_here);
if (!explained)
{
- warning ("(enclose actions of previous case statements requiring");
- warning ("destructors in their own binding contours.)");
+ cp_warning (ec_enclose_actions_of_previous_case_statements_requiring);
+ cp_warning (ec_destructors_in_their_own_binding_contours);
explained = 1;
}
}
@@ -4437,9 +4431,9 @@ define_case_label (decl)
|| TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (new_decls))))
{
if (! identified)
- error ("jump to case label");
+ cp_error (ec_jump_to_case_label);
identified = 1;
- cp_error_at (" crosses initialization of `%#D'",
+ cp_error_at (ec_crosses_initialization_of,
new_decls);
}
}
@@ -4549,7 +4543,7 @@ lookup_tag (form, name, binding_level, thislevel_only)
if (old && TREE_CODE (old) != form
&& !(form != ENUMERAL_TYPE && TREE_CODE (old) == TEMPLATE_DECL))
{
- cp_error ("`%#D' redeclared as %C", old, form);
+ cp_error (ec_redeclared_as, old, form);
return NULL_TREE;
}
if (old)
@@ -4569,7 +4563,7 @@ lookup_tag (form, name, binding_level, thislevel_only)
&& !(form != ENUMERAL_TYPE && code == TEMPLATE_DECL))
{
/* Definition isn't the kind we were looking for. */
- cp_error ("`%#D' redeclared as %C", TREE_VALUE (tail),
+ cp_error (ec_redeclared_as, TREE_VALUE (tail),
form);
return NULL_TREE;
}
@@ -4624,7 +4618,7 @@ lookup_tag (form, name, binding_level, thislevel_only)
{
if (TREE_CODE (TREE_VALUE (these_tags)) != form)
{
- cp_error ("`%#D' redeclared as %C in class scope",
+ cp_error (ec_redeclared_as_in_class_scope,
TREE_VALUE (tail), form);
return NULL_TREE;
}
@@ -4761,7 +4755,7 @@ lookup_namespace_name (namespace, name)
return val;
}
- cp_error ("`%D' undeclared in namespace `%D'", name, namespace);
+ cp_error (ec_undeclared_in_namespace, name, namespace);
return error_mark_node;
}
@@ -4801,7 +4795,7 @@ make_typename_type (context, name)
if (t == NULL_TREE || TREE_CODE (t) != TEMPLATE_DECL
|| TREE_CODE (DECL_RESULT (t)) != TYPE_DECL)
{
- cp_error ("no class template named `%#T' in `%#T'",
+ cp_error (ec_no_class_template_named_in,
name, context);
return error_mark_node;
}
@@ -4819,7 +4813,7 @@ make_typename_type (context, name)
if (t == NULL_TREE)
{
- cp_error ("no type named `%#T' in `%#T'", name, context);
+ cp_error (ec_no_type_named_in, name, context);
return error_mark_node;
}
@@ -5155,13 +5149,12 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
if (val && nsval && TREE_CODE (nsval) == TYPE_DECL)
{
static int explained;
- cp_warning ("namespace-scope type `%#D'", nsval);
- cp_warning
- (" is used instead of `%D' from dependent base class", val);
+ cp_warning (ec_namespacescope_type, nsval);
+ cp_warning (ec_used_instead_of_decl_from_base, val);
if (! explained)
{
explained = 1;
- cp_warning (" (use `typename %D' if that's what you meant)",
+ cp_warning (ec_use_typename_if_thats_what_you_meant,
val);
}
val = nsval;
@@ -5178,9 +5171,9 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
&& TREE_CODE (val) == TYPE_DECL
&& TREE_TYPE (from_obj) != TREE_TYPE (val))
{
- cp_pedwarn ("lookup of `%D' in the scope of `%#T' (`%#T')",
+ cp_pedwarn (ec_lookup_of_in_the_scope_of,
name, got_object, TREE_TYPE (from_obj));
- cp_pedwarn (" does not match lookup in the current scope (`%#T')",
+ cp_pedwarn (ec_does_not_match_lookup_in_the_current_scope,
TREE_TYPE (val));
}
@@ -6356,7 +6349,7 @@ shadow_tag (declspecs)
/* ANSI C++ June 5 1992 WP 9.5.3. Anonymous unions may not have
function members. */
if (TYPE_METHODS (t))
- error ("an anonymous union cannot have function members");
+ cp_error (ec_an_anonymous_union_cannot_have_function_members);
if (TYPE_FIELDS (t))
{
@@ -6374,19 +6367,19 @@ shadow_tag (declspecs)
{
if (ob_modifier == ridpointers[(int) RID_INLINE]
|| ob_modifier == ridpointers[(int) RID_VIRTUAL])
- cp_error ("`%D' can only be specified for functions", ob_modifier);
+ cp_error (ec_can_only_be_specified_for_functions, ob_modifier);
else if (ob_modifier == ridpointers[(int) RID_EXPLICIT])
- cp_error ("`%D' can only be specified for constructors",
+ cp_error (ec_can_only_be_specified_for_constructors,
ob_modifier);
else
- cp_error ("`%D' can only be specified for objects and functions",
+ cp_error (ec_can_only_be_specified_for_objects_and_functions,
ob_modifier);
}
if (found_tag == 0)
- cp_error ("abstract declarator used as declaration");
+ cp_error (ec_abstract_declarator_used_as_declaration);
else if (found_tag > 1)
- pedwarn ("multiple types in one declaration");
+ cp_pedwarn (ec_multiple_types_in_one_declaration);
}
}
@@ -6503,13 +6496,13 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
Any other case of an initialization in a TYPE_DECL is an error. */
if (pedantic || list_length (declspecs) > 1)
{
- cp_error ("typedef `%D' is initialized", decl);
+ cp_error (ec_typedef_is_initialized, decl);
initialized = 0;
}
break;
case FUNCTION_DECL:
- cp_error ("function `%#D' is initialized like a variable", decl);
+ cp_error (ec_function_is_initialized_like_a_variable, decl);
initialized = 0;
break;
@@ -6521,8 +6514,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (TYPE_SIZE (type) != NULL_TREE
&& ! TREE_CONSTANT (TYPE_SIZE (type)))
{
- cp_error
- ("variable-sized object `%D' may not be initialized",
+ cp_error (ec_variablesized_object_may_not_be_initialized,
decl);
initialized = 0;
}
@@ -6530,8 +6522,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_SIZE (complete_type (TREE_TYPE (type))) == NULL_TREE)
{
- cp_error
- ("elements of array `%#D' have incomplete type", decl);
+ cp_error (ec_elements_of_array_have_incomplete_type, decl);
initialized = 0;
}
}
@@ -6542,7 +6533,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
{
if (! toplevel_bindings_p ()
&& DECL_EXTERNAL (decl))
- cp_warning ("declaration of `%#D' has `extern' and is initialized",
+ cp_warning (ec_declaration_of_has_extern_and_is_initialized,
decl);
DECL_EXTERNAL (decl) = 0;
if (toplevel_bindings_p ())
@@ -6560,12 +6551,12 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
{
tree field = lookup_field (context, DECL_NAME (decl), 0, 0);
if (field == NULL_TREE || TREE_CODE (field) != VAR_DECL)
- cp_error ("`%#D' is not a static member of `%#T'", decl, context);
+ cp_error (ec_is_not_a_static_member_of, decl, context);
else
{
if (DECL_CONTEXT (field) != context)
{
- cp_pedwarn ("ANSI C++ does not permit `%T::%D' to be defined as `%T::%D'",
+ cp_pedwarn (ec_does_not_permit_to_be_defined_as,
DECL_CONTEXT (field), DECL_NAME (decl),
context, DECL_NAME (decl));
DECL_CONTEXT (decl) = DECL_CONTEXT (field);
@@ -6576,7 +6567,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
initialization. Thus, duplicate_decls won't warn
about this situation, and so we check here. */
if (DECL_INITIAL (decl) && DECL_INITIAL (field))
- cp_error ("duplicate initialization of %D", decl);
+ cp_error (ec_duplicate_initialization_of, decl);
if (duplicate_decls (decl, field))
decl = field;
}
@@ -6595,7 +6586,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
SET_DECL_TEMPLATE_SPECIALIZATION (decl);
if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl))
- cp_pedwarn ("declaration of `%#D' outside of class is not definition",
+ cp_pedwarn (ec_declaration_of_outside_of_class_is_not_definition,
decl);
pushclass (context, 2);
@@ -6706,7 +6697,7 @@ start_decl_1 (decl)
; /* A complete type is ok. */
else if (TREE_CODE (type) != ARRAY_TYPE)
{
- cp_error ("variable `%#D' has initializer but incomplete type",
+ cp_error (ec_variable_has_initializer_but_incomplete_type,
decl);
initialized = 0;
type = TREE_TYPE (decl) = error_mark_node;
@@ -6714,7 +6705,7 @@ start_decl_1 (decl)
else if (TYPE_SIZE (complete_type (TREE_TYPE (type))) == NULL_TREE)
{
if (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl))
- cp_error ("elements of array `%#D' have incomplete type", decl);
+ cp_error (ec_elements_of_array_have_incomplete_type, decl);
/* else we already gave an error in start_decl. */
initialized = 0;
}
@@ -6728,7 +6719,7 @@ start_decl_1 (decl)
if ((! processing_template_decl || ! uses_template_parms (type))
&& TYPE_SIZE (complete_type (type)) == NULL_TREE)
{
- cp_error ("aggregate `%#D' has incomplete type and cannot be initialized",
+ cp_error (ec_aggregate_has_incomplete_type_and_cannot_be_initialized,
decl);
/* Change the type so that assemble_variable will give
DECL an rtl we can live with: (mem (const_int 0)). */
@@ -6785,7 +6776,7 @@ grok_reference_init (decl, type, init)
|| DECL_IN_AGGR_P (decl) == 0)
&& ! DECL_THIS_EXTERN (decl))
{
- cp_error ("`%D' declared as reference but not initialized", decl);
+ cp_error (ec_declared_as_reference_but_not_initialized, decl);
if (TREE_CODE (decl) == VAR_DECL)
SET_DECL_REFERENCE_SLOT (decl, error_mark_node);
}
@@ -6798,7 +6789,7 @@ grok_reference_init (decl, type, init)
if (TREE_CODE (type) == REFERENCE_TYPE
&& TREE_CODE (init) == CONSTRUCTOR)
{
- cp_error ("ANSI C++ forbids use of initializer list to initialize reference `%D'", decl);
+ cp_error (ec_forbids_use_of_initializer_list_to_initialize_reference, decl);
return;
}
@@ -6832,7 +6823,7 @@ grok_reference_init (decl, type, init)
}
else
{
- cp_error ("cannot initialize `%T' from `%T'", type, TREE_TYPE (init));
+ cp_error (ec_cannot_initialize_from, type, TREE_TYPE (init));
goto fail;
}
@@ -6927,7 +6918,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (! decl)
{
if (init)
- error ("assignment (not initialization) in declaration");
+ cp_error (ec_assignment_not_initialization_in_declaration);
return;
}
@@ -6937,7 +6928,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (init && TREE_CODE (init) == NAMESPACE_DECL)
{
- cp_error ("Cannot initialize `%D' to namespace `%D'",
+ cp_error (ec_annot_initialize_to_namespace,
decl, init);
init = NULL_TREE;
}
@@ -7002,7 +6993,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
&& IS_AGGR_TYPE (type) && DECL_NAME (decl))
{
if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type)
- cp_warning ("shadowing previous type declaration of `%#D'", decl);
+ cp_warning (ec_shadowing_previous_type_declaration_of, decl);
set_identifier_type_value (DECL_NAME (decl), type);
CLASSTYPE_GOT_SEMICOLON (type) = 1;
}
@@ -7090,7 +7081,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
{
if (TYPE_NON_AGGREGATE_CLASS (type))
{
- cp_error ("`%D' must be initialized by constructor, not by `{...}'",
+ cp_error (ec_must_be_initialized_by_constructor_not_by,
decl);
init = error_mark_node;
}
@@ -7121,9 +7112,9 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (! TYPE_NEEDS_CONSTRUCTING (ctype))
{
if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (ctype))
- cp_error ("structure `%D' with uninitialized const members", decl);
+ cp_error (ec_structure_with_uninitialized_const_members, decl);
if (CLASSTYPE_REF_FIELDS_NEED_INIT (ctype))
- cp_error ("structure `%D' with uninitialized reference members",
+ cp_error (ec_structure_with_uninitialized_reference_members,
decl);
}
@@ -7131,7 +7122,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
&& !DECL_INITIAL (decl)
&& !TYPE_NEEDS_CONSTRUCTING (type)
&& (TYPE_READONLY (type) || TREE_READONLY (decl)))
- cp_error ("uninitialized const `%D'", decl);
+ cp_error (ec_uninitialized_const, decl);
if (TYPE_SIZE (type) != NULL_TREE
&& TYPE_NEEDS_CONSTRUCTING (type))
@@ -7150,7 +7141,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (! DECL_INITIAL (decl)
&& TREE_CODE (type) != ARRAY_TYPE
&& (!pedantic || !current_class_type))
- cp_error ("uninitialized const `%#D'", decl);
+ cp_error (ec_uninitialized_const, decl);
}
/* For top-level declaration, the initial value was read in
@@ -7177,12 +7168,12 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
int failure = complete_array_type (type, initializer, do_default);
if (failure == 1)
- cp_error ("initializer fails to determine size of `%D'", decl);
+ cp_error (ec_initializer_fails_to_determine_size_of, decl);
if (failure == 2)
{
if (do_default)
- cp_error ("array size missing in `%D'", decl);
+ cp_error (ec_array_size_missing_in, decl);
/* If a `static' var's size isn't known, make it extern as
well as static, so it does not get allocated. If it's not
`static', then don't mark it extern; finish_incomplete_decl
@@ -7194,7 +7185,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (pedantic && TYPE_DOMAIN (type) != NULL_TREE
&& tree_int_cst_lt (TYPE_MAX_VALUE (TYPE_DOMAIN (type)),
integer_zero_node))
- cp_error ("zero-size array `%D'", decl);
+ cp_error (ec_zerosize_array, decl);
layout_decl (decl, 0);
}
@@ -7212,7 +7203,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
Otherwise, let it through, but if it is not `extern'
then it may cause an error message later. */
if (DECL_INITIAL (decl) != NULL_TREE)
- cp_error ("storage size of `%D' isn't known", decl);
+ cp_error (ec_storage_size_of_isnt_known, decl);
init = NULL_TREE;
}
else if (!DECL_EXTERNAL (decl) && DECL_SIZE (decl) == NULL_TREE)
@@ -7220,7 +7211,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
/* An automatic variable with an incomplete type: that is an error.
Don't talk about array types here, since we took care of that
message in grokdeclarator. */
- cp_error ("storage size of `%D' isn't known", decl);
+ cp_error (ec_storage_size_of_isnt_known, decl);
TREE_TYPE (decl) = error_mark_node;
}
else if (!DECL_EXTERNAL (decl) && IS_AGGR_TYPE (ttype))
@@ -7237,7 +7228,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
else
- cp_error ("storage size of `%D' isn't constant", decl);
+ cp_error (ec_storage_size_of_isnt_constant, decl);
}
if (! DECL_EXTERNAL (decl) && TYPE_NEEDS_DESTRUCTOR (type)
@@ -7459,7 +7450,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
/* XXX: Why don't we use decl here? */
/* Ans: Because it was already expanded? */
if (! expand_decl_cleanup (NULL_TREE, cleanup))
- cp_error ("parser lost in parsing declaration of `%D'",
+ cp_error (ec_parser_lost_in_parsing_declaration_of,
decl);
/* Cleanup used up here. */
cleanup = NULL_TREE;
@@ -7555,7 +7546,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (cleanup)
{
if (! expand_decl_cleanup (decl, cleanup))
- cp_error ("parser lost in parsing declaration of `%D'",
+ cp_error (ec_parser_lost_in_parsing_declaration_of,
decl);
}
}
@@ -7634,7 +7625,7 @@ expand_static_init (decl, init)
if (oldstatic)
{
if (TREE_PURPOSE (oldstatic) && init != NULL_TREE)
- cp_error ("multiple initializations given for `%D'", decl);
+ cp_error (ec_multiple_initializations_given_for, decl);
}
else if (! toplevel_bindings_p () && ! pseudo_global_level_p ())
{
@@ -7831,16 +7822,16 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
int virtualp, quals, friendp, raises, inlinep;
{
if (virtualp)
- cp_error ("`%D' declared as a `virtual' %s", object, type);
+ cp_error (ec_declared_as_a_virtual_s, object, type);
if (inlinep)
- cp_error ("`%D' declared as an `inline' %s", object, type);
+ cp_error (ec_declared_as_an_inline_s, object, type);
if (quals)
- cp_error ("`const' and `volatile' function specifiers on `%D' invalid in %s declaration",
+ cp_error (ec_const_and_volatile_function_specifiers_on_invalid_in_s_declaration,
object, type);
if (friendp)
- cp_error_at ("invalid friend declaration", object);
+ cp_error_at (ec_invalid_friend_declaration, object);
if (raises)
- cp_error_at ("invalid exception specifications", object);
+ cp_error_at (ec_invalid_exception_specifications, object);
}
/* CTYPE is class type, or null if non-class.
@@ -7905,9 +7896,9 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (ctype == NULL_TREE && MAIN_NAME_P (declarator))
{
if (inlinep)
- error ("cannot declare `main' to be inline");
+ cp_error (ec_cannot_declare_main_to_be_inline);
else if (! publicp)
- error ("cannot declare `main' to be static");
+ cp_error (ec_cannot_declare_main_to_be_static);
inlinep = 0;
publicp = 1;
}
@@ -7927,9 +7918,9 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (t)
{
if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
- cp_pedwarn ("non-local function `%#D' uses anonymous type", decl);
+ cp_pedwarn (ec_nonlocal_function_uses_anonymous_type, decl);
else
- cp_pedwarn ("non-local function `%#D' uses local type `%T'",
+ cp_pedwarn (ec_nonlocal_function_uses_local_type,
decl, t);
}
}
@@ -7947,7 +7938,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
DECL_EXTERNAL (decl) = 1;
if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE)
{
- cp_error ("%smember function `%D' cannot have `%T' method qualifier",
+ cp_error (ec_smember_function_cannot_have_method_qualifier,
(ctype ? "static " : "non-"), decl, TREE_VALUE (quals));
quals = NULL_TREE;
}
@@ -7970,15 +7961,14 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
&& TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
{
if (funcdef_flag)
- cp_error
- ("defining explicit specialization `%D' in friend declaration",
+ cp_error (ec_defining_explicit_specialization_in_friend_declaration,
orig_declarator);
else
{
if (PROCESSING_REAL_TEMPLATE_DECL_P ())
{
/* Something like `template <class T> friend void f<T>()'. */
- cp_error ("template-id `%D' in declaration of primary template",
+ cp_error (ec_templateid_in_declaration_of_primary_template,
orig_declarator);
return error_mark_node;
}
@@ -8028,7 +8018,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
tmp = DECL_TEMPLATE_RESULT(tmp);
if (tmp && DECL_ARTIFICIAL (tmp))
- cp_error ("definition of implicitly-declared `%D'", tmp);
+ cp_error (ec_definition_of_implicitlydeclared, tmp);
if (tmp && duplicate_decls (decl, tmp))
return tmp;
}
@@ -8042,7 +8032,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (tmp == NULL_TREE)
SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (decl), decl);
else if (TREE_CODE (tmp) != TREE_CODE (decl))
- cp_error ("inconsistent declarations for `%D'", decl);
+ cp_error (ec_inconsistent_declarations_for, decl);
else
{
duplicate_decls (decl, tmp);
@@ -8086,7 +8076,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
last_function_parms = TREE_CHAIN (last_function_parms);
}
if (tmp && DECL_ARTIFICIAL (tmp))
- cp_error ("definition of implicitly-declared `%D'", tmp);
+ cp_error (ec_definition_of_implicitlydeclared, tmp);
if (tmp)
{
if (!duplicate_decls (decl, tmp))
@@ -8116,7 +8106,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (tmp == NULL_TREE)
SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (decl), decl);
else if (TREE_CODE (tmp) != TREE_CODE (decl))
- cp_error ("inconsistent declarations for `%D'", decl);
+ cp_error (ec_inconsistent_declarations_for, decl);
else
{
duplicate_decls (decl, tmp);
@@ -8220,7 +8210,7 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
/* Ignore for now; `enum { foo } e' is pretty common. */;
else
- cp_pedwarn ("non-local variable `%#D' uses local type `%T'",
+ cp_pedwarn (ec_nonlocal_variable_uses_local_type,
decl, t);
}
}
@@ -8428,7 +8418,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (current_class_type == NULL_TREE)
{
- error ("destructors must be member functions");
+ cp_error (ec_destructors_must_be_member_functions);
flags = NO_SPECIAL;
}
else
@@ -8447,7 +8437,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (rename)
{
- cp_error ("destructor `%T' must match class name `%T'",
+ cp_error (ec_destructor_must_match_class_name,
name, rename);
TREE_OPERAND (decl, 0) = rename;
}
@@ -8528,7 +8518,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (is_rid (dname))
{
- cp_error ("declarator-id missing; using reserved word `%D'",
+ cp_error (ec_declaratorid_missing_using_reserved_word,
dname);
name = IDENTIFIER_POINTER (dname);
}
@@ -8572,9 +8562,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (TREE_CODE (cname) == TEMPLATE_TYPE_PARM
|| TREE_CODE (cname) == TEMPLATE_TEMPLATE_PARM)
{
- cp_error ("`%T::%D' is not a valid declarator", cname,
+ cp_error (ec_is_not_a_valid_declarator, cname,
TREE_OPERAND (decl, 1));
- cp_error (" perhaps you want `typename %T::%D' to make it a type",
+ cp_error (ec_perhaps_you_want_typename_to_make_it_a_type,
cname, TREE_OPERAND (decl, 1));
return void_type_node;
}
@@ -8586,7 +8576,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (! UNIQUELY_DERIVED_FROM_P (cname, ctype))
{
- cp_error ("type `%T' is not derived from type `%T'",
+ cp_error (ec_type_is_not_derived_from_type,
cname, ctype);
TREE_OPERAND (decl, 0) = NULL_TREE;
}
@@ -8632,9 +8622,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
case TYPE_DECL:
/* Parse error puts this typespec where
a declarator should go. */
- cp_error ("`%T' specified as declarator-id", DECL_NAME (decl));
+ cp_error (ec_specified_as_declaratorid, DECL_NAME (decl));
if (TREE_TYPE (decl) == current_class_type)
- cp_error (" perhaps you want `%T' for a constructor",
+ cp_error (ec_perhaps_you_want_for_a_constructor,
current_class_name);
dname = DECL_NAME (decl);
name = IDENTIFIER_POINTER (dname);
@@ -8649,7 +8639,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
break;
default:
- cp_compiler_error ("`%D' as declarator", decl);
+ cp_compiler_error (ec_as_declarator, decl);
return 0; /* We used to do a 155 abort here. */
}
}
@@ -8667,7 +8657,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& innermost_code != CALL_EXPR
&& ! (ctype && declspecs == NULL_TREE))
{
- cp_error ("declaration of `%D' as non-function", dname);
+ cp_error (ec_declaration_of_as_nonfunction, dname);
return void_type_node;
}
@@ -8734,9 +8724,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (type)
{
if (id == ridpointers[(int) RID_BOOL])
- error ("`bool' is now a keyword");
+ cp_error (ec_bool_is_now_a_keyword);
else
- cp_error ("extraneous `%T' ignored", id);
+ cp_error (ec_extraneous_ignored, id);
}
else
{
@@ -8752,7 +8742,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (IDENTIFIER_HAS_TYPE_VALUE (id))
{
if (type)
- cp_error ("multiple declarations `%T' and `%T'", type, id);
+ cp_error (ec_multiple_declarations_and, type, id);
else
type = IDENTIFIER_TYPE_VALUE (id);
goto found;
@@ -8765,14 +8755,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (i == (int) RID_LONG && RIDBIT_SETP (i, specbits))
{
if (pedantic && ! in_system_header && warn_long_long)
- pedwarn ("ANSI C++ does not support `long long'");
+ cp_pedwarn (ec_does_not_support_long_long);
if (longlong)
- error ("`long long long' is too long for GCC");
+ cp_error (ec_long_long_long_is_too_long_for);
else
longlong = 1;
}
else if (RIDBIT_SETP (i, specbits))
- pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id));
+ cp_pedwarn (ec_duplicate_s, IDENTIFIER_POINTER (id));
RIDBIT_SET (i, specbits);
goto found;
}
@@ -8782,7 +8772,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (TREE_CODE (id) == TYPE_DECL || TREE_CODE (id) == TEMPLATE_DECL)
{
if (type)
- cp_error ("multiple declarations `%T' and `%T'", type,
+ cp_error (ec_multiple_declarations_and, type,
TREE_TYPE (id));
else
{
@@ -8792,12 +8782,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
goto found;
}
if (type)
- error ("two or more data types in declaration of `%s'", name);
+ cp_error (ec_two_or_more_data_types_in_declaration_of_s, name);
else if (TREE_CODE (id) == IDENTIFIER_NODE)
{
register tree t = lookup_name (id, 1);
if (!t || TREE_CODE (t) != TYPE_DECL)
- error ("`%s' fails to be a typedef or built in type",
+ cp_error (ec_s_fails_to_be_a_typedef_or_built_in_type,
IDENTIFIER_POINTER (id));
else
{
@@ -8863,14 +8853,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
warn_about_return_type = 1;
}
else if (RIDBIT_SETP (RID_TYPEDEF, specbits))
- pedwarn ("ANSI C++ forbids typedef which does not specify a type");
+ cp_pedwarn (ec_forbids_typedef_which_does_not_specify_a_type);
else if (innermost_code != CALL_EXPR || pedantic
|| (warn_return_type && return_type == return_normal))
{
if (innermost_code == CALL_EXPR)
- cp_pedwarn ("return-type of `%D' defaults to `int'", dname);
+ cp_pedwarn (ec_returntype_of_defaults_to_int, dname);
else
- cp_pedwarn ("ANSI C++ forbids declaration `%D' with no type",
+ cp_pedwarn (ec_forbids_declaration_with_no_type,
dname);
}
type = integer_type_node;
@@ -8878,21 +8868,21 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
}
else if (return_type == return_dtor)
{
- error ("return type specification for destructor invalid");
+ cp_error (ec_return_type_specification_for_destructor_invalid);
type = void_type_node;
}
else if (return_type == return_ctor)
{
- error ("return type specification for constructor invalid");
+ cp_error (ec_return_type_specification_for_constructor_invalid);
type = build_pointer_type (ctor_return_type);
}
else if (return_type == return_conversion)
{
if (comptypes (type, ctor_return_type, 1) == 0)
- cp_error ("operator `%T' declared to return `%T'",
+ cp_error (ec_operator_declared_to_return,
ctor_return_type, type);
else
- cp_pedwarn ("return type specified for `operator %T'",
+ cp_pedwarn (ec_return_type_specified_for_operator,
ctor_return_type);
type = ctor_return_type;
@@ -8923,29 +8913,29 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
int ok = 0;
if (TREE_CODE (type) == REAL_TYPE)
- error ("short, signed or unsigned invalid for `%s'", name);
+ cp_error (ec_short_signed_or_unsigned_invalid_for_s, name);
else if (TREE_CODE (type) != INTEGER_TYPE)
- error ("long, short, signed or unsigned invalid for `%s'", name);
+ cp_error (ec_long_short_signed_or_unsigned_invalid_for_s, name);
else if (RIDBIT_SETP (RID_LONG, specbits)
&& RIDBIT_SETP (RID_SHORT, specbits))
- error ("long and short specified together for `%s'", name);
+ cp_error (ec_long_and_short_specified_together_for_s, name);
else if ((RIDBIT_SETP (RID_LONG, specbits)
|| RIDBIT_SETP (RID_SHORT, specbits))
&& explicit_char)
- error ("long or short specified with char for `%s'", name);
+ cp_error (ec_long_or_short_specified_with_char_for_s, name);
else if ((RIDBIT_SETP (RID_LONG, specbits)
|| RIDBIT_SETP (RID_SHORT, specbits))
&& TREE_CODE (type) == REAL_TYPE)
- error ("long or short specified with floating type for `%s'", name);
+ cp_error (ec_long_or_short_specified_with_floating_type_for_s, name);
else if (RIDBIT_SETP (RID_SIGNED, specbits)
&& RIDBIT_SETP (RID_UNSIGNED, specbits))
- error ("signed and unsigned given together for `%s'", name);
+ cp_error (ec_signed_and_unsigned_given_together_for_s, name);
else
{
ok = 1;
if (!explicit_int && !defaulted_int && !explicit_char && pedantic)
{
- pedwarn ("long, short, signed or unsigned used invalidly for `%s'",
+ cp_pedwarn (ec_long_short_signed_or_unsigned_used_invalidly_for_s,
name);
if (flag_pedantic_errors)
ok = 0;
@@ -8966,7 +8956,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (RIDBIT_SETP (RID_COMPLEX, specbits)
&& TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE)
{
- error ("complex invalid for `%s'", name);
+ cp_error (ec_complex_invalid_for_s, name);
RIDBIT_RESET (RID_COMPLEX, specbits);
}
@@ -9033,7 +9023,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (return_type == return_conversion
&& (RIDBIT_SETP (RID_CONST, specbits)
|| RIDBIT_SETP (RID_VOLATILE, specbits)))
- cp_error ("`operator %T' cannot be cv-qualified",
+ cp_error (ec_operator_cannot_be_cvqualified,
ctor_return_type);
/* Set CONSTP if this declaration is `const', whether by
@@ -9055,7 +9045,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (virtualp && staticp == 2)
{
- cp_error ("member `%D' cannot be declared both virtual and static",
+ cp_error (ec_member_cannot_be_declared_both_virtual_and_static,
dname);
staticp = 0;
}
@@ -9066,12 +9056,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (decl_context == PARM)
{
- error ("non-member `%s' cannot be declared `mutable'", name);
+ cp_error (ec_nonmember_s_cannot_be_declared_mutable, name);
RIDBIT_RESET (RID_MUTABLE, specbits);
}
else if (friendp || decl_context == TYPENAME)
{
- error ("non-object member `%s' cannot be declared `mutable'", name);
+ cp_error (ec_nonobject_member_s_cannot_be_declared_mutable, name);
RIDBIT_RESET (RID_MUTABLE, specbits);
}
}
@@ -9083,11 +9073,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (RIDBIT_SETP (RID_STATIC, specbits)) nclasses++;
if (RIDBIT_SETP (RID_EXTERN, specbits)) nclasses++;
if (decl_context == PARM && nclasses > 0)
- error ("storage class specifiers invalid in parameter declarations");
+ cp_error (ec_storage_class_specifiers_invalid_in_parameter_declarations);
if (RIDBIT_SETP (RID_TYPEDEF, specbits))
{
if (decl_context == PARM)
- error ("typedef declaration invalid in parameter declaration");
+ cp_error (ec_typedef_declaration_invalid_in_parameter_declaration);
nclasses++;
}
if (RIDBIT_SETP (RID_AUTO, specbits)) nclasses++;
@@ -9098,12 +9088,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (virtualp
&& (current_class_name == NULL_TREE || decl_context != FIELD))
{
- error ("virtual outside class declaration");
+ cp_error (ec_virtual_outside_class_declaration);
virtualp = 0;
}
if (current_class_name == NULL_TREE && RIDBIT_SETP (RID_MUTABLE, specbits))
{
- error ("only members can be declared mutable");
+ cp_error (ec_only_members_can_be_declared_mutable);
RIDBIT_RESET (RID_MUTABLE, specbits);
}
@@ -9121,29 +9111,29 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (constp)
{
- error ("`const' specified for signature member function `%s'", name);
+ cp_error (ec_const_specified_for_signature_member_function_s, name);
constp = 0;
}
if (volatilep)
{
- error ("`volatile' specified for signature member function `%s'",
+ cp_error (ec_volatile_specified_for_signature_member_function_s,
name);
volatilep = 0;
}
if (inlinep)
{
- error ("`inline' specified for signature member function `%s'", name);
+ cp_error (ec_inline_specified_for_signature_member_function_s, name);
/* Later, we'll make signature member functions inline. */
inlinep = 0;
}
if (friendp)
{
- error ("`friend' declaration in signature definition");
+ cp_error (ec_friend_declaration_in_signature_definition);
friendp = 0;
}
if (virtualp)
{
- error ("`virtual' specified for signature member function `%s'",
+ cp_error (ec_virtual_specified_for_signature_member_function_s,
name);
/* Later, we'll make signature member functions virtual. */
virtualp = 0;
@@ -9154,7 +9144,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
kinds of declarations (parameters, typenames, etc.). */
if (nclasses > 1)
- error ("multiple storage classes in declaration of `%s'", name);
+ cp_error (ec_multiple_storage_classes_in_declaration_of_s, name);
else if (decl_context != NORMAL && nclasses > 0)
{
if ((decl_context == PARM || decl_context == CATCHPARM)
@@ -9186,7 +9176,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
tmp = TREE_OPERAND (declarator, 0);
op = IDENTIFIER_OPNAME_P (tmp);
}
- error ("storage class specified for %s `%s'",
+ cp_error (ec_storage_class_specified_for_s_s,
IS_SIGNATURE (current_class_type)
? (op
? "signature member operator"
@@ -9216,22 +9206,22 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* It's common practice (and completely valid) to have a const
be initialized and declared extern. */
if (! constp)
- warning ("`%s' initialized and declared `extern'", name);
+ cp_warning (ec_s_initialized_and_declared_extern, name);
}
else
- error ("`%s' has both `extern' and initializer", name);
+ cp_error (ec_s_has_both_extern_and_initializer, name);
}
else if (RIDBIT_SETP (RID_EXTERN, specbits) && funcdef_flag
&& ! toplevel_bindings_p ())
- error ("nested function `%s' declared `extern'", name);
+ cp_error (ec_nested_function_s_declared_extern, name);
else if (toplevel_bindings_p ())
{
if (RIDBIT_SETP (RID_AUTO, specbits))
- error ("top-level declaration of `%s' specifies `auto'", name);
+ cp_error (ec_toplevel_declaration_of_s_specifies_auto, name);
}
if (nclasses > 0 && friendp)
- error ("storage class specifiers invalid in friend function declarations");
+ cp_error (ec_storage_class_specifiers_invalid_in_friend_function_declarations);
/* Now figure out the structure of the declarator proper.
Descend through it, creating more complex types, until we reach
@@ -9298,13 +9288,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (type) == VOID_TYPE)
{
- cp_error ("declaration of `%D' as array of voids", dname);
+ cp_error (ec_declaration_of_as_array_of_voids, dname);
type = error_mark_node;
}
if (TREE_CODE (type) == FUNCTION_TYPE)
{
- cp_error ("declaration of `%D' as array of functions", dname);
+ cp_error (ec_declaration_of_as_array_of_functions, dname);
type = error_mark_node;
}
@@ -9315,23 +9305,23 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (type) == REFERENCE_TYPE)
{
if (decl_context == TYPENAME)
- cp_error ("cannot make arrays of references");
+ cp_error (ec_cannot_make_arrays_of_references);
else
- cp_error ("declaration of `%D' as array of references",
+ cp_error (ec_declaration_of_as_array_of_references,
dname);
type = error_mark_node;
}
if (TREE_CODE (type) == OFFSET_TYPE)
{
- cp_error ("declaration of `%D' as array of data members",
+ cp_error (ec_declaration_of_as_array_of_data_members,
dname);
type = error_mark_node;
}
if (TREE_CODE (type) == METHOD_TYPE)
{
- cp_error ("declaration of `%D' as array of function members",
+ cp_error (ec_declaration_of_as_array_of_function_members,
dname);
type = error_mark_node;
}
@@ -9370,14 +9360,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (TREE_TYPE (size)) != INTEGER_TYPE
&& TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE)
{
- cp_error ("size of array `%D' has non-integer type",
+ cp_error (ec_size_of_array_has_noninteger_type,
dname);
size = integer_one_node;
}
if (TREE_READONLY_DECL_P (size))
size = decl_constant_value (size);
if (pedantic && integer_zerop (size))
- cp_pedwarn ("ANSI C++ forbids zero-size array `%D'", dname);
+ cp_pedwarn (ec_forbids_zerosize_array, dname);
if (TREE_CONSTANT (size))
{
int old_flag_pedantic_errors = flag_pedantic_errors;
@@ -9389,7 +9379,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
flag_pedantic_errors = old_flag_pedantic_errors;
if (INT_CST_LT (size, integer_zero_node))
{
- cp_error ("size of array `%D' is negative", dname);
+ cp_error (ec_size_of_array_is_negative, dname);
size = integer_one_node;
}
}
@@ -9398,10 +9388,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (pedantic)
{
if (dname)
- cp_pedwarn ("ANSI C++ forbids variable-size array `%D'",
+ cp_pedwarn (ec_forbids_variablesize_array_name,
dname);
else
- cp_pedwarn ("ANSI C++ forbids variable-size array");
+ cp_pedwarn (ec_forbids_variablesize_array);
}
}
@@ -9414,7 +9404,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
itype = variable_size (itype);
else if (TREE_OVERFLOW (itype))
{
- error ("overflow in array dimension");
+ cp_error (ec_overflow_in_array_dimension);
TREE_OVERFLOW (itype) = 0;
}
@@ -9461,7 +9451,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
#if 0
/* Is this an error? Should they be merged into TYPE here? */
if (pedantic && (constp || volatilep))
- pedwarn ("function declared to return const or volatile result");
+ cp_pedwarn (ec_function_declared_to_return_const_or_volatile_result);
#else
/* Merge any constancy or volatility into the function return
type. */
@@ -9480,12 +9470,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (type) == FUNCTION_TYPE)
{
- error ("`%s' declared as function returning a function", name);
+ cp_error (ec_s_declared_as_function_returning_a_function, name);
type = integer_type_node;
}
if (TREE_CODE (type) == ARRAY_TYPE)
{
- error ("`%s' declared as function returning an array", name);
+ cp_error (ec_s_declared_as_function_returning_an_array, name);
type = integer_type_node;
}
@@ -9530,10 +9520,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
not be declared const or volatile. A destructor
may not be static. */
if (staticp == 2)
- error ("destructor cannot be static member function");
+ cp_error (ec_destructor_cannot_be_static_member_function);
if (quals)
{
- error ("destructors cannot be declared `const' or `volatile'");
+ cp_error (ec_destructors_cannot_be_declared_const_or_volatile);
return void_type_node;
}
if (decl_context == FIELD)
@@ -9551,15 +9541,15 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
not be declared const or volatile. A constructor may
not be virtual. A constructor may not be static. */
if (staticp == 2)
- error ("constructor cannot be static member function");
+ cp_error (ec_constructor_cannot_be_static_member_function);
if (virtualp)
{
- pedwarn ("constructors cannot be declared virtual");
+ cp_pedwarn (ec_constructors_cannot_be_declared_virtual);
virtualp = 0;
}
if (quals)
{
- error ("constructors cannot be declared `const' or `volatile'");
+ cp_error (ec_constructors_cannot_be_declared_const_or_volatile);
return void_type_node;
}
{
@@ -9568,13 +9558,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
RIDBIT_RESET (RID_INLINE, tmp_bits);
RIDBIT_RESET (RID_STATIC, tmp_bits);
if (RIDBIT_ANY_SET (tmp_bits))
- error ("return value type specifier for constructor ignored");
+ cp_error (ec_return_value_type_specifier_for_constructor_ignored);
}
type = build_pointer_type (ctype);
if (decl_context == FIELD
&& IS_SIGNATURE (current_class_type))
{
- error ("constructor not allowed in signature");
+ cp_error (ec_constructor_not_allowed_in_signature);
return void_type_node;
}
else if (decl_context == FIELD)
@@ -9593,18 +9583,18 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (friendp)
{
if (initialized)
- error ("can't initialize friend function `%s'", name);
+ cp_error (ec_cant_initialize_friend_function_s, name);
if (virtualp)
{
/* Cannot be both friend and virtual. */
- error ("virtual functions cannot be friends");
+ cp_error (ec_virtual_functions_cannot_be_friends);
RIDBIT_RESET (RID_FRIEND, specbits);
friendp = 0;
}
if (decl_context == NORMAL)
- error ("friend declaration not in class definition");
+ cp_error (ec_friend_declaration_not_in_class_definition);
if (current_function_decl && funcdef_flag)
- cp_error ("can't define friend function `%s' in a local class definition",
+ cp_error (ec_cant_define_friend_function_s_in_a_local_class_definition,
name);
}
@@ -9633,7 +9623,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (arg_types == NULL_TREE
|| arg_types != void_list_node)
{
- error ("destructors cannot be specified with parameters");
+ cp_error (ec_destructors_cannot_be_specified_with_parameters);
arg_types = void_list_node;
}
}
@@ -9663,7 +9653,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (type) == REFERENCE_TYPE)
{
- error ("cannot declare %s to references",
+ cp_error (ec_cannot_declare_s_to_references,
TREE_CODE (declarator) == ADDR_EXPR
? "references" : "pointers");
declarator = TREE_OPERAND (declarator, 0);
@@ -9674,7 +9664,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE
|| TREE_CODE (TREE_TYPE (type)) == REFERENCE_TYPE))
{
- cp_error ("cannot declare pointer to `%#T' member",
+ cp_error (ec_cannot_declare_pointer_to_member,
TREE_TYPE (type));
type = TREE_TYPE (type);
}
@@ -9704,7 +9694,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (CLASSTYPE_METHOD_VEC (type) == NULL_TREE
&& TYPE_SIZE (type))
- cp_warning ("empty signature `%T' used in signature reference declaration",
+ cp_warning (ec_empty_signature_used_in_signature_reference_declaration,
type);
#if 0
type = build_signature_reference_type (type,
@@ -9718,7 +9708,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (CLASSTYPE_METHOD_VEC (type) == NULL_TREE
&& TYPE_SIZE (type))
- cp_warning ("empty signature `%T' used in signature pointer declaration",
+ cp_warning (ec_empty_signature_used_in_signature_pointer_declaration,
type);
type = build_signature_pointer_type (type,
constp, volatilep);
@@ -9730,13 +9720,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (TREE_CODE (type) == FUNCTION_TYPE)
{
- error ("cannot declare references to functions; use pointer to function instead");
+ cp_error (ec_cannot_declare_references_to_functions_use_pointer_to_function_instead);
type = build_pointer_type (type);
}
else
{
if (TREE_CODE (type) == VOID_TYPE)
- error ("invalid type: `void &'");
+ cp_error (ec_invalid_type_void);
else
type = build_reference_type (type);
}
@@ -9765,22 +9755,22 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (!erred)
{
erred = 1;
- error ("invalid type modifier within %s declarator",
+ cp_error (ec_invalid_type_modifier_within_s_declarator,
TREE_CODE (declarator) == ADDR_EXPR
? "reference" : "pointer");
}
}
if (constp > 1)
- pedwarn ("duplicate `const'");
+ cp_pedwarn (ec_duplicate_const);
if (volatilep > 1)
- pedwarn ("duplicate `volatile'");
+ cp_pedwarn (ec_duplicate_volatile);
if (TREE_CODE (declarator) == ADDR_EXPR
&& (constp || volatilep))
{
if (constp)
- pedwarn ("discarding `const' applied to a reference");
+ cp_pedwarn (ec_discarding_const_applied_to_a_reference);
if (volatilep)
- pedwarn ("discarding `volatile' applied to a reference");
+ cp_pedwarn (ec_discarding_volatile_applied_to_a_reference);
constp = volatilep = 0;
}
}
@@ -9880,7 +9870,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
Is this ill-formed? */
if (pedantic)
- cp_pedwarn ("extra qualification `%T::' on member `%s' ignored",
+ cp_pedwarn (ec_extra_qualification_on_member_s_ignored,
ctype, name);
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
@@ -9891,7 +9881,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
TREE_TYPE (type), TYPE_ARG_TYPES (type));
else
{
- cp_error ("cannot declare member function `%T::%s' within `%T'",
+ cp_error (ec_cannot_declare_member_function_s_within,
ctype, name, current_class_type);
return void_type_node;
}
@@ -9906,7 +9896,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (current_class_type)
{
- cp_error ("cannot declare member `%T::%s' within `%T'",
+ cp_error (ec_cannot_declare_member_s_within,
ctype, name, current_class_type);
return void_type_node;
}
@@ -9924,7 +9914,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
}
else
{
- cp_error ("structure `%T' not yet defined", ctype);
+ cp_error (ec_structure_not_yet_defined, ctype);
return error_mark_node;
}
@@ -9971,7 +9961,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (explicitp == 1)
{
- error ("only constructors can be declared `explicit'");
+ cp_error (ec_only_constructors_can_be_declared_explicit);
explicitp = 0;
}
@@ -9983,12 +9973,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (constp)
{
- error ("const `%s' cannot be declared `mutable'", name);
+ cp_error (ec_const_s_cannot_be_declared_mutable, name);
RIDBIT_RESET (RID_MUTABLE, specbits);
}
else if (staticp)
{
- error ("static `%s' cannot be declared `mutable'", name);
+ cp_error (ec_static_s_cannot_be_declared_mutable, name);
RIDBIT_RESET (RID_MUTABLE, specbits);
}
}
@@ -10007,7 +9997,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (decl_context == FIELD)
{
if (declarator == current_class_name)
- cp_pedwarn ("ANSI C++ forbids nested type `%D' with same name as enclosing class",
+ cp_pedwarn (ec_forbids_nested_type_with_same_name_as_enclosing_class,
declarator);
decl = build_lang_decl (TYPE_DECL, declarator, type);
if (IS_SIGNATURE (current_class_type) && opaque_typedef)
@@ -10066,7 +10056,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (type) == OFFSET_TYPE || TREE_CODE (type) == METHOD_TYPE)
{
- cp_error_at ("typedef name may not be class-qualified", decl);
+ cp_error_at (ec_typedef_name_may_not_be_classqualified, decl);
return NULL_TREE;
}
else if (quals)
@@ -10074,7 +10064,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (ctype == NULL_TREE)
{
if (TREE_CODE (type) != METHOD_TYPE)
- cp_error_at ("invalid type qualifier for non-method type", decl);
+ cp_error_at (ec_invalid_type_qualifier_for_nonmethod_type, decl);
else
ctype = TYPE_METHOD_BASETYPE (type);
}
@@ -10088,14 +10078,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (RIDBIT_SETP (RID_MUTABLE, specbits))
{
- error ("non-object member `%s' cannot be declared mutable", name);
+ cp_error (ec_nonobject_member_s_cannot_be_declared_mutable, name);
}
bad_specifiers (decl, "type", virtualp, quals != NULL_TREE,
inlinep, friendp, raises != NULL_TREE);
if (initialized)
- error ("typedef declaration includes an initializer");
+ cp_error (ec_typedef_declaration_includes_an_initializer);
return decl;
}
@@ -10122,7 +10112,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (constp || volatilep)
{
if (IS_SIGNATURE (type))
- error ("`const' or `volatile' specified with signature type");
+ cp_error (ec_const_or_volatile_specified_with_signature_type);
else
type = cp_build_type_variant (type, constp, volatilep);
}
@@ -10132,12 +10122,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (volatilep)
{
- cp_error ("`volatile' specified for friend class declaration");
+ cp_error (ec_volatile_specified_for_friend_class_declaration);
volatilep = 0;
}
if (inlinep)
{
- cp_error ("`inline' specified for friend class declaration");
+ cp_error (ec_inline_specified_for_friend_class_declaration);
inlinep = 0;
}
@@ -10148,7 +10138,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (current_class_type)
make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type));
else
- error ("trying to make class `%s' a friend of global scope",
+ cp_error (ec_trying_to_make_class_s_a_friend_of_global_scope,
TYPE_NAME_STRING (type));
type = void_type_node;
}
@@ -10172,7 +10162,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& TREE_CODE (type) != UNION_TYPE
&& ! bitfield)
{
- cp_error ("abstract declarator `%T' used as declaration", type);
+ cp_error (ec_abstract_declarator_type_used_as_declaration, type);
declarator = make_anon_name ();
}
@@ -10184,16 +10174,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (type) == VOID_TYPE && decl_context != PARM)
{
if (! declarator)
- error ("unnamed variable or field declared void");
+ cp_error (ec_unnamed_variable_or_field_declared_void);
else if (TREE_CODE (declarator) == IDENTIFIER_NODE)
{
if (IDENTIFIER_OPNAME_P (declarator))
my_friendly_abort (356);
else
- error ("variable or field `%s' declared void", name);
+ cp_error (ec_variable_or_field_s_declared_void, name);
}
else
- error ("variable or field declared void");
+ cp_error (ec_variable_or_field_declared_void);
type = integer_type_node;
}
@@ -10206,7 +10196,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (decl_context == PARM)
{
if (ctype || in_namespace)
- error ("cannot use `::' in parameter declaration");
+ cp_error (ec_cannot_use_in_parameter_declaration);
/* A parameter declared as an array of T is really a pointer to T.
One declared as a function is really a pointer to a function.
@@ -10225,7 +10215,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
type = build_pointer_type (type);
else if (TREE_CODE (type) == VOID_TYPE && declarator)
{
- error ("declaration of `%s' as void", name);
+ cp_error (ec_declaration_of_s_as_void, name);
return NULL_TREE;
}
@@ -10237,11 +10227,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& IS_SIGNATURE (current_class_type))
{
if (inlinep)
- error ("parameter of signature member function declared `inline'");
+ cp_error (ec_parameter_of_signature_member_function_declared_inline);
if (RIDBIT_SETP (RID_AUTO, specbits))
- error ("parameter of signature member function declared `auto'");
+ cp_error (ec_parameter_of_signature_member_function_declared_auto);
if (RIDBIT_SETP (RID_REGISTER, specbits))
- error ("parameter of signature member function declared `register'");
+ cp_error (ec_parameter_of_signature_member_function_declared_register);
}
/* Compute the type actually passed in the parmlist,
@@ -10262,7 +10252,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (in_namespace)
{
/* Something like struct S { int N::j; }; */
- cp_error ("invalid use of `::'");
+ cp_error (ec_invalid_use_of_scope);
decl = NULL_TREE;
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
@@ -10274,7 +10264,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
typedefs. */
if (friendp && declarator == ridpointers[(int) RID_SIGNED])
{
- cp_error ("function `%D' cannot be declared friend",
+ cp_error (ec_function_cannot_be_declared_friend,
declarator);
friendp = 0;
}
@@ -10286,7 +10276,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (ctype == NULL_TREE)
{
- cp_error ("can't make `%D' into a method -- not in a class",
+ cp_error (ec_cant_make_into_a_method_not_in_a_class,
declarator);
return void_type_node;
}
@@ -10295,7 +10285,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
ARM 9.5 */
if (virtualp && TREE_CODE (ctype) == UNION_TYPE)
{
- cp_error ("function `%D' declared virtual inside a union",
+ cp_error (ec_function_declared_virtual_inside_a_union,
declarator);
return void_type_node;
}
@@ -10307,7 +10297,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (virtualp)
{
- cp_error ("`%D' cannot be declared virtual, since it is always static",
+ cp_error (ec_cannot_be_declared_virtual_since_it_is_always_static,
declarator);
virtualp = 0;
}
@@ -10358,9 +10348,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& (TREE_CODE (type) != ARRAY_TYPE || initialized == 0))
{
if (declarator)
- cp_error ("field `%D' has incomplete type", declarator);
+ cp_error (ec_field_has_incomplete_type, declarator);
else
- cp_error ("name `%T' has incomplete type", type);
+ cp_error (ec_name_has_incomplete_type, type);
/* If we're instantiating a template, tell them which
instantiation made the field's type be incomplete. */
@@ -10369,7 +10359,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& IDENTIFIER_TEMPLATE (TYPE_IDENTIFIER (current_class_type))
&& declspecs && TREE_VALUE (declspecs)
&& TREE_TYPE (TREE_VALUE (declspecs)) == type)
- cp_error (" in instantiation of template `%T'",
+ cp_error (ec_in_instantiation_of_template,
current_class_type);
type = error_mark_node;
@@ -10379,7 +10369,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (friendp)
{
- error ("`%s' is neither function nor method; cannot be declared friend",
+ cp_error (ec_s_is_neither_function_nor_method_cannot_be_declared_friend,
IDENTIFIER_POINTER (declarator));
friendp = 0;
}
@@ -10390,7 +10380,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
/* Friends are treated specially. */
if (ctype == current_class_type)
- warning ("member functions are implicitly friends of their class");
+ cp_warning (ec_member_functions_are_implicitly_friends_of_their_class);
else
{
tree t = NULL_TREE;
@@ -10437,10 +10427,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
the rest of the compiler does not correctly
handle the initialization unless the member is
static so we make it static below. */
- cp_pedwarn ("ANSI C++ forbids initialization of %s `%D'",
+ cp_pedwarn (ec_forbids_initialization_of_s,
constp ? "const member" : "member",
declarator);
- cp_pedwarn ("making `%D' static", declarator);
+ cp_pedwarn (ec_making_static, declarator);
staticp = 1;
}
@@ -10454,7 +10444,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (CLASS_TYPE_P (type)
|| TREE_CODE (type) == REFERENCE_TYPE)
{
- cp_error ("in-class initialization of static data member of non-integral type `%T'",
+ cp_error (ec_inclass_initialization_of_static_data_member_of_nonintegral_type,
type);
/* If we just return the declaration, crashes will
sometimes occur. We therefore return
@@ -10464,18 +10454,18 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
return void_type_node;
}
else if (!constp)
- cp_error ("ANSI C++ forbids in-class initialization of non-const static member `%D'",
+ cp_error (ec_forbids_inclass_initialization_of_nonconst_static_member,
declarator);
else if (pedantic && ! INTEGRAL_TYPE_P (type)
&& !uses_template_parms (type))
- cp_pedwarn ("ANSI C++ forbids initialization of member constant `%D' of non-integral type `%T'", declarator, type);
+ cp_pedwarn (ec_forbids_initialization_of_member_constant_of_nonintegral_type, declarator, type);
}
if (staticp)
{
/* ANSI C++ Apr '95 wp 9.2 */
if (declarator == current_class_name)
- cp_pedwarn ("ANSI C++ forbids static member `%D' with same name as enclosing class",
+ cp_pedwarn (ec_forbids_static_member_with_same_name_as_enclosing_class,
declarator);
/* C++ allows static class members.
@@ -10515,9 +10505,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
original_name = declarator;
if (RIDBIT_SETP (RID_AUTO, specbits))
- error ("storage class `auto' invalid for function `%s'", name);
+ cp_error (ec_storage_class_auto_invalid_for_function_s, name);
else if (RIDBIT_SETP (RID_REGISTER, specbits))
- error ("storage class `register' invalid for function `%s'", name);
+ cp_error (ec_storage_class_register_invalid_for_function_s, name);
/* Function declaration not at top level.
Storage classes other than `extern' are not allowed
@@ -10528,16 +10518,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& pedantic)
{
if (RIDBIT_SETP (RID_STATIC, specbits))
- pedwarn ("storage class `static' invalid for function `%s' declared out of global scope", name);
+ cp_pedwarn (ec_storage_class_static_invalid_for_function_s_declared_out_of_global_scope, name);
else
- pedwarn ("storage class `inline' invalid for function `%s' declared out of global scope", name);
+ cp_pedwarn (ec_storage_class_inline_invalid_for_function_s_declared_out_of_global_scope, name);
}
if (ctype == NULL_TREE)
{
if (virtualp)
{
- error ("virtual non-class function `%s'", name);
+ cp_error (ec_virtual_nonclass_function_s, name);
virtualp = 0;
}
@@ -10588,13 +10578,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
declaring main to be static. */
if (TREE_CODE (type) == METHOD_TYPE)
{
- cp_pedwarn ("cannot declare member function `%D' to have static linkage", decl);
+ cp_pedwarn (ec_cannot_declare_member_function_to_have_static_linkage, decl);
illegal_static = 1;
}
else if (current_function_decl)
{
/* FIXME need arm citation */
- error ("cannot declare static function inside another function");
+ cp_error (ec_cannot_declare_static_function_inside_another_function);
illegal_static = 1;
}
@@ -10614,7 +10604,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (ctype)
{
ctype = NULL_TREE;
- error ("cannot use `::' in parameter declaration");
+ cp_error (ec_cannot_use_in_parameter_declaration);
}
/* A parameter declared as an array of T is really a pointer to T.
@@ -10646,18 +10636,18 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
DECL_CONTEXT (decl) = ctype;
if (staticp == 1)
{
- cp_pedwarn ("static member `%D' re-declared as static", decl);
+ cp_pedwarn (ec_static_member_redeclared_as_static, decl);
staticp = 0;
RIDBIT_RESET (RID_STATIC, specbits);
}
if (RIDBIT_SETP (RID_REGISTER, specbits) && TREE_STATIC (decl))
{
- cp_error ("static member `%D' declared `register'", decl);
+ cp_error (ec_static_member_declared_register, decl);
RIDBIT_RESET (RID_REGISTER, specbits);
}
if (RIDBIT_SETP (RID_EXTERN, specbits) && pedantic)
{
- cp_pedwarn ("cannot explicitly declare member `%#D' to have extern linkage",
+ cp_pedwarn (ec_cannot_explicitly_declare_member_to_have_extern_linkage,
decl);
RIDBIT_RESET (RID_EXTERN, specbits);
}
@@ -10666,7 +10656,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (RIDBIT_SETP (RID_MUTABLE, specbits))
{
- error ("`%s' cannot be declared mutable", name);
+ cp_error (ec_s_cannot_be_declared_mutable, name);
}
/* Record `register' declaration for warnings on &
@@ -10740,10 +10730,10 @@ require_complete_types_for_parms (parms)
if (TYPE_SIZE (complete_type (type)) == NULL_TREE)
{
if (DECL_NAME (parms))
- error ("parameter `%s' has incomplete type",
+ cp_error (ec_parameter_s_has_incomplete_type,
IDENTIFIER_POINTER (DECL_NAME (parms)));
else
- error ("parameter has incomplete type");
+ cp_error (ec_parameter_has_incomplete_type);
TREE_TYPE (parms) = error_mark_node;
}
#if 0
@@ -10764,10 +10754,10 @@ require_complete_types_for_parms (parms)
if (TYPE_SIZE (type) == NULL_TREE)
{
if (DECL_NAME (parm) != NULL_TREE)
- warning ("parameter `%s' points to incomplete type",
+ cp_warning (ec_parameter_s_points_to_incomplete_type,
IDENTIFIER_POINTER (DECL_NAME (parm)));
else
- warning ("parameter points to incomplete type");
+ cp_warning (ec_parameter_points_to_incomplete_type);
}
}
#endif
@@ -10822,7 +10812,7 @@ grokparms (first_parm, funcdef_flag)
&& TREE_CODE (TREE_VALUE (first_parm)) == IDENTIFIER_NODE)
{
if (! funcdef_flag)
- pedwarn ("parameter names (without types) in function declaration");
+ cp_pedwarn (ec_parameter_names_without_types_in_function_declaration);
last_function_parms = first_parm;
return NULL_TREE;
}
@@ -10855,9 +10845,9 @@ grokparms (first_parm, funcdef_flag)
{
/* Give various messages as the need arises. */
if (TREE_CODE (decl) == STRING_CST)
- cp_error ("invalid string constant `%E'", decl);
+ cp_error (ec_invalid_string_constant, decl);
else if (TREE_CODE (decl) == INTEGER_CST)
- error ("invalid integer constant in parameter list, did you forget to give parameter name?");
+ cp_error (ec_invalid_integer_constant_in_parameter_list_did_you_forget_to_give_parameter_name);
continue;
}
@@ -10877,20 +10867,20 @@ grokparms (first_parm, funcdef_flag)
if (DECL_NAME (decl))
/* Cannot use the decl here because
we don't have DECL_CONTEXT set up yet. */
- cp_error ("parameter `%D' invalidly declared method type",
+ cp_error (ec_parameter_invalidly_declared_method_type,
DECL_NAME (decl));
else
- error ("parameter invalidly declared method type");
+ cp_error (ec_parameter_invalidly_declared_method_type);
type = build_pointer_type (type);
TREE_TYPE (decl) = type;
}
else if (TREE_CODE (type) == OFFSET_TYPE)
{
if (DECL_NAME (decl))
- cp_error ("parameter `%D' invalidly declared offset type",
+ cp_error (ec_parameter_invalidly_declared_offset_type,
DECL_NAME (decl));
else
- error ("parameter invalidly declared offset type");
+ cp_error (ec_parameter_invalidly_declared_offset_type);
type = build_pointer_type (type);
TREE_TYPE (decl) = type;
}
@@ -10916,7 +10906,7 @@ grokparms (first_parm, funcdef_flag)
&& TYPE_DOMAIN (t) != NULL_TREE))
t = TREE_TYPE (t);
if (TREE_CODE (t) == ARRAY_TYPE)
- cp_error ("parameter type `%T' includes pointer to array of unknown bound",
+ cp_error (ec_parameter_type_includes_pointer_to_array_of_unknown_bound,
type);
}
}
@@ -10935,7 +10925,7 @@ grokparms (first_parm, funcdef_flag)
}
if (chain
&& (chain != void_list_node || TREE_CHAIN (chain)))
- error ("`void' in parameter list must be entire list");
+ cp_error (ec_void_in_parameter_list_must_be_entire_list);
break;
}
@@ -10969,7 +10959,7 @@ grokparms (first_parm, funcdef_flag)
/* If extern int i; within a function is not
considered a local variable, then this code is
wrong. */
- cp_error ("local variable `%D' may not be used as a default argument", init);
+ cp_error (ec_local_variable_may_not_be_used_as_a_default_argument, init);
any_error = 1;
}
else if (TREE_READONLY_DECL_P (init))
@@ -10981,7 +10971,7 @@ grokparms (first_parm, funcdef_flag)
&& init != error_mark_node
&& TREE_CODE (init) != DEFAULT_ARG
&& ! can_convert_arg (type, TREE_TYPE (init), init))
- cp_pedwarn ("invalid type `%T' for default argument to `%#D'",
+ cp_pedwarn (ec_invalid_type_for_default_argument_to_decl,
TREE_TYPE (init), decl);
}
}
@@ -11045,7 +11035,7 @@ replace_defarg (arg, init)
{
if (! processing_template_decl
&& ! can_convert_arg (TREE_VALUE (arg), TREE_TYPE (init), init))
- cp_pedwarn ("invalid type `%T' for default argument to `%T'",
+ cp_pedwarn (ec_invalid_type_for_default_argument_to,
TREE_TYPE (init), TREE_VALUE (arg));
TREE_PURPOSE (arg) = init;
}
@@ -11110,7 +11100,7 @@ grok_ctor_properties (ctype, decl)
&& TREE_CHAIN (parmtypes) != NULL_TREE
&& TREE_CHAIN (parmtypes) == void_list_node)
{
- cp_error ("invalid constructor; you probably meant `%T (const %T&)'",
+ cp_error (ec_invalid_constructor_you_probably_meant_const,
ctype, ctype);
SET_IDENTIFIER_ERROR_LOCUS (DECL_NAME (decl), ctype);
return 0;
@@ -11233,13 +11223,13 @@ grok_op_properties (decl, virtualp, friendp)
|| name == ansi_opname[(int) MODIFY_EXPR]
|| name == ansi_opname[(int) COMPONENT_REF]
|| name == ansi_opname[(int) ARRAY_REF])
- cp_error ("`%D' must be a nonstatic member function", decl);
+ cp_error (ec_must_be_a_nonstatic_member_function, decl);
else
{
tree p = argtypes;
if (DECL_STATIC_FUNCTION_P (decl))
- cp_error ("`%D' must be either a non-static member function or a non-member function", decl);
+ cp_error (ec_must_be_either_a_nonstatic_member_function_or_a_nonmember_function, decl);
if (p)
for (; TREE_CODE (TREE_VALUE (p)) != VOID_TYPE ; p = TREE_CHAIN (p))
@@ -11255,8 +11245,7 @@ grok_op_properties (decl, virtualp, friendp)
|| TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
goto foundaggr;
}
- cp_error
- ("`%D' must have an argument of class or enumerated type",
+ cp_error (ec_must_have_an_argument_of_class_or_enumerated_type,
decl);
foundaggr:
;
@@ -11270,7 +11259,7 @@ grok_op_properties (decl, virtualp, friendp)
{
tree t = TREE_TYPE (name);
if (TREE_CODE (t) == VOID_TYPE)
- pedwarn ("void is not a valid type conversion operator");
+ cp_pedwarn (ec_void_is_not_a_valid_type_conversion_operator);
else if (! friendp)
{
int ref = (TREE_CODE (t) == REFERENCE_TYPE);
@@ -11287,7 +11276,7 @@ grok_op_properties (decl, virtualp, friendp)
what = "a base class";
if (what)
- warning ("conversion to %s%s will never use a type conversion operator",
+ cp_warning (ec_conversion_to_ss_will_never_use_a_type_conversion_operator,
ref ? "a reference to " : "", what);
}
}
@@ -11298,7 +11287,7 @@ grok_op_properties (decl, virtualp, friendp)
if (list_length (argtypes) != 3 && methodp)
{
- cp_error ("`%D' must take exactly one argument", decl);
+ cp_error (ec_must_take_exactly_one_argument, decl);
return;
}
parmtype = TREE_VALUE (TREE_CHAIN (argtypes));
@@ -11315,9 +11304,9 @@ grok_op_properties (decl, virtualp, friendp)
else if (name == ansi_opname[(int) COND_EXPR])
{
/* 13.4.0.3 */
- pedwarn ("ANSI C++ prohibits overloading operator ?:");
+ cp_pedwarn (ec_prohibits_overloading_operator);
if (list_length (argtypes) != 4)
- cp_error ("`%D' must take exactly three arguments", decl);
+ cp_error (ec_must_take_exactly_three_arguments, decl);
}
else if (ambi_op_p (name))
{
@@ -11331,20 +11320,19 @@ grok_op_properties (decl, virtualp, friendp)
&& TREE_VALUE (TREE_CHAIN (argtypes)) != integer_type_node)
{
if (methodp)
- cp_error ("postfix `%D' must take `int' as its argument",
+ cp_error (ec_postfix_must_take_int_as_its_argument,
decl);
else
- cp_error
- ("postfix `%D' must take `int' as its second argument",
- decl);
+ cp_error (ec_postfix_must_take_int_as_its_second_argument,
+ decl);
}
}
else
{
if (methodp)
- cp_error ("`%D' must take either zero or one argument", decl);
+ cp_error (ec_must_take_either_zero_or_one_argument, decl);
else
- cp_error ("`%D' must take either one or two arguments", decl);
+ cp_error (ec_must_take_either_one_or_two_arguments, decl);
}
/* More Effective C++ rule 6. */
@@ -11362,13 +11350,13 @@ grok_op_properties (decl, virtualp, friendp)
if (TREE_CODE (ret) != REFERENCE_TYPE
|| !comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (ret)),
arg, 1))
- cp_warning ("prefix `%D' should return `%T'", decl,
+ cp_warning (ec_prefix_should_return, decl,
build_reference_type (arg));
}
else
{
if (!comptypes (TYPE_MAIN_VARIANT (ret), arg, 1))
- cp_warning ("postfix `%D' should return `%T'", decl, arg);
+ cp_warning (ec_postfix_should_return, decl, arg);
}
}
}
@@ -11377,9 +11365,9 @@ grok_op_properties (decl, virtualp, friendp)
if (list_length (argtypes) != 2)
{
if (methodp)
- cp_error ("`%D' must take `void'", decl);
+ cp_error (ec_must_take_void, decl);
else
- cp_error ("`%D' must take exactly one argument", decl);
+ cp_error (ec_must_take_exactly_one_argument, decl);
}
}
else /* if (binary_op_p (name)) */
@@ -11387,9 +11375,9 @@ grok_op_properties (decl, virtualp, friendp)
if (list_length (argtypes) != 3)
{
if (methodp)
- cp_error ("`%D' must take exactly one argument", decl);
+ cp_error (ec_must_take_exactly_one_argument, decl);
else
- cp_error ("`%D' must take exactly two arguments", decl);
+ cp_error (ec_must_take_exactly_two_arguments, decl);
}
/* More Effective C++ rule 7. */
@@ -11397,7 +11385,7 @@ grok_op_properties (decl, virtualp, friendp)
&& (name == ansi_opname [TRUTH_ANDIF_EXPR]
|| name == ansi_opname [TRUTH_ORIF_EXPR]
|| name == ansi_opname [COMPOUND_EXPR]))
- cp_warning ("user-defined `%D' always evaluates both arguments",
+ cp_warning (ec_userdefined_always_evaluates_both_arguments,
decl);
}
@@ -11409,7 +11397,7 @@ grok_op_properties (decl, virtualp, friendp)
|| name == ansi_opname [TRUNC_DIV_EXPR]
|| name == ansi_opname [MULT_EXPR])
&& TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == REFERENCE_TYPE)
- cp_warning ("`%D' should return by value", decl);
+ cp_warning (ec_should_return_by_value, decl);
/* 13.4.0.8 */
if (argtypes)
@@ -11421,10 +11409,10 @@ grok_op_properties (decl, virtualp, friendp)
|| name == ansi_opname[(int) POSTDECREMENT_EXPR])
{
if (pedantic)
- cp_pedwarn ("`%D' cannot have default arguments", decl);
+ cp_pedwarn (ec_cannot_have_default_arguments, decl);
}
else
- cp_error ("`%D' cannot have default arguments", decl);
+ cp_error (ec_cannot_have_default_arguments, decl);
}
}
}
@@ -11500,8 +11488,8 @@ xref_tag (code_type_node, name, globalize)
if (t && (TREE_CODE (t) == TEMPLATE_TYPE_PARM
|| TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM))
{
- cp_error ("redeclaration of template type-parameter `%T'", name);
- cp_error_at (" previously declared here `%#D'",
+ cp_error (ec_redeclaration_of_template_typeparameter, name);
+ cp_error_at (ec_previously_declared_here,
TEMPLATE_TYPE_DECL (t));
}
if (t && TYPE_CONTEXT (t) && got_type)
@@ -11587,7 +11575,7 @@ xref_tag (code_type_node, name, globalize)
if (code == ENUMERAL_TYPE)
{
- cp_error ("use of enum `%#D' without previous declaration", name);
+ cp_error (ec_use_of_enum_without_previous_declaration, name);
ref = make_node (ENUMERAL_TYPE);
@@ -11701,7 +11689,7 @@ xref_basetypes (code_type_node, name, ref, binfo)
if (tag_code == union_type)
{
- cp_error ("derived union `%T' invalid", ref);
+ cp_error (ec_derived_union_invalid, ref);
return;
}
@@ -11739,7 +11727,7 @@ xref_basetypes (code_type_node, name, ref, binfo)
&& TREE_CODE (basetype) != TEMPLATE_TYPE_PARM
&& TREE_CODE (basetype) != TEMPLATE_TEMPLATE_PARM))
{
- cp_error ("base type `%T' fails to be a struct or class type",
+ cp_error (ec_base_type_fails_to_be_a_struct_or_class_type,
TREE_VALUE (binfo));
continue;
}
@@ -11752,7 +11740,7 @@ xref_basetypes (code_type_node, name, ref, binfo)
if (TYPE_SIZE (complete_type (basetype)) == NULL_TREE
&& ! (current_template_parms && uses_template_parms (basetype)))
{
- cp_error ("base class `%T' has incomplete type", basetype);
+ cp_error (ec_base_class_has_incomplete_type, basetype);
continue;
}
#endif
@@ -11761,9 +11749,9 @@ xref_basetypes (code_type_node, name, ref, binfo)
if (CLASSTYPE_MARKED (basetype))
{
if (basetype == ref)
- cp_error ("recursive type `%T' undefined", basetype);
+ cp_error (ec_recursive_type_undefined, basetype);
else
- cp_error ("duplicate base type `%T' invalid", basetype);
+ cp_error (ec_duplicate_base_type_invalid, basetype);
continue;
}
@@ -11862,7 +11850,7 @@ start_enum (name)
enumtype = lookup_tag (ENUMERAL_TYPE, name, b, 1);
if (enumtype != NULL_TREE && TREE_CODE (enumtype) == ENUMERAL_TYPE)
- cp_error ("multiple definition of `%#T'", enumtype);
+ cp_error (ec_multiple_definition_of, enumtype);
else
{
enumtype = make_node (ENUMERAL_TYPE);
@@ -12047,7 +12035,7 @@ build_enumerator (name, value, type)
}
else
{
- cp_error ("enumerator value for `%D' not integer constant", name);
+ cp_error (ec_enumerator_value_for_not_integer_constant, name);
value = NULL_TREE;
}
}
@@ -12057,7 +12045,7 @@ build_enumerator (name, value, type)
{
value = enum_next_value;
if (enum_overflow)
- cp_error ("overflow in enumeration values at `%D'", name);
+ cp_error (ec_overflow_in_enumeration_values_at, name);
}
/* Remove no-op casts from the value. */
@@ -12236,11 +12224,11 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
{
tree binding = binding_for_name (DECL_NAME (decl1),
current_namespace);
- cp_error ("redeclaration of `%#D'", decl1);
+ cp_error (ec_redeclaration_of, decl1);
if (IDENTIFIER_CLASS_VALUE (DECL_NAME (decl1)))
- cp_error_at ("previous declaration here", IDENTIFIER_CLASS_VALUE (DECL_NAME (decl1)));
+ cp_error_at (ec_previous_declaration_here, IDENTIFIER_CLASS_VALUE (DECL_NAME (decl1)));
else if (BINDING_VALUE (binding))
- cp_error_at ("previous declaration here", BINDING_VALUE (binding));
+ cp_error_at (ec_previous_declaration_here, BINDING_VALUE (binding));
}
#endif
@@ -12291,7 +12279,7 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
if (IS_AGGR_TYPE (restype) && ! TYPE_PTRMEMFUNC_P (restype)
&& ! CLASSTYPE_GOT_SEMICOLON (restype))
{
- cp_error ("semicolon missing after declaration of `%#T'", restype);
+ cp_error (ec_semicolon_missing_after_declaration_of, restype);
shadow_tag (build_expr_list (NULL_TREE, restype));
CLASSTYPE_GOT_SEMICOLON (restype) = 1;
if (TREE_CODE (fntype) == FUNCTION_TYPE)
@@ -12312,7 +12300,7 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
if (TREE_TYPE (TREE_TYPE (decl1)) != integer_type_node)
{
if (pedantic || warn_return_type)
- pedwarn ("return type for `main' changed to `int'");
+ cp_pedwarn (ec_return_type_for_main_changed_to_int);
TREE_TYPE (decl1) = fntype = default_function_type;
}
warn_about_return_type = 0;
@@ -12323,7 +12311,7 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
(but not if we warned then). */
if (! warn_implicit
&& IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1)) != NULL_TREE)
- cp_warning_at ("`%D' implicitly declared before its definition", IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1)));
+ cp_warning_at (ec_implicitly_declared_before_its_definition, IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1)));
current_function_decl = decl1;
/* Save the parm names or decls from this function's declarator
@@ -12337,7 +12325,7 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
{
if (TYPE_SIZE (complete_type (TREE_TYPE (fntype))) == NULL_TREE)
{
- cp_error ("return-type `%#T' is an incomplete type",
+ cp_error (ec_returntype_is_an_incomplete_type,
TREE_TYPE (fntype));
/* Make it return void instead, but don't change the
@@ -12365,13 +12353,13 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
}
if (warn_about_return_type)
- pedwarn ("return-type defaults to `int'");
+ cp_pedwarn (ec_returntype_defaults_to_int);
/* Effective C++ rule 15. See also c_expand_return. */
if (warn_ecpp
&& DECL_NAME (decl1) == ansi_opname[(int) MODIFY_EXPR]
&& TREE_CODE (TREE_TYPE (fntype)) == VOID_TYPE)
- cp_warning ("`operator=' should return a reference to `*this'");
+ cp_warning (ec_operator_should_return_a_reference_to_this);
/* Make the init_value nonzero so pushdecl knows this is not tentative.
error_mark_node is replaced below (in poplevel) with the BLOCK. */
@@ -12643,7 +12631,7 @@ store_parm_decls ()
pushdecl (parm);
}
else if (TREE_CODE (TREE_TYPE (parm)) == VOID_TYPE)
- cp_error ("parameter `%D' declared void", parm);
+ cp_error (ec_parameter_declared_void, parm);
else
{
/* Now fill in DECL_REFERENCE_SLOT for any of the parm decls.
@@ -12722,7 +12710,7 @@ store_parm_decls ()
for (cleanups = nreverse (cleanups); cleanups; cleanups = TREE_CHAIN (cleanups))
{
if (! expand_decl_cleanup (TREE_PURPOSE (cleanups), TREE_VALUE (cleanups)))
- cp_error ("parser lost in parsing declaration of `%D'",
+ cp_error (ec_parser_lost_in_parsing_declaration_of,
TREE_PURPOSE (cleanups));
}
}
@@ -12760,7 +12748,7 @@ store_return_init (return_id, init)
/* Give this error as many times as there are occurrences,
so that users can use Emacs compilation buffers to find
and fix all such places. */
- pedwarn ("ANSI C++ does not permit named return values");
+ cp_pedwarn (ec_does_not_permit_named_return_values);
if (return_id != NULL_TREE)
{
@@ -12770,13 +12758,13 @@ store_return_init (return_id, init)
DECL_ASSEMBLER_NAME (decl) = return_id;
}
else
- cp_error ("return identifier `%D' already in place", decl);
+ cp_error (ec_return_identifier_already_in_place, decl);
}
/* Can't let this happen for constructors. */
if (DECL_CONSTRUCTOR_P (current_function_decl))
{
- error ("can't redefine default return value for constructors");
+ cp_error (ec_cant_redefine_default_return_value_for_constructors);
return;
}
@@ -13326,20 +13314,20 @@ finish_function (lineno, call_poplevel, nested)
current_function_returns_null = 0;
if (TREE_THIS_VOLATILE (fndecl) && current_function_returns_null)
- cp_warning ("`noreturn' function `%D' does return", fndecl);
+ cp_warning (ec_noreturn_function_does_return, fndecl);
else if ((warn_return_type || pedantic)
&& current_function_returns_null
&& TREE_CODE (TREE_TYPE (fntype)) != VOID_TYPE)
{
/* If this function returns non-void and control can drop through,
complain. */
- cp_warning ("control reaches end of non-void function `%D'", fndecl);
+ cp_warning (ec_control_reaches_end_of_nonvoid_function, fndecl);
}
/* With just -W, complain only if function returns both with
and without a value. */
else if (extra_warnings
&& current_function_returns_value && current_function_returns_null)
- warning ("this function may return with or without a value");
+ cp_warning (ec_this_function_may_return_with_or_without_a_value);
}
--function_depth;
@@ -13437,8 +13425,8 @@ start_method (declspecs, declarator)
{
if (DECL_CONTEXT (fndecl)
&& TREE_CODE( DECL_CONTEXT (fndecl)) != NAMESPACE_DECL)
- cp_error ("`%D' is already defined in class %s", fndecl,
- TYPE_NAME_STRING (DECL_CONTEXT (fndecl)));
+ cp_error (ec_is_already_defined_in_class, fndecl,
+ TYPE_NAME_STRING (DECL_CONTEXT (fndecl)));
}
return void_type_node;
}
@@ -13600,7 +13588,7 @@ hack_incomplete_structures (type)
cleanup = maybe_build_cleanup (decl);
expand_decl_init (decl);
if (! expand_decl_cleanup (decl, cleanup))
- cp_error ("parser lost in parsing declaration of `%D'",
+ cp_error (ec_parser_lost_in_parsing_declaration_of,
decl);
}
*list = TREE_CHAIN (*list);
@@ -13701,16 +13689,16 @@ cplus_expand_expr_stmt (exp)
if (TREE_TYPE (exp) == unknown_type_node)
{
if (TREE_CODE (exp) == ADDR_EXPR || TREE_CODE (exp) == TREE_LIST)
- error ("address of overloaded function with no contextual type information");
+ cp_error (ec_address_of_overloaded_function_with_no_contextual_type_information);
else if (TREE_CODE (exp) == COMPONENT_REF)
- warning ("useless reference to a member function name, did you forget the ()?");
+ cp_warning (ec_useless_reference_to_a_member_function_name_did_you_forget_the);
}
else
{
if (TREE_CODE (exp) == FUNCTION_DECL)
{
- cp_warning ("reference, not call, to function `%D'", exp);
- warning ("at this point in file");
+ cp_warning (ec_reference_not_call_to_function, exp);
+ cp_warning (ec_at_this_point_in_file);
}
#if 0
@@ -13779,9 +13767,9 @@ revert_static_member_fn (decl, fn, argtypes)
tree args = argtypes ? *argtypes : TYPE_ARG_TYPES (function);
if (TYPE_READONLY (TREE_TYPE (TREE_VALUE (args))))
- cp_error ("static member function `%#D' declared const", *decl);
+ cp_error (ec_static_member_function_declared_const, *decl);
if (TYPE_VOLATILE (TREE_TYPE (TREE_VALUE (args))))
- cp_error ("static member function `%#D' declared volatile", *decl);
+ cp_error (ec_static_member_function_declared_volatile, *decl);
args = TREE_CHAIN (args);
tmp = build_function_type (TREE_TYPE (function), args);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index be8689c..ec3af45 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -181,6 +181,9 @@ int flag_init_priority = 1;
int flag_init_priority;
#endif
+/* Nonzero means show diagnostic codes when printing error messages. */
+int flag_diag_codes;
+
/* Nonzero means warn about implicit declarations. */
int warn_implicit = 1;
@@ -487,7 +490,8 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
{"check-new", &flag_check_new, 1},
{"repo", &flag_use_repository, 1},
{"for-scope", &flag_new_for_scope, 2},
- {"weak", &flag_weak, 1}
+ {"weak", &flag_weak, 1},
+ {"diag-codes", &flag_diag_codes, 1}
};
/* Decode the string P as a language-specific option.
@@ -530,7 +534,7 @@ lang_decode_option (argc, argv)
if (!strcmp (p, "handle-exceptions")
|| !strcmp (p, "no-handle-exceptions"))
- warning ("-fhandle-exceptions has been renamed to -fexceptions (and is now on by default)");
+ cp_warning (ec_fhandleexceptions_has_been_renamed_to_fexceptions_and_is_now_on_by_default);
if (!strcmp (p, "memoize-lookups")
|| !strcmp (p, "no-memoize-lookups")
@@ -549,7 +553,7 @@ lang_decode_option (argc, argv)
|| !strcmp (p, "no-nonnull-objects")
|| !strcmp (p, "no-ansi-overloading"))
{
- warning ("-f%s is no longer supported", p);
+ cp_warning (ec_fs_is_no_longer_supported, p);
found = 1;
}
else if (! strcmp (p, "alt-external-templates"))
@@ -602,7 +606,7 @@ lang_decode_option (argc, argv)
endp++;
else
{
- error ("Invalid option `%s'", p - 2);
+ cp_error (ec_invalid_option_s, p - 2);
goto template_depth_lose;
}
}
@@ -618,7 +622,7 @@ lang_decode_option (argc, argv)
endp++;
else
{
- error ("Invalid option `%s'", p - 2);
+ cp_error (ec_invalid_option_s, p - 2);
goto mangling_version_lose;
}
}
@@ -711,6 +715,25 @@ lang_decode_option (argc, argv)
warn_unknown_pragmas = setting * 2;
else if (!strcmp (p, "non-template-friend"))
warn_nontemplate_friend = setting;
+ else if (!strncmp (p, "number-", strlen ("number-")))
+ {
+ char *endp = p + strlen ("number-");
+ while (*endp)
+ {
+ if (*endp >= '0' && *endp <= '9')
+ endp++;
+ else
+ {
+ cp_error (ec_invalid_option_s, p - 2);
+ endp = 0;
+ }
+ }
+ if (endp)
+ {
+ int warning_number = atoi (p + strlen ("number-"));
+ cp_enable_warning (warning_number, setting);
+ }
+ }
else if (!strcmp (p, "comment"))
; /* cpp handles this one. */
else if (!strcmp (p, "comments"))
@@ -781,7 +804,7 @@ grok_method_quals (ctype, function, quals)
if (TREE_VALUE (quals) == ridpointers[(int)RID_CONST])
{
if (TYPE_READONLY (ctype))
- error ("duplicate `%s' %s",
+ cp_error (ec_duplicate_s_s,
IDENTIFIER_POINTER (TREE_VALUE (quals)),
(TREE_CODE (function) == FUNCTION_DECL
? "for member function" : "in type declaration"));
@@ -791,7 +814,7 @@ grok_method_quals (ctype, function, quals)
else if (TREE_VALUE (quals) == ridpointers[(int)RID_VOLATILE])
{
if (TYPE_VOLATILE (ctype))
- error ("duplicate `%s' %s",
+ cp_error (ec_duplicate_s_s,
IDENTIFIER_POINTER (TREE_VALUE (quals)),
(TREE_CODE (function) == FUNCTION_DECL
? "for member function" : "in type declaration"));
@@ -837,13 +860,13 @@ warn_if_unknown_interface (decl)
lineno = til->line;
input_filename = til->file;
}
- cp_warning ("template `%#D' instantiated in file without #pragma interface",
+ cp_warning (ec_template_instantiated_in_file_without_pragma_interface,
decl);
lineno = sl;
input_filename = sf;
}
else
- cp_warning_at ("template `%#D' defined in file without #pragma interface",
+ cp_warning_at (ec_template_defined_in_file_without_pragma_interface,
decl);
}
@@ -866,7 +889,7 @@ grok_x_components (specs, components)
if (t == NULL_TREE)
{
- error ("error in component specification");
+ cp_error (ec_error_in_component_specification);
return NULL_TREE;
}
@@ -933,7 +956,7 @@ grok_x_components (specs, components)
q = &TREE_CHAIN (*q);
}
if (TYPE_METHODS (t))
- error ("an anonymous union cannot have function members");
+ cp_error (ec_an_anonymous_union_cannot_have_function_members);
p = &pending_inlines;
for (; *p; *p = (*p)->next)
@@ -955,7 +978,7 @@ grok_x_components (specs, components)
default:
if (t != void_type_node)
- error ("empty component declaration");
+ cp_error (ec_empty_component_declaration);
return NULL_TREE;
}
}
@@ -1052,7 +1075,7 @@ grokclassfn (ctype, cname, function, flags, quals)
if (fn_name == NULL_TREE)
{
- error ("name missing for member function");
+ cp_error (ec_name_missing_for_member_function);
fn_name = get_identifier ("<anonymous>");
DECL_NAME (function) = fn_name;
}
@@ -1122,7 +1145,7 @@ grok_alignof (expr)
if (TREE_CODE (expr) == COMPONENT_REF
&& DECL_BIT_FIELD (TREE_OPERAND (expr, 1)))
- error ("`__alignof__' applied to a bit-field");
+ cp_error (ec_alignof_applied_to_a_bitfield);
if (TREE_CODE (expr) == INDIRECT_REF)
{
@@ -1174,7 +1197,7 @@ grok_array_decl (array_expr, index_exp)
{
/* Something has gone very wrong. Assume we are mistakenly reducing
an expression instead of a declaration. */
- error ("parser may be lost: is there a '{' missing somewhere?");
+ cp_error (ec_parser_may_be_lost_is_there_a_missing_somewhere);
return NULL_TREE;
}
@@ -1205,7 +1228,7 @@ grok_array_decl (array_expr, index_exp)
i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp, 0);
if ((p1 && i2) && (i1 && p2))
- error ("ambiguous conversion for array subscript");
+ cp_error (ec_ambiguous_conversion_for_array_subscript);
if (p1 && i2)
array_expr = p1, index_exp = i2;
@@ -1213,13 +1236,13 @@ grok_array_decl (array_expr, index_exp)
array_expr = p2, index_exp = i1;
else
{
- cp_error ("invalid types `%T[%T]' for array subscript",
+ cp_error (ec_invalid_types_for_array_subscript,
type, TREE_TYPE (index_exp));
return error_mark_node;
}
if (array_expr == error_mark_node || index_exp == error_mark_node)
- error ("ambiguous conversion for array subscript");
+ cp_error (ec_ambiguous_conversion_for_array_subscript);
return build_array_ref (array_expr, index_exp);
}
@@ -1261,7 +1284,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
if (t == NULL_TREE || t == error_mark_node)
{
- cp_error ("type `%#T' argument given to `delete', expected pointer",
+ cp_error (ec_type_argument_given_to_delete_expected_pointer,
TREE_TYPE (exp));
return error_mark_node;
}
@@ -1269,7 +1292,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
if (doing_vec == 2)
{
maxindex = build_binary_op (MINUS_EXPR, size, integer_one_node, 1);
- pedwarn ("anachronistic use of array size in vector delete");
+ cp_pedwarn (ec_anachronistic_use_of_array_size_in_vector_delete);
}
type = TREE_TYPE (t);
@@ -1279,7 +1302,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
/* You can't delete functions. */
if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
{
- error ("cannot delete a function");
+ cp_error (ec_cannot_delete_a_function);
return error_mark_node;
}
@@ -1287,7 +1310,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
if (TREE_CODE (t) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (t, 0)) == VAR_DECL
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE)
- cp_warning ("deleting array `%#D'", TREE_OPERAND (t, 0));
+ cp_warning (ec_deleting_array, TREE_OPERAND (t, 0));
/* Deleting a pointer with the value zero is valid and has no effect. */
if (integer_zerop (t))
@@ -1334,7 +1357,7 @@ check_member_template (tmpl)
/* 14.5.2.2 [temp.mem]
A local class shall not have member templates. */
- cp_error ("declaration of member template `%#D' in local class",
+ cp_error (ec_declaration_of_member_template_in_local_class,
decl);
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
@@ -1342,8 +1365,7 @@ check_member_template (tmpl)
/* 14.5.2.3 [temp.mem]
A member function template shall not be virtual. */
- cp_error
- ("invalid use of `virtual' in template declaration of `%#D'",
+ cp_error (ec_invalid_use_of_virtual_in_template_declaration_of,
decl);
DECL_VIRTUAL_P (decl) = 0;
}
@@ -1353,7 +1375,7 @@ check_member_template (tmpl)
DECL_IGNORED_P (tmpl) = 1;
}
else
- cp_error ("template declaration of `%#D'", decl);
+ cp_error (ec_template_declaration_of, decl);
}
/* Return true iff TYPE is a valid Java parameter or return type. */
@@ -1403,7 +1425,7 @@ check_java_method (ctype, method)
tree ret_type = TREE_TYPE (TREE_TYPE (method));
if (! acceptable_java_type (ret_type))
{
- cp_error ("Java method '%D' has non-Java return type `%T'",
+ cp_error (ec_ava_method_has_nonava_return_type,
method, ret_type);
jerr++;
}
@@ -1412,7 +1434,7 @@ check_java_method (ctype, method)
tree type = TREE_VALUE (arg_types);
if (! acceptable_java_type (type))
{
- cp_error ("Java method '%D' has non-Java parameter type `%T'",
+ cp_error (ec_ava_method_has_nonava_parameter_type,
method, type);
jerr++;
}
@@ -1526,17 +1548,17 @@ check_classfn (ctype, function)
if (methods != end)
{
tree fndecl = *methods;
- cp_error ("prototype for `%#D' does not match any in class `%T'",
+ cp_error (ec_prototype_for_does_not_match_any_in_class,
function, ctype);
- cp_error_at ("candidate%s: %+#D", OVL_NEXT (fndecl) ? "s are" : " is",
+ cp_error_at (ec_candidates, OVL_NEXT (fndecl) ? "s are" : " is",
OVL_CURRENT (fndecl));
while (fndecl = OVL_NEXT (fndecl), fndecl)
- cp_error_at (" %#D", OVL_CURRENT(fndecl));
+ cp_error_at (ec_candidate_2, OVL_CURRENT(fndecl));
}
else
{
methods = 0;
- cp_error ("no `%#D' member function declared in class `%T'",
+ cp_error (ec_no_member_function_declared_in_class,
function, ctype);
}
@@ -1616,7 +1638,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
if (DECL_NAME (value) != NULL_TREE
&& IDENTIFIER_POINTER (DECL_NAME (value))[0] == '_'
&& ! strcmp (IDENTIFIER_POINTER (DECL_NAME (value)), "_vptr"))
- cp_error ("member `%D' conflicts with virtual function table field name",
+ cp_error (ec_member_conflicts_with_virtual_function_table_field_name,
value);
/* Stash away type declarations. */
@@ -1641,13 +1663,13 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
if (IS_SIGNATURE (current_class_type)
&& TREE_CODE (value) != FUNCTION_DECL)
{
- error ("field declaration not allowed in signature");
+ cp_error (ec_field_declaration_not_allowed_in_signature);
return void_type_node;
}
if (DECL_IN_AGGR_P (value))
{
- cp_error ("`%D' is already defined in the class %T", value,
+ cp_error (ec_is_already_defined_in_the_class, value,
DECL_CONTEXT (value));
return void_type_node;
}
@@ -1660,7 +1682,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
if (IS_SIGNATURE (current_class_type)
&& TREE_CODE (value) == FUNCTION_DECL)
{
- error ("function declarations cannot have initializers in signature");
+ cp_error (ec_function_declarations_cannot_have_initializers_in_signature);
init = NULL_TREE;
}
else if (TREE_CODE (value) == FUNCTION_DECL)
@@ -1706,7 +1728,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
&& (TREE_CODE_CLASS (TREE_CODE (init)) != 'd'
|| DECL_EXTERNAL (init) == 0)))
{
- error ("field initializer is not constant");
+ cp_error (ec_field_initializer_is_not_constant);
init = error_mark_node;
}
}
@@ -1728,8 +1750,8 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
tree olddecl = IDENTIFIER_LOCAL_VALUE (declarator);
if (decl_template_parm_p (olddecl))
{
- cp_error ("redeclaration of template parameter `%T'", declarator);
- cp_error_at (" previously declared here `%#D'", olddecl);
+ cp_error (ec_redeclaration_of_template_parameter, declarator);
+ cp_error_at (ec_previously_declared_here, olddecl);
}
}
@@ -1761,9 +1783,9 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
{
static int explanation = 0;
- error ("initializer invalid for static member with constructor");
+ cp_error (ec_initializer_invalid_for_static_member_with_constructor);
if (explanation++ == 0)
- error ("(you really want to initialize it separately)");
+ cp_error (ec_you_really_want_to_initialize_it_separately);
init = 0;
}
/* Force the compiler to know when an uninitialized static
@@ -1812,7 +1834,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
#if 0 /* Just because a fn is declared doesn't mean we'll try to define it. */
if (current_function_decl && ! IS_SIGNATURE (current_class_type))
- cp_error ("method `%#D' of local class must be defined in class body",
+ cp_error (ec_method_of_local_class_must_be_defined_in_class_body,
value);
#endif
@@ -1842,7 +1864,7 @@ grokbitfield (declarator, declspecs, width)
if (TREE_CODE (value) == TYPE_DECL)
{
- cp_error ("cannot declare `%D' to be a bitfield type", value);
+ cp_error (ec_cannot_declare_to_be_a_bitfield_type, value);
return NULL_TREE;
}
@@ -1852,20 +1874,20 @@ grokbitfield (declarator, declspecs, width)
check here. */
if (TREE_CODE (value) == FUNCTION_DECL)
{
- cp_error ("cannot declare bitfield `%D' with funcion type",
+ cp_error (ec_cannot_declare_bitfield_with_funcion_type,
DECL_NAME (value));
return NULL_TREE;
}
if (IS_SIGNATURE (current_class_type))
{
- error ("field declaration not allowed in signature");
+ cp_error (ec_field_declaration_not_allowed_in_signature);
return void_type_node;
}
if (DECL_IN_AGGR_P (value))
{
- cp_error ("`%D' is already defined in the class %T", value,
+ cp_error (ec_is_already_defined_in_the_class, value,
DECL_CONTEXT (value));
return void_type_node;
}
@@ -1874,7 +1896,7 @@ grokbitfield (declarator, declspecs, width)
if (TREE_STATIC (value))
{
- cp_error ("static member `%D' cannot be a bitfield", value);
+ cp_error (ec_static_member_cannot_be_a_bitfield, value);
return NULL_TREE;
}
cp_finish_decl (value, NULL_TREE, NULL_TREE, 0, 0);
@@ -1965,11 +1987,11 @@ grok_function_init (decl, init)
tree type = TREE_TYPE (decl);
if (TREE_CODE (type) == FUNCTION_TYPE)
- cp_error ("initializer specified for non-member function `%D'", decl);
+ cp_error (ec_initializer_specified_for_nonmember_function, decl);
#if 0
/* We'll check for this in finish_struct_1. */
else if (DECL_VINDEX (decl) == NULL_TREE)
- cp_error ("initializer specified for non-virtual method `%D'", decl);
+ cp_error (ec_initializer_specified_for_nonvirtual_method, decl);
#endif
else if (integer_zerop (init))
{
@@ -1997,7 +2019,7 @@ grok_function_init (decl, init)
}
}
else
- cp_error ("invalid initializer for virtual method `%D'", decl);
+ cp_error (ec_invalid_initializer_for_virtual_method, decl);
}
void
@@ -2220,9 +2242,9 @@ build_anon_union_vars (anon_decl, elems, static_p, external_p)
continue;
if (TREE_PRIVATE (field))
- cp_pedwarn_at ("private member `%#D' in anonymous union", field);
+ cp_pedwarn_at (ec_private_member_in_anonymous_union, field);
else if (TREE_PROTECTED (field))
- cp_pedwarn_at ("protected member `%#D' in anonymous union", field);
+ cp_pedwarn_at (ec_protected_member_in_anonymous_union, field);
if (DECL_NAME (field) == NULL_TREE
&& TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
@@ -2292,7 +2314,7 @@ finish_anon_union (anon_union_decl)
if (public_p)
{
- error ("global anonymous unions must be declared static");
+ cp_error (ec_global_anonymous_unions_must_be_declared_static);
return;
}
@@ -2308,7 +2330,7 @@ finish_anon_union (anon_union_decl)
}
else
{
- warning ("anonymous union with no members");
+ cp_warning (ec_anonymous_union_with_no_members);
return;
}
}
@@ -2368,15 +2390,15 @@ coerce_new_type (type)
if (TREE_CODE (type) == METHOD_TYPE)
type = build_function_type (TREE_TYPE (type), TREE_CHAIN (TYPE_ARG_TYPES (type)));
if (TREE_TYPE (type) != ptr_type_node)
- e1 = 1, error ("`operator new' must return type `void *'");
+ e1 = 1, cp_error (ec_operator_new_must_return_type_void);
/* Technically the type must be `size_t', but we may not know
what that is. */
if (TYPE_ARG_TYPES (type) == NULL_TREE)
- e1 = 1, error ("`operator new' takes type `size_t' parameter");
+ e1 = 1, cp_error (ec_operator_new_takes_type_size_t_parameter);
else if (TREE_CODE (TREE_VALUE (TYPE_ARG_TYPES (type))) != INTEGER_TYPE
|| TYPE_PRECISION (TREE_VALUE (TYPE_ARG_TYPES (type))) != TYPE_PRECISION (sizetype))
- e2 = 1, error ("`operator new' takes type `size_t' as first parameter");
+ e2 = 1, cp_error (ec_operator_new_takes_type_size_t_as_first_parameter);
if (e2)
type = build_function_type (ptr_type_node, tree_cons (NULL_TREE, sizetype, TREE_CHAIN (TYPE_ARG_TYPES (type))));
else if (e1)
@@ -2401,11 +2423,11 @@ coerce_delete_type (type)
}
if (TREE_TYPE (type) != void_type_node)
- e1 = 1, error ("`operator delete' must return type `void'");
+ e1 = 1, cp_error (ec_operator_delete_must_return_type_void);
if (arg_types == NULL_TREE
|| TREE_VALUE (arg_types) != ptr_type_node)
- e2 = 1, error ("`operator delete' takes type `void *' as first parameter");
+ e2 = 1, cp_error (ec_operator_delete_takes_type_void_as_first_parameter);
#if 0
if (arg_types
@@ -2417,14 +2439,14 @@ coerce_delete_type (type)
tree t2 = TREE_VALUE (TREE_CHAIN (arg_types));
if (TREE_CODE (t2) != INTEGER_TYPE
|| TYPE_PRECISION (t2) != TYPE_PRECISION (sizetype))
- e3 = 1, error ("second argument to `operator delete' must be of type `size_t'");
+ e3 = 1, cp_error (ec_second_argument_to_operator_delete_must_be_of_type_size_t);
else if (TREE_CHAIN (TREE_CHAIN (arg_types)) != void_list_node)
{
e3 = 1;
if (TREE_CHAIN (TREE_CHAIN (arg_types)))
- error ("too many arguments in declaration of `operator delete'");
+ cp_error (ec_too_many_arguments_in_declaration_of_operator_delete);
else
- error ("`...' invalid in specification of `operator delete'");
+ cp_error (ec_invalid_in_specification_of_operator_delete);
}
}
@@ -2981,7 +3003,7 @@ setup_initp ()
if (! flag_init_priority)
{
for (t = static_aggregates_initp; t; t = TREE_CHAIN (t))
- cp_warning ("init_priority for `%#D' ignored without -finit-priority",
+ cp_warning (ec_init_priority_for_ignored_without_finitpriority,
TREE_VALUE (t));
return;
}
@@ -3662,7 +3684,7 @@ reparse_absdcl_as_casts (decl, expr)
if (IS_SIGNATURE (type))
{
- error ("cast specifies signature type");
+ cp_error (ec_cast_specifies_signature_type);
return error_mark_node;
}
@@ -3683,7 +3705,7 @@ reparse_absdcl_as_casts (decl, expr)
}
if (warn_old_style_cast)
- warning ("use of old-style cast");
+ cp_warning (ec_use_of_oldstyle_cast);
return expr;
}
@@ -4024,7 +4046,7 @@ check_cp_case_value (value)
if (TREE_CODE (value) != INTEGER_CST
&& value != error_mark_node)
{
- cp_error ("case label `%E' does not reduce to an integer constant",
+ cp_error (ec_case_label_does_not_reduce_to_an_integer_constant,
value);
value = error_mark_node;
}
@@ -4188,10 +4210,10 @@ ambiguous_decl (name, old, new, flags)
/* Some declarations are functions, some are not. */
if (flags & LOOKUP_COMPLAIN)
{
- cp_error ("use of `%D' is ambiguous", name);
- cp_error_at (" first declared as `%#D' here",
+ cp_error (ec_use_of_is_ambiguous, name);
+ cp_error_at (ec_first_declared_as_here,
BINDING_VALUE (old));
- cp_error_at (" also declared as `%#D' here", val);
+ cp_error_at (ec_also_declared_as_here, val);
}
return error_mark_node;
}
@@ -4206,9 +4228,9 @@ ambiguous_decl (name, old, new, flags)
{
if (flags & LOOKUP_COMPLAIN)
{
- cp_error ("`%D' denotes an ambiguous type",name);
- cp_error_at (" first type here", BINDING_TYPE (old));
- cp_error_at (" other type here", type);
+ cp_error (ec_denotes_an_ambiguous_type,name);
+ cp_error_at (ec_first_type_here, BINDING_TYPE (old));
+ cp_error_at (ec_other_type_here, type);
}
}
return old;
@@ -4295,7 +4317,7 @@ set_decl_namespace (decl, scope)
scope = ORIGINAL_NAMESPACE (scope);
if (!is_namespace_ancestor (current_namespace, scope))
- cp_error ("declaration of `%D' not in a namespace surrounding `%D'",
+ cp_error (ec_declaration_of_not_in_a_namespace_surrounding,
decl, scope);
DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
if (scope != current_namespace)
@@ -4320,7 +4342,7 @@ set_decl_namespace (decl, scope)
else
return;
complain:
- cp_error ("`%D' should have been declared inside `%D'",
+ cp_error (ec_should_have_been_declared_inside,
decl, scope);
}
@@ -4423,9 +4445,9 @@ add_function (k, fn)
{
fn = f1; f1 = f2; f2 = fn;
}
- cp_error_at ("`%D' is not a function,", f1);
- cp_error_at (" conflict with `%D'", f2);
- cp_error (" in call to `%D'", k->name);
+ cp_error_at (ec_is_not_a_function, f1);
+ cp_error_at (ec_conflict_with, f2);
+ cp_error (ec_in_call_to, k->name);
return 1;
}
else
@@ -4693,7 +4715,7 @@ do_namespace_alias (alias, namespace)
if (TREE_CODE (namespace) != NAMESPACE_DECL)
{
/* The parser did not find it, so it's not there. */
- cp_error ("unknown namespace `%D'", namespace);
+ cp_error (ec_unknown_namespace, namespace);
return;
}
@@ -4755,7 +4777,7 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
if (!BINDING_VALUE (decls) && !BINDING_TYPE (decls))
{
- cp_error ("`%D' not declared", name);
+ cp_error (ec_not_declared, name);
return;
}
@@ -4803,7 +4825,7 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
*newtype = BINDING_TYPE (decls);
if (oldtype && *newtype && oldtype != *newtype)
{
- cp_error ("using directive `%D' introduced ambiguous type `%T'",
+ cp_error (ec_using_directive_introduced_ambiguous_type,
name, oldtype);
return;
}
@@ -4870,13 +4892,13 @@ do_class_using_decl (decl)
if (TREE_CODE (decl) != SCOPE_REF
|| TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (decl, 0))) != 't')
{
- cp_error ("using-declaration for non-member at class scope");
+ cp_error (ec_usingdeclaration_for_nonmember_at_class_scope);
return NULL_TREE;
}
name = TREE_OPERAND (decl, 1);
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
- cp_error ("using-declaration for destructor");
+ cp_error (ec_usingdeclaration_for_destructor);
return NULL_TREE;
}
if (TREE_CODE (name) == TYPE_DECL)
@@ -4903,12 +4925,12 @@ do_using_directive (namespace)
if (TREE_CODE (namespace) == IDENTIFIER_NODE)
{
/* Lookup in lexer did not find a namespace. */
- cp_error ("namespace `%T' undeclared", namespace);
+ cp_error (ec_namespace_undeclared, namespace);
return;
}
if (TREE_CODE (namespace) != NAMESPACE_DECL)
{
- cp_error ("`%T' is not a namespace", namespace);
+ cp_error (ec_is_not_a_namespace, namespace);
return;
}
namespace = ORIGINAL_NAMESPACE (namespace);
@@ -4931,7 +4953,7 @@ check_default_args (x)
saw_def = 1;
else if (saw_def)
{
- cp_error_at ("default argument missing for parameter %P of `%+#D'",
+ cp_error_at (ec_default_argument_missing_for_parameter_of,
i, x);
break;
}
@@ -4976,9 +4998,9 @@ handle_class_head (aggr, scope, id)
return id;
if (scope)
- cp_error ("`%T' does not have a nested type named `%D'", scope, id);
+ cp_error (ec_does_not_have_a_nested_type_named, scope, id);
else
- cp_error ("no file-scope type named `%D'", id);
+ cp_error (ec_no_filescope_type_named, id);
id = xref_tag
(aggr, make_anon_name (), 1);
diff --git a/gcc/cp/errfn.c b/gcc/cp/errfn.c
index 10de8a9..28e754f 100644
--- a/gcc/cp/errfn.c
+++ b/gcc/cp/errfn.c
@@ -23,6 +23,10 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "tree.h"
#include "toplev.h"
+/* The declarations of cp_error and such here are incompatible with
+ those in cp-tree.h. */
+#define NO_CP_ERROR_FNS
+#include "cp-tree.h"
/* cp_printer is the type of a function which converts an argument into
a string for digestion by printf. The cp_printer function should deal
@@ -37,10 +41,36 @@ extern cp_printer * cp_printers[256];
when we're computing the conversion costs for a method call. */
int cp_silent = 0;
+/* The error messages themselves. */
+typedef struct cp_err_msg {
+ /* The format of the error message. */
+ char* format;
+
+ /* The code which we should check when deciding whether or not to
+ issue this message. Used to indicate that some errors are "the
+ same" even though they have different formats. */
+ error_code equiv_code;
+
+ /* A count of how many more times this warning has been enabled than
+ disabled. (Ignored for errors.) */
+ int enabled;
+} cp_err_msg;
+
+static cp_err_msg err_msgs[] = {
+#undef DEFERROR
+#undef DEFERRORNUM
+#define DEFERROR(code, format) DEFERRORNUM(code, format, code)
+#define DEFERRORNUM(code, format, equiv_code) \
+ { format, equiv_code, 1 },
+#include "cp-error.def"
+ { 0, 0, 0 }
+};
+
typedef void errorfn (); /* deliberately vague */
extern char* cp_file_of PROTO((tree));
extern int cp_line_of PROTO((tree));
+static int is_warning_enabled PROTO((error_code));
#define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap)
@@ -49,13 +79,13 @@ extern int cp_line_of PROTO((tree));
#ifdef __STDC__
static void
-cp_thing (errorfn *errfn, int atarg1, const char *format, va_list ap)
+cp_thing (errorfn *errfn, int atarg1, error_code ec, va_list ap)
#else
static void
-cp_thing (errfn, atarg1, format, ap)
+cp_thing (errfn, atarg1, ec, ap)
errorfn *errfn;
int atarg1;
- const char *format;
+ error_code ec;
va_list ap;
#endif
{
@@ -66,14 +96,29 @@ cp_thing (errfn, atarg1, format, ap)
long offset;
const char *f;
tree atarg = 0;
+ char* format;
+
+ my_friendly_assert ((int) ec >= 0 && (int) ec < ec_last_error_code,
+ 0);
+
+ format = err_msgs[(int) ec].format;
+
+ my_friendly_assert (format != 0, 0);
- len = strlen (format) + 1;
+ len = strlen (format) + 1 /* '\0' */ + 16 /* code number */;
if (len > buflen)
{
buflen = len;
buf = xrealloc (buf, buflen);
}
- offset = 0;
+ if (flag_diag_codes)
+ {
+ sprintf (buf, "[%d] ", (int) ec);
+ for (offset = 0; buf[offset]; ++offset)
+ ;
+ }
+ else
+ offset = 0;
for (f = format; *f; ++f)
{
@@ -198,10 +243,10 @@ cp_thing (errfn, atarg1, format, ap)
}
#ifdef __STDC__
-#define DECLARE(name) void name (const char *format, ...)
-#define INIT va_start (ap, format)
+#define DECLARE(name) void name (error_code ec, ...)
+#define INIT va_start (ap, ec)
#else
-#define DECLARE(name) void name (format, va_alist) char *format; va_dcl
+#define DECLARE(name) void name (ec, va_alist) error_code ec; va_dcl
#define INIT va_start (ap)
#endif
@@ -210,7 +255,7 @@ DECLARE (cp_error)
va_list ap;
INIT;
if (! cp_silent)
- cp_thing ((errorfn *) error, 0, format, ap);
+ cp_thing ((errorfn *) error, 0, ec, ap);
va_end (ap);
}
@@ -218,8 +263,8 @@ DECLARE (cp_warning)
{
va_list ap;
INIT;
- if (! cp_silent)
- cp_thing ((errorfn *) warning, 0, format, ap);
+ if (! cp_silent && is_warning_enabled (ec))
+ cp_thing ((errorfn *) warning, 0, ec, ap);
va_end (ap);
}
@@ -227,8 +272,8 @@ DECLARE (cp_pedwarn)
{
va_list ap;
INIT;
- if (! cp_silent)
- cp_thing ((errorfn *) pedwarn, 0, format, ap);
+ if (! cp_silent && is_warning_enabled (ec))
+ cp_thing ((errorfn *) pedwarn, 0, ec, ap);
va_end (ap);
}
@@ -238,7 +283,7 @@ DECLARE (cp_compiler_error)
va_list ap;
INIT;
if (! cp_silent)
- cp_thing (compiler_error, 0, format, ap);
+ cp_thing (compiler_error, 0, ec, ap);
va_end (ap);
}
@@ -246,7 +291,7 @@ DECLARE (cp_sprintf)
{
va_list ap;
INIT;
- cp_thing ((errorfn *) sprintf, 0, format, ap);
+ cp_thing ((errorfn *) sprintf, 0, ec, ap);
va_end (ap);
}
@@ -255,7 +300,7 @@ DECLARE (cp_error_at)
va_list ap;
INIT;
if (! cp_silent)
- cp_thing ((errorfn *) error_with_file_and_line, 1, format, ap);
+ cp_thing ((errorfn *) error_with_file_and_line, 1, ec, ap);
va_end (ap);
}
@@ -263,8 +308,8 @@ DECLARE (cp_warning_at)
{
va_list ap;
INIT;
- if (! cp_silent)
- cp_thing ((errorfn *) warning_with_file_and_line, 1, format, ap);
+ if (! cp_silent && is_warning_enabled (ec))
+ cp_thing ((errorfn *) warning_with_file_and_line, 1, ec, ap);
va_end (ap);
}
@@ -272,7 +317,42 @@ DECLARE (cp_pedwarn_at)
{
va_list ap;
INIT;
- if (! cp_silent)
- cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, format, ap);
+ if (! cp_silent && is_warning_enabled (ec))
+ cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, ec, ap);
va_end (ap);
}
+
+/* If ON is non-zero, enable the warning with the indicated NUMBER.
+ If OFF is zero, disable it. Actually, this function manipulates a
+ counter, so that enabling/disabling of warnings can nest
+ appropriately. */
+
+void
+cp_enable_warning (number, on)
+ int number;
+ int on;
+{
+ if (number < 0 || number > (int) ec_last_error_code)
+ error ("invalid warning number %d", number);
+ else if (on)
+ err_msgs[number].enabled++;
+ else
+ {
+ if (!err_msgs[number].enabled)
+ warning ("warning %d not enabled", number);
+ else
+ err_msgs[number].enabled--;
+ }
+}
+
+/* Returns non-zero if EC corresponds to an enabled error message. */
+
+int
+is_warning_enabled (ec)
+ error_code ec;
+{
+ my_friendly_assert ((int) ec >= 0 && (int) ec < ec_last_error_code,
+ 0);
+
+ return err_msgs[(int) ec].enabled;
+}
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 69315be..eb50219 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -633,7 +633,7 @@ process_start_catch_block_old (declspecs, declarator)
decl = grokdeclarator (declarator, declspecs, CATCHPARM, 1, NULL_TREE);
if (decl == NULL_TREE)
- error ("invalid catch parameter");
+ cp_error (ec_invalid_catch_parameter);
}
if (decl)
@@ -745,7 +745,7 @@ process_start_catch_block (declspecs, declarator)
decl = grokdeclarator (declarator, declspecs, CATCHPARM, 1, NULL_TREE);
if (decl == NULL_TREE)
- error ("invalid catch parameter");
+ cp_error (ec_invalid_catch_parameter);
}
if (decl)
@@ -1173,7 +1173,7 @@ expand_throw (exp)
exp = build_modify_expr (object, INIT_EXPR, exp);
if (exp == error_mark_node)
- error (" in thrown expression");
+ cp_error (ec_in_thrown_expression);
expand_expr (exp, const0_rtx, VOIDmode, 0);
expand_eh_region_end (build_terminate_handler ());
@@ -1277,7 +1277,7 @@ build_throw (e)
return build_min (THROW_EXPR, void_type_node, e);
if (e == null_node)
- cp_warning ("throwing NULL, which has integral, not pointer type");
+ cp_warning (ec_throwing_which_has_integral_not_pointer_type);
e = build1 (THROW_EXPR, void_type_node, e);
TREE_SIDE_EFFECTS (e) = 1;
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)
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index d01ecda..0c42b92 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -155,9 +155,9 @@ add_friend (type, decl)
{
if (decl == TREE_VALUE (friends))
{
- cp_warning ("`%D' is already a friend of class `%T'",
+ cp_warning (ec_is_already_a_friend_of_class,
decl, type);
- cp_warning_at ("previous friend declaration of `%D'",
+ cp_warning_at (ec_previous_friend_declaration_of,
TREE_VALUE (friends));
return;
}
@@ -205,11 +205,11 @@ add_friends (type, name, friend_type)
if (friends)
{
if (friend_type)
- warning ("method `%s::%s' is already a friend of class",
+ cp_warning (ec_method_ss_is_already_a_friend_of_class,
TYPE_NAME_STRING (friend_type),
IDENTIFIER_POINTER (name));
else
- warning ("function `%s' is already a friend of class `%s'",
+ cp_warning (ec_function_s_is_already_a_friend_of_class_s,
IDENTIFIER_POINTER (name),
IDENTIFIER_POINTER (DECL_NAME (typedecl)));
}
@@ -252,12 +252,12 @@ make_friend_class (type, friend_type)
if (IS_SIGNATURE (type))
{
- error ("`friend' declaration in signature definition");
+ cp_error (ec_friend_declaration_in_signature_definition);
return;
}
if (IS_SIGNATURE (friend_type))
{
- error ("signature type `%s' declared `friend'",
+ cp_error (ec_signature_type_s_declared_friend,
IDENTIFIER_POINTER (TYPE_IDENTIFIER (friend_type)));
return;
}
@@ -269,7 +269,7 @@ make_friend_class (type, friend_type)
Friend declarations shall not declare partial
specializations. */
- cp_error ("partial specialization `%T' declared `friend'",
+ cp_error (ec_partial_specialization_declared_friend,
friend_type);
return;
}
@@ -281,7 +281,7 @@ make_friend_class (type, friend_type)
is_template_friend = 1;
else if (comptypes (type, friend_type, 1))
{
- pedwarn ("class `%s' is implicitly friends with itself",
+ cp_pedwarn (ec_class_s_is_implicitly_friends_with_itself,
TYPE_NAME_STRING (type));
return;
}
@@ -301,7 +301,7 @@ make_friend_class (type, friend_type)
comptypes (TREE_VALUE (classes), friend_type, 1)))
classes = TREE_CHAIN (classes);
if (classes)
- cp_warning ("`%T' is already a friend of `%T'",
+ cp_warning (ec_is_already_a_friend_of,
TREE_VALUE (classes), type);
else
{
@@ -384,7 +384,7 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
TYPE_SIZE (ctype) || template_class_depth (ctype) > 0)
add_friend (current_class_type, decl);
else
- cp_error ("member `%D' declared as friend before type `%T' defined",
+ cp_error (ec_member_declared_as_friend_before_type_defined,
decl, ctype);
}
}
@@ -399,7 +399,7 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
if (fields)
add_friends (current_class_type, declarator, ctype);
else
- cp_error ("method `%D' is not a member of class `%T'",
+ cp_error (ec_method_is_not_a_member_of_class,
declarator, ctype);
decl = void_type_node;
}
@@ -452,14 +452,14 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
&& current_template_parms && uses_template_parms (decl))
{
static int explained;
- cp_warning ("friend declaration `%#D'", decl);
- warning (" declares a non-template function");
+ cp_warning (ec_friend_declaration, decl);
+ cp_warning (ec_declares_a_nontemplate_function);
if (! explained)
{
- warning (" (if this is not what you intended, make sure");
- warning (" the function template has already been declared,");
- warning (" and add <> after the function name here)");
- warning (" To disable warning use -Wno-non-template-friend");
+ cp_warning (ec_if_this_is_not_what_you_intended_make_sure);
+ cp_warning (ec_the_function_template_has_already_been_declared);
+ cp_warning (ec_and_add_after_the_function_name_here);
+ cp_warning (ec_o_disable_warning_use_nonontemplatefriend);
explained = 1;
}
}
@@ -477,7 +477,7 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
tree decl = lookup_name_nonclass (declarator);
if (decl == NULL_TREE)
{
- cp_warning ("implicitly declaring `%T' as struct", declarator);
+ cp_warning (ec_implicitly_declaring_as_struct, declarator);
decl = xref_tag (record_type_node, declarator, 1);
decl = TYPE_MAIN_DECL (decl);
}
@@ -486,7 +486,7 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
but not if those functions are really class names. */
if (TREE_CODE (decl) == TREE_LIST && TREE_TYPE (TREE_PURPOSE (decl)))
{
- cp_warning ("`friend %T' archaic, use `friend class %T' instead",
+ cp_warning (ec_friend_archaic_use_friend_class_instead,
declarator, declarator);
decl = TREE_TYPE (TREE_PURPOSE (decl));
}
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 0c15675..d620230 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -190,7 +190,7 @@ perform_member_init (member, name, init, explicit)
init = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
else if (TREE_CODE (type) == REFERENCE_TYPE)
{
- cp_error ("default-initialization of `%#D', which has reference type",
+ cp_error (ec_defaultinitialization_of_which_has_reference_type,
member);
init = error_mark_node;
}
@@ -199,7 +199,7 @@ perform_member_init (member, name, init, explicit)
}
/* member traversal: note it leaves init NULL */
else if (TREE_CODE (TREE_TYPE (member)) == REFERENCE_TYPE)
- cp_pedwarn ("uninitialized reference member `%D'", member);
+ cp_pedwarn (ec_uninitialized_reference_member, member);
}
else if (TREE_CODE (init) == TREE_LIST)
{
@@ -207,7 +207,7 @@ perform_member_init (member, name, init, explicit)
work in that case. */
if (TREE_CHAIN (init))
{
- warning ("initializer list treated as compound expression");
+ cp_warning (ec_initializer_list_treated_as_compound_expression);
init = build_compound_expr (init);
}
else
@@ -298,9 +298,9 @@ sort_member_init (t)
{
if (pos < last_pos)
{
- cp_warning_at ("member initializers for `%#D'", last_field);
- cp_warning_at (" and `%#D'", field);
- warning (" will be re-ordered to match declaration order");
+ cp_warning_at (ec_member_initializers_for, last_field);
+ cp_warning_at (ec_and, field);
+ cp_warning (ec_will_be_reordered_to_match_declaration_order);
}
last_pos = pos;
last_field = field;
@@ -329,7 +329,7 @@ sort_member_init (t)
{
if (purpose_member (name, init_list))
{
- cp_error ("multiple initializations given for member `%D'",
+ cp_error (ec_multiple_initializations_given_for_member,
IDENTIFIER_CLASS_VALUE (name));
continue;
}
@@ -377,13 +377,13 @@ sort_base_init (t, rbase_ptr, vbase_ptr)
switch (n_baseclasses)
{
case 0:
- cp_error ("`%T' does not have a base class to initialize",
+ cp_error (ec_does_not_have_a_base_class_to_initialize,
current_class_type);
return;
case 1:
break;
default:
- cp_error ("unnamed initializer ambiguous for `%T' which uses multiple inheritance",
+ cp_error (ec_unnamed_initializer_ambiguous_for_which_uses_multiple_inheritance,
current_class_type);
return;
}
@@ -415,7 +415,7 @@ sort_base_init (t, rbase_ptr, vbase_ptr)
break;
if (i < 0)
{
- cp_error ("`%T' is not an immediate base class of `%T'",
+ cp_error (ec_is_not_an_immediate_base_class_of,
basetype, current_class_type);
continue;
}
@@ -453,9 +453,9 @@ sort_base_init (t, rbase_ptr, vbase_ptr)
{
if (pos < last_pos)
{
- cp_warning_at ("base initializers for `%#T'", last_base);
- cp_warning_at (" and `%#T'", BINFO_TYPE (binfo));
- warning (" will be re-ordered to match inheritance order");
+ cp_warning_at (ec_base_initializers_for, last_base);
+ cp_warning_at (ec_and, BINFO_TYPE (binfo));
+ cp_warning (ec_will_be_reordered_to_match_inheritance_order);
}
last_pos = pos;
last_base = BINFO_TYPE (binfo);
@@ -578,7 +578,7 @@ emit_base_init (t, immediately)
{
init = NULL_TREE;
if (extra_warnings && copy_args_p (current_function_decl))
- cp_warning ("base class `%#T' should be explicitly initialized in the copy constructor",
+ cp_warning (ec_base_class_should_be_explicitly_initialized_in_the_copy_constructor,
BINFO_TYPE (base_binfo));
}
@@ -658,7 +658,7 @@ emit_base_init (t, immediately)
if (warn_ecpp && init == NULL_TREE
&& !DECL_ARTIFICIAL (member)
&& TREE_CODE (TREE_TYPE (member)) != ARRAY_TYPE)
- cp_warning ("`%D' should be initialized in the member initialization list", member);
+ cp_warning (ec_should_be_initialized_in_the_member_initialization_list, member);
}
perform_member_init (member, name, init, from_init_list);
@@ -683,7 +683,7 @@ emit_base_init (t, immediately)
{
field = TREE_VALUE (field);
if (decl_type_context (field) != current_class_type)
- cp_error ("field `%D' not in immediate context", field);
+ cp_error (ec_field_not_in_immediate_context, field);
}
#if 0
@@ -731,7 +731,7 @@ check_base_init (t)
tree member;
for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member))
if (DECL_NAME (member) && TREE_USED (member))
- cp_error ("field `%D' used before initialized (after assignment to `this')",
+ cp_error (ec_field_used_before_initialized_after_assignment_to_this,
member);
}
@@ -855,13 +855,13 @@ member_init_ok_or_else (field, type, member_name)
return 0;
if (field == NULL_TREE || initializing_context (field) != type)
{
- cp_error ("class `%T' does not have any field named `%s'", type,
+ cp_error (ec_class_does_not_have_any_field_named_s, type,
member_name);
return 0;
}
if (TREE_STATIC (field))
{
- cp_error ("field `%#D' is static; only point of initialization is its declaration",
+ cp_error (ec_field_is_static_only_point_of_initialization_is_its_declaration,
field);
return 0;
}
@@ -907,14 +907,14 @@ expand_member_init (exp, name, init)
switch (CLASSTYPE_N_BASECLASSES (type))
{
case 0:
- error ("base class initializer specified, but no base class to initialize");
+ cp_error (ec_base_class_initializer_specified_but_no_base_class_to_initialize);
return;
case 1:
basetype = TYPE_BINFO_BASETYPE (type, 0);
break;
default:
- error ("initializer for unnamed base class ambiguous");
- cp_error ("(type `%T' uses multiple inheritance)", type);
+ cp_error (ec_initializer_for_unnamed_base_class_ambiguous);
+ cp_error (ec_type_uses_multiple_inheritance, type);
return;
}
@@ -940,7 +940,7 @@ expand_member_init (exp, name, init)
name = TYPE_IDENTIFIER (basetype);
else
{
- error ("no base class to initialize");
+ cp_error (ec_no_base_class_to_initialize);
return;
}
#endif
@@ -954,24 +954,24 @@ expand_member_init (exp, name, init)
if (IDENTIFIER_CLASS_VALUE (name))
goto try_member;
if (TYPE_USES_VIRTUAL_BASECLASSES (type))
- cp_error ("type `%T' is not an immediate or virtual basetype for `%T'",
+ cp_error (ec_type_is_not_an_immediate_or_virtual_basetype_for,
basetype, type);
else
- cp_error ("type `%T' is not an immediate basetype for `%T'",
+ cp_error (ec_type_is_not_an_immediate_basetype_for,
basetype, type);
return;
}
if (purpose_member (basetype, current_base_init_list))
{
- cp_error ("base class `%T' already initialized", basetype);
+ cp_error (ec_base_class_already_initialized, basetype);
return;
}
if (warn_reorder && current_member_init_list)
{
- cp_warning ("base initializer for `%T'", basetype);
- warning (" will be re-ordered to precede member initializations");
+ cp_warning (ec_base_initializer_for, basetype);
+ cp_warning (ec_will_be_reordered_to_precede_member_initializations);
}
base_init = build_tree_list (basetype, init);
@@ -989,7 +989,7 @@ expand_member_init (exp, name, init)
if (purpose_member (name, current_member_init_list))
{
- cp_error ("field `%D' already initialized", field);
+ cp_error (ec_field_already_initialized, field);
return;
}
@@ -1080,7 +1080,7 @@ expand_aggr_init (exp, init, alias_this, flags)
COMPLEX zees(1.0, 0.0)[10];
}
*/
- error ("bad array initializer");
+ cp_error (ec_bad_array_initializer);
return;
}
expand_vec_init (exp, exp, array_type_nelts (type), init,
@@ -1268,7 +1268,7 @@ is_aggr_typedef (name, or_else)
else
{
if (or_else)
- cp_error ("`%T' is not an aggregate typedef", name);
+ cp_error (ec_is_not_an_aggregate_typedef, name);
return 0;
}
@@ -1277,7 +1277,7 @@ is_aggr_typedef (name, or_else)
&& TREE_CODE (type) != TEMPLATE_TEMPLATE_PARM)
{
if (or_else)
- cp_error ("`%T' is not an aggregate type", type);
+ cp_error (ec_is_not_an_aggregate_type, type);
return 0;
}
return 1;
@@ -1299,7 +1299,7 @@ is_aggr_type (type, or_else)
&& TREE_CODE (type) != TEMPLATE_TEMPLATE_PARM)
{
if (or_else)
- cp_error ("`%T' is not an aggregate type", type);
+ cp_error (ec_is_not_an_aggregate_type, type);
return 0;
}
return 1;
@@ -1322,7 +1322,7 @@ get_aggr_from_typedef (name, or_else)
else
{
if (or_else)
- cp_error ("`%T' fails to be an aggregate typedef", name);
+ cp_error (ec_fails_to_be_an_aggregate_typedef, name);
return NULL_TREE;
}
@@ -1331,7 +1331,7 @@ get_aggr_from_typedef (name, or_else)
&& TREE_CODE (type) != TEMPLATE_TEMPLATE_PARM)
{
if (or_else)
- cp_error ("type `%T' is of non-aggregate type", type);
+ cp_error (ec_type_is_of_nonaggregate_type, type);
return NULL_TREE;
}
return type;
@@ -1415,7 +1415,7 @@ build_member_call (type, name, parmlist)
if (dtor)
{
- cp_error ("cannot call destructor `%T::~%T' without object", type,
+ cp_error (ec_cannot_call_destructor_without_object, type,
method_name);
return error_mark_node;
}
@@ -1470,7 +1470,7 @@ build_member_call (type, name, parmlist)
{
if (dont_use_this)
{
- cp_error ("invalid use of non-static field `%D'", t);
+ cp_error (ec_invalid_use_of_nonstatic_field, t);
return error_mark_node;
}
decl = build (COMPONENT_REF, TREE_TYPE (t), decl, t);
@@ -1479,7 +1479,7 @@ build_member_call (type, name, parmlist)
decl = t;
else
{
- cp_error ("invalid use of member `%D'", t);
+ cp_error (ec_invalid_use_of_member, t);
return error_mark_node;
}
if (TYPE_LANG_SPECIFIC (TREE_TYPE (decl)))
@@ -1489,7 +1489,7 @@ build_member_call (type, name, parmlist)
}
else
{
- cp_error ("no method `%T::%D'", type, name);
+ cp_error (ec_no_method, type, name);
return error_mark_node;
}
}
@@ -1555,7 +1555,7 @@ build_offset_ref (type, name)
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
if (! check_dtor_name (type, name))
- cp_error ("qualified type `%T' does not match destructor name `~%T'",
+ cp_error (ec_qualified_type_does_not_match_destructor_name,
type, TREE_OPERAND (name, 0));
name = dtor_identifier;
}
@@ -1574,7 +1574,7 @@ build_offset_ref (type, name)
t = NULL_TREE;
if (t == 0)
{
- cp_error ("incomplete type `%T' does not have member `%D'", type,
+ cp_error (ec_incomplete_type_does_not_have_member, type,
name);
return error_mark_node;
}
@@ -1652,14 +1652,14 @@ build_offset_ref (type, name)
access = compute_access (basebinfo, t);
if (access == access_protected_node)
{
- cp_error_at ("member function `%#D' is protected", t);
- error ("in this context");
+ cp_error_at (ec_member_function_is_protected, t);
+ cp_error (ec_in_this_context);
return error_mark_node;
}
if (access == access_private_node)
{
- cp_error_at ("member function `%#D' is private", t);
- error ("in this context");
+ cp_error_at (ec_member_function_is_private, t);
+ cp_error (ec_in_this_context);
return error_mark_node;
}
mark_used (t);
@@ -1693,7 +1693,7 @@ build_offset_ref (type, name)
if (t == NULL_TREE)
{
- cp_error ("`%D' is not a member of type `%T'", name, type);
+ cp_error (ec_is_not_a_member_of_type, name, type);
return error_mark_node;
}
@@ -1712,7 +1712,7 @@ build_offset_ref (type, name)
if (TREE_CODE (t) == FIELD_DECL && DECL_BIT_FIELD (t))
{
- cp_error ("illegal pointer to bit field `%D'", t);
+ cp_error (ec_illegal_pointer_to_bit_field, t);
return error_mark_node;
}
@@ -1741,7 +1741,7 @@ resolve_offset_ref (exp)
if (TREE_CODE (exp) == TREE_LIST)
{
- cp_pedwarn ("assuming & on overloaded member function");
+ cp_pedwarn (ec_assuming_on_overloaded_member_function);
return build_unary_op (ADDR_EXPR, exp, 0);
}
@@ -1755,7 +1755,7 @@ resolve_offset_ref (exp)
my_friendly_assert (TREE_CODE (type) == OFFSET_TYPE, 214);
if (TYPE_OFFSET_BASETYPE (type) != current_class_type)
{
- error ("object missing in use of pointer-to-member construct");
+ cp_error (ec_object_missing_in_use_of_pointertomember_construct);
return error_mark_node;
}
member = exp;
@@ -1784,9 +1784,9 @@ resolve_offset_ref (exp)
{
if (TREE_ADDRESSABLE (member) == 0)
{
- cp_error_at ("member `%D' is non-static but referenced as a static member",
+ cp_error_at (ec_member_is_nonstatic_but_referenced_as_a_static_member,
member);
- error ("at this point in file");
+ cp_error (ec_at_this_point_in_file);
TREE_ADDRESSABLE (member) = 1;
}
return error_mark_node;
@@ -1822,11 +1822,11 @@ resolve_offset_ref (exp)
/* Issue errors if there was an access violation. */
if (access != access_public_node)
{
- cp_error_at ("member `%D' is %s",
+ cp_error_at (ec_member_is_s,
access == access_private_node
? "private" : "protected",
member);
- cp_error ("in this context");
+ cp_error (ec_in_this_context);
}
/* Even in the case of illegal access, we form the
@@ -1852,7 +1852,7 @@ resolve_offset_ref (exp)
{
if (addr == error_mark_node)
{
- cp_error ("object missing in `%E'", exp);
+ cp_error (ec_object_missing_in, exp);
return error_mark_node;
}
@@ -2012,7 +2012,7 @@ build_new (placement, decl, init, use_global_new)
if (this_nelts != error_mark_node)
{
if (this_nelts == NULL_TREE)
- error ("new of array type fails to specify size");
+ cp_error (ec_new_of_array_type_fails_to_specify_size);
else if (processing_template_decl)
{
nelts = this_nelts;
@@ -2024,7 +2024,7 @@ build_new (placement, decl, init, use_global_new)
absdcl = TREE_OPERAND (absdcl, 0);
if (this_nelts == integer_zero_node)
{
- warning ("zero size array reserves no space");
+ cp_warning (ec_zero_size_array_reserves_no_space);
nelts = integer_zero_node;
}
else
@@ -2099,13 +2099,13 @@ build_new (placement, decl, init, use_global_new)
returned by new.'' ARM 5.3.3 */
if (TREE_CODE (type) == REFERENCE_TYPE)
{
- error ("new cannot be applied to a reference type");
+ cp_error (ec_new_cannot_be_applied_to_a_reference_type);
type = TREE_TYPE (type);
}
if (TREE_CODE (type) == FUNCTION_TYPE)
{
- error ("new cannot be applied to a function type");
+ cp_error (ec_new_cannot_be_applied_to_a_function_type);
return error_mark_node;
}
@@ -2232,7 +2232,7 @@ build_new_1 (exp)
if (TREE_CODE (true_type) == VOID_TYPE)
{
- error ("invalid type `void' for new");
+ cp_error (ec_invalid_type_void_for_new);
return error_mark_node;
}
@@ -2276,7 +2276,7 @@ build_new_1 (exp)
code = VEC_NEW_EXPR;
if (init && pedantic)
- cp_pedwarn ("initialization in array new");
+ cp_pedwarn (ec_initialization_in_array_new);
}
/* Allocate the object. */
@@ -2288,7 +2288,7 @@ build_new_1 (exp)
rval = NULL_TREE;
else
{
- error ("constructors take parameter lists");
+ cp_error (ec_constructors_take_parameter_lists);
return error_mark_node;
}
}
@@ -2405,10 +2405,10 @@ build_new_1 (exp)
TREE_READONLY (deref) = 0;
if (TREE_CHAIN (init) != NULL_TREE)
- pedwarn ("initializer list being treated as compound expression");
+ cp_pedwarn (ec_initializer_list_being_treated_as_compound_expression);
else if (TREE_CODE (init) == CONSTRUCTOR)
{
- pedwarn ("initializer list appears where operand should be used");
+ cp_pedwarn (ec_initializer_list_appears_where_operand_should_be_used);
init = TREE_OPERAND (init, 1);
}
init = build_compound_expr (init);
@@ -2533,7 +2533,7 @@ build_new_1 (exp)
}
}
else if (TYPE_READONLY (true_type))
- cp_error ("uninitialized const in `new' of `%#T'", true_type);
+ cp_error (ec_uninitialized_const_in_new_of, true_type);
done:
@@ -2856,7 +2856,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
&& TYPE_NEEDS_CONSTRUCTING (type)
&& ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
{
- error ("initializer ends prematurely");
+ cp_error (ec_initializer_ends_prematurely);
return error_mark_node;
}
}
@@ -3047,7 +3047,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
addr = save_expr (addr);
if (TYPE_DOMAIN (type) == NULL_TREE)
{
- error ("unknown array size in delete");
+ cp_error (ec_unknown_array_size_in_delete);
return error_mark_node;
}
return build_vec_delete (addr, array_type_nelts (type),
@@ -3295,7 +3295,7 @@ build_vec_delete (base, maxindex, auto_delete_vec, auto_delete,
else
{
if (base != error_mark_node)
- error ("type to vector delete is neither pointer or array type");
+ cp_error (ec_type_to_vector_delete_is_neither_pointer_or_array_type);
return error_mark_node;
}
diff --git a/gcc/cp/lang-options.h b/gcc/cp/lang-options.h
index 32f5ff9..c5aecb8 100644
--- a/gcc/cp/lang-options.h
+++ b/gcc/cp/lang-options.h
@@ -101,6 +101,8 @@ DEFINE_LANG_NAME ("C++")
{ "-fno-weak", "" },
{ "-fxref", "Emit cross referencing information" },
{ "-fno-xref", "" },
+ { "-fdiag-codes", "Show code numbers when printing diagnostics" },
+ { "-fno-diag-codes", "" },
{ "-Wreturn-type", "Warn about inconsistent return types" },
{ "-Wno-return-type", "" },
@@ -126,4 +128,6 @@ DEFINE_LANG_NAME ("C++")
{ "-Wno-old-style-cast", "" },
{ "-Wnon-template-friend", "" },
{ "-Wno-non-template-friend", "Don't warn when non-templatized friend functions are declared within a template" },
+ { "-Wnumber-" },
+ { "-Wno-number-" },
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index e2ab945..ec161b9 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -186,7 +186,7 @@ make_pointer_declarator (cv_qualifiers, target)
{
if (target && TREE_CODE (target) == IDENTIFIER_NODE
&& ANON_AGGRNAME_P (target))
- error ("type name expected before `*'");
+ cp_error (ec_type_name_expected_before_star);
target = build_parse_node (INDIRECT_REF, target);
TREE_TYPE (target) = cv_qualifiers;
return target;
@@ -208,16 +208,16 @@ make_reference_declarator (cv_qualifiers, target)
{
if (TREE_CODE (target) == ADDR_EXPR)
{
- error ("cannot declare references to references");
+ cp_error (ec_cannot_declare_references_to_references);
return target;
}
if (TREE_CODE (target) == INDIRECT_REF)
{
- error ("cannot declare pointers to references");
+ cp_error (ec_cannot_declare_pointers_to_references);
return target;
}
if (TREE_CODE (target) == IDENTIFIER_NODE && ANON_AGGRNAME_P (target))
- error ("type name expected before `&'");
+ cp_error (ec_type_name_expected_before_amp);
}
target = build_parse_node (ADDR_EXPR, target);
TREE_TYPE (target) = cv_qualifiers;
@@ -1082,7 +1082,7 @@ set_yydebug (value)
extern int yydebug;
yydebug = value;
#else
- warning ("YYDEBUG not defined.");
+ cp_warning (ec_yydebug_not_defined);
#endif
}
@@ -1293,7 +1293,7 @@ process_next_inline (t)
yychar = yylex ();
if (yychar != END_OF_SAVED_INPUT)
{
- error ("parse error at end of saved function text");
+ cp_error (ec_parse_error_at_end_of_saved_function_text);
/* restore_pending_input will abort unless yychar is either
END_OF_SAVED_INPUT or YYEMPTY; since we already know we're
@@ -1350,9 +1350,9 @@ consume_string (this_obstack, matching_char)
int save_lineno = lineno;
lineno = starting_lineno;
if (matching_char == '"')
- error ("end of file encountered inside string constant");
+ cp_error (ec_end_of_file_encountered_inside_string_constant);
else
- error ("end of file encountered inside character constant");
+ cp_error (ec_end_of_file_encountered_inside_character_constant);
lineno = save_lineno;
return;
}
@@ -1369,7 +1369,7 @@ consume_string (this_obstack, matching_char)
if (c == '\n')
{
if (pedantic)
- pedwarn ("ANSI C++ forbids newline in string constant");
+ cp_pedwarn (ec_forbids_newline_in_string_constant);
lineno++;
}
obstack_1grow (this_obstack, c);
@@ -1660,7 +1660,7 @@ reinit_parse_for_block (pyychar, obstackp)
{
if (look_for_lbrac)
{
- error ("function body for constructor missing");
+ cp_error (ec_function_body_for_constructor_missing);
obstack_1grow (obstackp, '{');
obstack_1grow (obstackp, '}');
len += 2;
@@ -1877,7 +1877,7 @@ finish_defarg ()
yychar = yylex ();
if (yychar != END_OF_SAVED_INPUT)
{
- error ("parse error at end of saved function text");
+ cp_error (ec_parse_error_at_end_of_saved_function_text);
/* restore_pending_input will abort unless yychar is either
END_OF_SAVED_INPUT or YYEMPTY; since we already know we're
@@ -2105,10 +2105,10 @@ check_for_missing_semicolon (type)
|| end_of_file)
{
if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (type)))
- error ("semicolon missing after %s declaration",
+ cp_error (ec_semicolon_missing_after_s_declaration,
TREE_CODE (type) == ENUMERAL_TYPE ? "enum" : "struct");
else
- cp_error ("semicolon missing after declaration of `%T'", type);
+ cp_error (ec_semicolon_missing_after_declaration_of, type);
shadow_tag (build_tree_list (0, type));
}
/* Could probably also hack cases where class { ... } f (); appears. */
@@ -2171,7 +2171,7 @@ skip_white_space (c)
if (c == '\n')
lineno++;
else
- error ("stray '\\' in program");
+ cp_error (ec_stray_in_program);
c = getch ();
break;
@@ -2328,7 +2328,7 @@ check_newline ()
an explcit -Wunknown-pragmas has been given. */
if (warn_unknown_pragmas > 1
|| (warn_unknown_pragmas && ! in_system_header))
- warning ("ignoring pragma: %s", token_buffer);
+ cp_warning (ec_ignoring_pragma_s, token_buffer);
}
goto skipline;
@@ -2385,7 +2385,7 @@ check_newline ()
if (token != STRING
|| TREE_CODE (yylval.ttype) != STRING_CST)
{
- error ("invalid #ident");
+ cp_error (ec_invalid_ident);
goto skipline;
}
@@ -2417,7 +2417,7 @@ check_newline ()
goto skipline;
}
}
- error ("undefined or invalid # directive");
+ cp_error (ec_undefined_or_invalid_directive);
goto skipline;
}
@@ -2468,7 +2468,7 @@ linenum:
if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST)
{
- error ("invalid #line");
+ cp_error (ec_invalid_line);
goto skipline;
}
@@ -2610,7 +2610,7 @@ linenum:
if (c_header_level && --c_header_level == 0)
{
if (entering_c_header)
- warning ("badly nested C headers from preprocessor");
+ cp_warning (ec_badly_nested_headers_from_preprocessor);
--pending_lang_change;
}
in_system_header = entering_system_header;
@@ -2622,7 +2622,7 @@ linenum:
debug_end_source_file (input_file_stack->line);
}
else
- error ("#-lines for entering and leaving files don't match");
+ cp_error (ec_lines_for_entering_and_leaving_files_dont_match);
}
else
in_system_header = entering_system_header;
@@ -2633,7 +2633,7 @@ linenum:
c = EOF;
}
else
- error ("invalid #-line");
+ cp_error (ec_invalid_line);
/* skip the rest of this line. */
skipline:
@@ -2698,7 +2698,7 @@ readescape (ignore_ptr)
nonnull = 1;
}
if (! nonnull)
- error ("\\x used with no following hex digits");
+ cp_error (ec_x_used_with_no_following_hex_digits);
else if (count == 0)
/* Digits are all 0's. Ok. */
;
@@ -2706,7 +2706,7 @@ readescape (ignore_ptr)
|| (count > 1
&& ((1 << (TYPE_PRECISION (integer_type_node) - (count - 1) * 4))
<= firstdig)))
- pedwarn ("hex escape out of range");
+ cp_pedwarn (ec_hex_escape_out_of_range);
return code;
case '0': case '1': case '2': case '3': case '4':
@@ -2753,7 +2753,7 @@ readescape (ignore_ptr)
case 'e':
case 'E':
if (pedantic)
- pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
+ cp_pedwarn (ec_nonstandard_escape_sequence_c, c);
return 033;
case '?':
@@ -2766,13 +2766,13 @@ readescape (ignore_ptr)
/* `\%' is used to prevent SCCS from getting confused. */
case '%':
if (pedantic)
- pedwarn ("unknown escape sequence `\\%c'", c);
+ cp_pedwarn (ec_unknown_escape_sequence_c, c);
return c;
}
if (c >= 040 && c < 0177)
- pedwarn ("unknown escape sequence `\\%c'", c);
+ cp_pedwarn (ec_unknown_escape_sequence_c, c);
else
- pedwarn ("unknown escape sequence: `\\' followed by char code 0x%x", c);
+ cp_pedwarn (ec_unknown_escape_sequence_followed_by_char_code_0xx, c);
return c;
}
@@ -2899,7 +2899,7 @@ do_identifier (token, parsing, args)
my_friendly_abort (61);
else
{
- cp_error ("invalid use of member `%D' from base class `%T'", field,
+ cp_error (ec_invalid_use_of_member_from_base_class, field,
DECL_FIELD_CONTEXT (field));
id = error_mark_node;
return id;
@@ -2943,7 +2943,7 @@ do_identifier (token, parsing, args)
else if (IDENTIFIER_OPNAME_P (token))
{
if (token != ansi_opname[ERROR_MARK])
- cp_error ("`%D' not defined", token);
+ cp_error (ec_not_defined, token);
id = error_mark_node;
}
else if (in_call && ! flag_strict_prototype)
@@ -2952,7 +2952,7 @@ do_identifier (token, parsing, args)
}
else if (current_function_decl == 0)
{
- cp_error ("`%D' was not declared in this scope", token);
+ cp_error (ec_was_not_declared_in_this_scope, token);
id = error_mark_node;
}
else
@@ -2962,12 +2962,12 @@ do_identifier (token, parsing, args)
{
static int undeclared_variable_notice;
- cp_error ("`%D' undeclared (first use this function)", token);
+ cp_error (ec_undeclared_first_use_this_function, token);
if (! undeclared_variable_notice)
{
- error ("(Each undeclared identifier is reported only once");
- error ("for each function it appears in.)");
+ cp_error (ec_ach_undeclared_identifier_is_reported_only_once);
+ cp_error (ec_for_each_function_it_appears_in);
undeclared_variable_notice = 1;
}
}
@@ -2990,11 +2990,11 @@ do_identifier (token, parsing, args)
{
if (!DECL_ERROR_REPORTED (id))
{
- warning ("name lookup of `%s' changed",
+ cp_warning (ec_name_lookup_of_s_changed,
IDENTIFIER_POINTER (token));
- cp_warning_at (" matches this `%D' under current ANSI rules",
+ cp_warning_at (ec_matches_this_under_current_rules,
shadowed);
- cp_warning_at (" matches this `%D' under old rules", id);
+ cp_warning_at (ec_matches_this_under_old_rules, id);
DECL_ERROR_REPORTED (id) = 1;
}
id = shadowed;
@@ -3007,13 +3007,13 @@ do_identifier (token, parsing, args)
if (TYPE_NEEDS_DESTRUCTOR (TREE_TYPE (id)))
{
error (msg, IDENTIFIER_POINTER (token));
- cp_error_at (" cannot use obsolete binding at `%D' because it has a destructor", id);
+ cp_error_at (ec_cannot_use_obsolete_binding_at_because_it_has_a_destructor, id);
id = error_mark_node;
}
else
{
pedwarn (msg, IDENTIFIER_POINTER (token));
- cp_pedwarn_at (" using obsolete binding at `%D'", id);
+ cp_pedwarn_at (ec_using_obsolete_binding_at, id);
}
}
}
@@ -3025,7 +3025,7 @@ do_identifier (token, parsing, args)
/* Check access. */
tree access = compute_access (TYPE_BINFO (current_class_type), id);
if (access == access_private_node)
- cp_error ("enum `%D' is private", id);
+ cp_error (ec_enum_is_private, id);
/* protected is OK, since it's an enum of `this'. */
}
if (!processing_template_decl
@@ -3104,7 +3104,7 @@ do_scoped_id (token, parsing)
else
{
if (IDENTIFIER_NAMESPACE_VALUE (token) != error_mark_node)
- cp_error ("`::%D' undeclared (first use here)", token);
+ cp_error (ec_undeclared_first_use_here, token);
id = error_mark_node;
/* Prevent repeated error messages. */
SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node);
@@ -3226,9 +3226,9 @@ real_yylex ()
case '$':
if (! dollars_in_ident)
- error ("`$' in identifier");
+ cp_error (ec_in_identifier);
else if (pedantic)
- pedwarn ("`$' in identifier");
+ cp_pedwarn (ec_in_identifier);
dollar_seen = 1;
goto letter;
@@ -3284,9 +3284,9 @@ real_yylex ()
if (c == '$')
{
if (! dollars_in_ident)
- error ("`$' in identifier");
+ cp_error (ec_in_identifier);
else if (pedantic)
- pedwarn ("`$' in identifier");
+ cp_pedwarn (ec_in_identifier);
}
if (p >= token_buffer + maxtoken)
@@ -3314,9 +3314,9 @@ real_yylex ()
if (c == '$')
{
if (! dollars_in_ident)
- error ("`$' in identifier");
+ cp_error (ec_in_identifier);
else if (pedantic)
- pedwarn ("`$' in identifier");
+ cp_pedwarn (ec_in_identifier);
}
if (p >= token_buffer + maxtoken)
@@ -3366,7 +3366,7 @@ real_yylex ()
obstack. */
if (ptr->rid != RID_EXTERN)
- error ("invalid modifier `%s' for language string",
+ cp_error (ec_invalid_modifier_s_for_language_string,
ptr->name);
real_yylex ();
value = EXTERN_LANG_STRING;
@@ -3465,7 +3465,7 @@ real_yylex ()
|| TEMP_NAME_P (tmp)
|| ANON_AGGRNAME_P (tmp)
|| ANON_PARMNAME_P (tmp)))
- warning ("identifier name `%s' conflicts with GNU C++ internal naming strategy",
+ cp_warning (ec_identifier_name_s_conflicts_with_internal_naming_strategy,
token_buffer);
#endif
@@ -3500,7 +3500,7 @@ real_yylex ()
value = ELLIPSIS;
goto done;
}
- error ("parse error at `..'");
+ cp_error (ec_parse_error_at);
}
if (ISDIGIT (c1))
{
@@ -3589,13 +3589,13 @@ real_yylex ()
if (c == '.')
{
if (base == 16)
- error ("floating constant may not be in radix 16");
+ cp_error (ec_floating_constant_may_not_be_in_radix_16);
if (floatflag == TOO_MANY_POINTS)
/* We have already emitted an error. Don't need another. */
;
else if (floatflag == AFTER_POINT)
{
- error ("malformed floating constant");
+ cp_error (ec_malformed_floating_constant);
floatflag = TOO_MANY_POINTS;
/* Avoid another error from atof by forcing all characters
from here on to be ignored. */
@@ -3622,7 +3622,7 @@ real_yylex ()
value = ELLIPSIS;
goto done;
}
- error ("parse error at `..'");
+ cp_error (ec_parse_error_at);
}
nextchar = c;
token_buffer[1] = '\0';
@@ -3647,7 +3647,7 @@ real_yylex ()
floatflag = AFTER_POINT;
break; /* start of exponent */
}
- error ("nondigits in number and not hexadecimal");
+ cp_error (ec_nondigits_in_number_and_not_hexadecimal);
c = 0;
}
else if (c >= 'a')
@@ -3688,10 +3688,10 @@ real_yylex ()
}
if (numdigits == 0)
- error ("numeric constant with no digits");
+ cp_error (ec_numeric_constant_with_no_digits);
if (largest_digit >= base)
- error ("numeric constant contains digits beyond the radix");
+ cp_error (ec_numeric_constant_contains_digits_beyond_the_radix);
/* Remove terminating char from the token buffer and delimit the string */
*--p = 0;
@@ -3718,7 +3718,7 @@ real_yylex ()
c = getch ();
}
if (! ISDIGIT (c))
- error ("floating constant exponent has no digits");
+ cp_error (ec_floating_constant_exponent_has_no_digits);
while (ISDIGIT (c))
{
if (p >= token_buffer + maxtoken - 3)
@@ -3734,7 +3734,7 @@ real_yylex ()
/* Convert string to a double, checking for overflow. */
if (setjmp (handler))
{
- error ("floating constant out of range");
+ cp_error (ec_floating_constant_out_of_range);
value = dconst0;
}
else
@@ -3757,21 +3757,21 @@ real_yylex ()
{
case 'f': case 'F':
if (fflag)
- error ("more than one `f' in numeric constant");
+ cp_error (ec_more_than_one_f_in_numeric_constant);
fflag = 1;
break;
case 'l': case 'L':
if (lflag)
- error ("more than one `l' in numeric constant");
+ cp_error (ec_more_than_one_l_in_numeric_constant);
lflag = 1;
break;
case 'i': case 'I':
if (imag)
- error ("more than one `i' or `j' in numeric constant");
+ cp_error (ec_more_than_one_i_or_j_in_numeric_constant);
else if (pedantic)
- pedwarn ("ANSI C++ forbids imaginary numeric constants");
+ cp_pedwarn (ec_forbids_imaginary_numeric_constants);
imag = 1;
break;
@@ -3796,7 +3796,7 @@ real_yylex ()
if (fflag)
{
if (lflag)
- error ("both `f' and `l' in floating constant");
+ cp_error (ec_both_f_and_l_in_floating_constant);
type = float_type_node;
value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
@@ -3804,20 +3804,20 @@ real_yylex ()
This is not pedwarn, become some people don't want
an error for this. */
if (REAL_VALUE_ISINF (value) && pedantic)
- warning ("floating point number exceeds range of `float'");
+ cp_warning (ec_floating_point_number_exceeds_range_of_float);
}
else if (lflag)
{
type = long_double_type_node;
value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
if (REAL_VALUE_ISINF (value) && pedantic)
- warning ("floating point number exceeds range of `long double'");
+ cp_warning (ec_floating_point_number_exceeds_range_of_long_double);
}
else
{
value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
if (REAL_VALUE_ISINF (value) && pedantic)
- warning ("floating point number exceeds range of `double'");
+ cp_warning (ec_floating_point_number_exceeds_range_of_double);
}
set_float_handler (NULL_PTR);
@@ -3830,7 +3830,7 @@ real_yylex ()
if (REAL_VALUES_LESS (dconst1, value)
|| REAL_VALUES_LESS (value, dconstm1))
{
- pedwarn ("floating point number exceeds range of `%s'",
+ cp_pedwarn (ec_floating_point_number_exceeds_range_of_s,
IDENTIFIER_POINTER (TYPE_IDENTIFIER (type)));
exceeds_double = 1;
}
@@ -3866,7 +3866,7 @@ real_yylex ()
if (c == 'u' || c == 'U')
{
if (spec_unsigned)
- error ("two `u's in integer constant");
+ cp_error (ec_two_us_in_integer_constant);
spec_unsigned = 1;
}
else if (c == 'l' || c == 'L')
@@ -3874,9 +3874,9 @@ real_yylex ()
if (spec_long)
{
if (spec_long_long)
- error ("three `l's in integer constant");
+ cp_error (ec_three_ls_in_integer_constant);
else if (pedantic && ! in_system_header && warn_long_long)
- pedwarn ("ANSI C++ forbids long long integer constants");
+ cp_pedwarn (ec_forbids_long_long_integer_constants);
spec_long_long = 1;
}
spec_long = 1;
@@ -3884,9 +3884,9 @@ real_yylex ()
else if (c == 'i' || c == 'j' || c == 'I' || c == 'J')
{
if (spec_imag)
- error ("more than one `i' or `j' in numeric constant");
+ cp_error (ec_more_than_one_i_or_j_in_numeric_constant);
else if (pedantic)
- pedwarn ("ANSI C++ forbids imaginary numeric constants");
+ cp_pedwarn (ec_forbids_imaginary_numeric_constants);
spec_imag = 1;
}
else
@@ -3917,7 +3917,7 @@ real_yylex ()
if (parts[i])
warn = 1;
if (warn)
- pedwarn ("integer constant out of range");
+ cp_pedwarn (ec_integer_constant_out_of_range);
/* This is simplified by the fact that our constant
is always positive. */
@@ -3958,10 +3958,10 @@ real_yylex ()
type = long_long_unsigned_type_node;
if (!int_fits_type_p (yylval.ttype, type) && !warn)
- pedwarn ("integer constant out of range");
+ cp_pedwarn (ec_integer_constant_out_of_range);
if (base == 10 && ! spec_unsigned && TREE_UNSIGNED (type))
- warning ("decimal integer constant is so large that it is unsigned");
+ cp_warning (ec_decimal_integer_constant_is_so_large_that_it_is_unsigned);
if (spec_imag)
{
@@ -3972,7 +3972,7 @@ real_yylex ()
cp_convert (integer_type_node,
yylval.ttype));
else
- error ("complex integer constant is too wide for `__complex int'");
+ cp_error (ec_complex_integer_constant_is_too_wide_for_complex_int);
}
else
TREE_TYPE (yylval.ttype) = type;
@@ -4018,7 +4018,7 @@ real_yylex ()
goto tryagain;
if (width < HOST_BITS_PER_INT
&& (unsigned) c >= (1 << width))
- pedwarn ("escape sequence out of range for character");
+ cp_pedwarn (ec_escape_sequence_out_of_range_for_character);
#ifdef MAP_CHARACTER
if (ISPRINT (c))
c = MAP_CHARACTER (c);
@@ -4027,7 +4027,7 @@ real_yylex ()
else if (c == '\n')
{
if (pedantic)
- pedwarn ("ANSI C forbids newline in character constant");
+ cp_pedwarn (ec_forbids_newline_in_character_constant);
lineno++;
}
else
@@ -4076,7 +4076,7 @@ real_yylex ()
else
{
if (char_len == -1)
- warning ("Ignoring invalid multibyte character");
+ cp_warning (ec_gnoring_invalid_multibyte_character);
if (wide_flag)
c = wc;
#ifdef MAP_CHARACTER
@@ -4110,16 +4110,16 @@ real_yylex ()
}
if (c != '\'')
- error ("malformatted character constant");
+ cp_error (ec_malformatted_character_constant);
else if (chars_seen == 0)
- error ("empty character constant");
+ cp_error (ec_empty_character_constant);
else if (num_chars > max_chars)
{
num_chars = max_chars;
- error ("character constant too long");
+ cp_error (ec_character_constant_too_long);
}
else if (chars_seen != 1 && warn_multichar)
- warning ("multi-character character constant");
+ cp_warning (ec_multicharacter_character_constant);
/* If char type is signed, sign-extend the constant. */
if (! wide_flag)
@@ -4179,12 +4179,12 @@ real_yylex ()
goto skipnewline;
if (width < HOST_BITS_PER_INT
&& (unsigned) c >= (1 << width))
- warning ("escape sequence out of range for character");
+ cp_warning (ec_escape_sequence_out_of_range_for_character);
}
else if (c == '\n')
{
if (pedantic)
- pedwarn ("ANSI C++ forbids newline in string constant");
+ cp_pedwarn (ec_forbids_newline_in_string_constant);
lineno++;
}
else
@@ -4205,7 +4205,7 @@ real_yylex ()
c = getch ();
}
if (char_len == -1)
- warning ("Ignoring invalid multibyte character");
+ cp_warning (ec_gnoring_invalid_multibyte_character);
else
{
/* mbtowc sometimes needs an extra char before accepting */
@@ -4259,7 +4259,7 @@ real_yylex ()
skipnewline:
c = getch ();
if (c == EOF) {
- error ("Unterminated string");
+ cp_error (ec_nterminated_string);
break;
}
}
@@ -4408,7 +4408,7 @@ real_yylex ()
nextchar = c1;
}
if (pedantic)
- pedwarn ("use of `operator %s' is not standard C++",
+ cp_pedwarn (ec_use_of_operator_s_is_not_standard,
token_buffer);
goto done;
}
@@ -4772,13 +4772,13 @@ handle_cp_pragma (pname)
token = real_yylex ();
if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST)
{
- error ("invalid #pragma vtable");
+ cp_error (ec_invalid_pragma_vtable);
return -1;
}
if (write_virtuals != 2)
{
- warning ("use `+e2' option to enable #pragma vtable");
+ cp_warning (ec_use_e2_option_to_enable_pragma_vtable);
return -1;
}
pending_vtables
@@ -4787,7 +4787,7 @@ handle_cp_pragma (pname)
pending_vtables);
token = real_yylex ();
if (token != END_OF_LINE)
- warning ("trailing characters ignored");
+ cp_warning (ec_trailing_characters_ignored);
return 1;
}
else if (! strcmp (pname, "unit"))
@@ -4796,12 +4796,12 @@ handle_cp_pragma (pname)
token = real_yylex ();
if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST)
{
- error ("invalid #pragma unit");
+ cp_error (ec_invalid_pragma_unit);
return -1;
}
token = real_yylex ();
if (token != END_OF_LINE)
- warning ("trailing characters ignored");
+ cp_warning (ec_trailing_characters_ignored);
return 1;
}
else if (! strcmp (pname, "interface"))
@@ -4818,7 +4818,7 @@ handle_cp_pragma (pname)
if (token != STRING
|| TREE_CODE (yylval.ttype) != STRING_CST)
{
- error ("invalid `#pragma interface'");
+ cp_error (ec_invalid_pragma_interface);
return -1;
}
main_filename = TREE_STRING_POINTER (yylval.ttype);
@@ -4826,7 +4826,7 @@ handle_cp_pragma (pname)
}
if (token != END_OF_LINE)
- warning ("garbage after `#pragma interface' ignored");
+ cp_warning (ec_garbage_after_pragma_interface_ignored);
#ifndef NO_LINKAGE_HEURISTICS
write_virtuals = 3;
@@ -4871,7 +4871,7 @@ handle_cp_pragma (pname)
if (token != STRING
|| TREE_CODE (yylval.ttype) != STRING_CST)
{
- error ("invalid `#pragma implementation'");
+ cp_error (ec_invalid_pragma_implementation);
return -1;
}
main_filename = TREE_STRING_POINTER (yylval.ttype);
@@ -4879,7 +4879,7 @@ handle_cp_pragma (pname)
}
if (token != END_OF_LINE)
- warning ("garbage after `#pragma implementation' ignored");
+ cp_warning (ec_garbage_after_pragma_implementation_ignored);
#ifndef NO_LINKAGE_HEURISTICS
if (write_virtuals == 3)
@@ -4912,7 +4912,7 @@ handle_cp_pragma (pname)
}
}
else
- error ("`#pragma implementation' can only appear at top-level");
+ cp_error (ec_pragma_implementation_can_only_appear_at_toplevel);
interface_only = 0;
#if 1
/* We make this non-zero so that we infer decl linkage
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 0b7260c..00261a1 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -679,7 +679,7 @@ build_overload_value (type, value, in_template)
REAL_VALUE_TYPE val;
char *bufp = digit_buffer;
- pedwarn ("ANSI C++ forbids floating-point template arguments");
+ cp_pedwarn (ec_forbids_floatingpoint_template_arguments);
my_friendly_assert (TREE_CODE (value) == REAL_CST, 244);
val = TREE_REAL_CST (value);
@@ -1814,12 +1814,12 @@ hack_identifier (value, name)
#ifdef DEAD
if (DECL_CHAIN (fndecl) == NULL_TREE)
{
- warning ("methods cannot be converted to function pointers");
+ cp_warning (ec_methods_cannot_be_converted_to_function_pointers);
return fndecl;
}
else
{
- error ("ambiguous request for method pointer `%s'",
+ cp_error (ec_ambiguous_request_for_method_pointer_s,
IDENTIFIER_POINTER (name));
return error_mark_node;
}
@@ -1840,13 +1840,13 @@ hack_identifier (value, name)
{
if (current_function_decl
&& DECL_STATIC_FUNCTION_P (current_function_decl))
- cp_error ("invalid use of member `%D' in static member function",
+ cp_error (ec_invalid_use_of_member_in_static_member_function,
value);
else
/* We can get here when processing a bad default
argument, like:
struct S { int a; void f(int i = a); } */
- cp_error ("invalid use of member `%D'", value);
+ cp_error (ec_invalid_use_of_member, value);
return error_mark_node;
}
@@ -1887,12 +1887,12 @@ hack_identifier (value, name)
}
else if (TREE_CODE (value) == NAMESPACE_DECL)
{
- cp_error ("use of namespace `%D' as expression", value);
+ cp_error (ec_use_of_namespace_as_expression, value);
return error_mark_node;
}
else if (DECL_CLASS_TEMPLATE_P (value))
{
- cp_error ("use of class template `%T' as expression", value);
+ cp_error (ec_use_of_class_template_as_expression, value);
return error_mark_node;
}
else
@@ -1904,10 +1904,10 @@ hack_identifier (value, name)
if (context != NULL_TREE && context != current_function_decl
&& ! TREE_STATIC (value))
{
- cp_error ("use of %s from containing function",
+ cp_error (ec_use_of_s_from_containing_function,
(TREE_CODE (value) == VAR_DECL
? "`auto' variable" : "parameter"));
- cp_error_at (" `%#D' declared here", value);
+ cp_error_at (ec_declared_here, value);
value = error_mark_node;
}
}
@@ -1930,12 +1930,12 @@ hack_identifier (value, name)
if (access != access_public_node)
{
if (TREE_CODE (value) == VAR_DECL)
- error ("static member `%s' is %s",
+ cp_error (ec_static_member_s_is_s,
IDENTIFIER_POINTER (name),
TREE_PRIVATE (value) ? "private"
: "from a private base class");
else
- error ("enum `%s' is from private base class",
+ cp_error (ec_enum_s_is_from_private_base_class,
IDENTIFIER_POINTER (name));
return error_mark_node;
}
@@ -1946,7 +1946,7 @@ hack_identifier (value, name)
{
if (type == 0)
{
- error ("request for member `%s' is ambiguous in multiple inheritance lattice",
+ cp_error (ec_request_for_member_s_is_ambiguous_in_multiple_inheritance_lattice,
IDENTIFIER_POINTER (name));
return error_mark_node;
}
@@ -1992,7 +1992,7 @@ make_thunk (function, delta)
thunk = IDENTIFIER_GLOBAL_VALUE (thunk_id);
if (thunk && TREE_CODE (thunk) != THUNK_DECL)
{
- cp_error ("implementation-reserved name `%D' used", thunk_id);
+ cp_error (ec_implementationreserved_name_used, thunk_id);
thunk = NULL_TREE;
SET_IDENTIFIER_GLOBAL_VALUE (thunk_id, thunk);
}
@@ -2061,7 +2061,7 @@ emit_thunk (thunk_fndecl)
tree a, t;
if (varargs_function_p (function))
- cp_error ("generic thunk code fails for method `%#D' which uses `...'",
+ cp_error (ec_generic_thunk_code_fails_for_method_which_uses,
function);
/* Set up clone argument trees for the thunk. */
@@ -2173,7 +2173,7 @@ do_build_copy_constructor (fndecl)
p = convert_from_reference (p);
if (p == error_mark_node)
- cp_error ("in default copy constructor");
+ cp_error (ec_in_default_copy_constructor);
else
current_base_init_list = tree_cons (basetype,
p, current_base_init_list);
@@ -2191,7 +2191,7 @@ do_build_copy_constructor (fndecl)
CONV_IMPLICIT|CONV_CONST, LOOKUP_COMPLAIN, NULL_TREE);
if (p == error_mark_node)
- cp_error ("in default copy constructor");
+ cp_error (ec_in_default_copy_constructor);
else
{
p = convert_from_reference (p);
@@ -2299,17 +2299,17 @@ do_build_assign_ref (fndecl)
if (TREE_READONLY (field))
{
if (DECL_NAME (field))
- cp_error ("non-static const member `%#D', can't use default assignment operator", field);
+ cp_error (ec_nonstatic_const_member_cant_use_default_assignment_operator, field);
else
- cp_error ("non-static const member in type `%T', can't use default assignment operator", current_class_type);
+ cp_error (ec_nonstatic_const_member_in_type_cant_use_default_assignment_operator, current_class_type);
continue;
}
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE)
{
if (DECL_NAME (field))
- cp_error ("non-static reference member `%#D', can't use default assignment operator", field);
+ cp_error (ec_nonstatic_reference_member_cant_use_default_assignment_operator, field);
else
- cp_error ("non-static reference member in type `%T', can't use default assignment operator", current_class_type);
+ cp_error (ec_nonstatic_reference_member_in_type_cant_use_default_assignment_operator, current_class_type);
continue;
}
diff --git a/gcc/cp/parse.c b/gcc/cp/parse.c
index c73312c..811e245 100644
--- a/gcc/cp/parse.c
+++ b/gcc/cp/parse.c
@@ -644,89 +644,89 @@ static const short yyrline[] = { 0,
373, 377, 380, 384, 387, 389, 391, 394, 396, 399,
402, 404, 406, 408, 410, 411, 413, 414, 418, 421,
430, 433, 435, 439, 442, 444, 448, 451, 463, 470,
- 478, 480, 481, 483, 487, 490, 496, 499, 501, 506,
- 509, 513, 516, 519, 522, 526, 531, 541, 543, 545,
- 547, 549, 562, 565, 569, 572, 574, 576, 579, 582,
- 586, 588, 590, 592, 597, 599, 601, 603, 605, 606,
- 613, 614, 615, 618, 621, 625, 627, 628, 631, 633,
- 636, 639, 641, 645, 648, 650, 654, 656, 658, 662,
- 664, 666, 670, 672, 674, 680, 684, 687, 690, 693,
- 698, 701, 703, 705, 711, 721, 723, 726, 729, 731,
- 734, 738, 747, 750, 752, 756, 769, 789, 792, 794,
- 795, 798, 805, 811, 813, 815, 817, 819, 822, 827,
- 829, 830, 831, 832, 835, 837, 838, 841, 843, 844,
- 847, 852, 852, 856, 856, 859, 859, 862, 862, 866,
- 866, 871, 871, 874, 874, 877, 879, 882, 889, 893,
- 896, 899, 905, 914, 916, 924, 927, 930, 933, 937,
- 940, 942, 945, 948, 950, 952, 954, 958, 961, 964,
- 969, 973, 978, 982, 985, 986, 990, 1009, 1016, 1019,
- 1021, 1022, 1023, 1026, 1030, 1031, 1035, 1039, 1042, 1044,
- 1048, 1051, 1054, 1058, 1061, 1063, 1065, 1067, 1070, 1074,
- 1076, 1078, 1080, 1086, 1089, 1092, 1095, 1107, 1112, 1116,
- 1120, 1125, 1127, 1131, 1135, 1137, 1146, 1150, 1153, 1156,
- 1161, 1164, 1166, 1174, 1187, 1192, 1198, 1200, 1202, 1215,
- 1218, 1220, 1222, 1224, 1226, 1228, 1230, 1232, 1234, 1236,
- 1238, 1240, 1242, 1244, 1246, 1248, 1250, 1252, 1254, 1256,
- 1258, 1262, 1264, 1266, 1283, 1286, 1288, 1289, 1290, 1291,
- 1292, 1295, 1298, 1301, 1305, 1308, 1310, 1315, 1317, 1318,
- 1321, 1323, 1325, 1327, 1331, 1334, 1338, 1342, 1343, 1344,
- 1348, 1356, 1357, 1358, 1372, 1374, 1377, 1379, 1390, 1395,
- 1397, 1399, 1401, 1403, 1405, 1407, 1410, 1412, 1456, 1457,
- 1461, 1465, 1469, 1473, 1475, 1479, 1481, 1483, 1491, 1493,
- 1495, 1497, 1501, 1503, 1505, 1507, 1512, 1514, 1516, 1518,
- 1521, 1523, 1525, 1569, 1572, 1576, 1579, 1583, 1586, 1591,
- 1593, 1597, 1610, 1613, 1620, 1627, 1632, 1634, 1639, 1641,
- 1648, 1650, 1654, 1658, 1664, 1668, 1671, 1674, 1677, 1687,
- 1689, 1692, 1696, 1699, 1702, 1705, 1708, 1714, 1720, 1722,
- 1727, 1729, 1738, 1741, 1743, 1746, 1752, 1754, 1764, 1768,
- 1771, 1774, 1779, 1782, 1790, 1792, 1794, 1796, 1799, 1802,
- 1817, 1836, 1839, 1841, 1844, 1846, 1849, 1851, 1854, 1856,
- 1859, 1862, 1866, 1872, 1873, 1885, 1892, 1895, 1901, 1905,
- 1910, 1916, 1917, 1925, 1928, 1932, 1935, 1939, 1944, 1947,
- 1951, 1954, 1956, 1958, 1960, 1967, 1969, 1970, 1971, 1975,
- 1978, 1982, 1985, 1991, 1993, 1996, 1999, 2002, 2008, 2011,
- 2014, 2016, 2018, 2022, 2028, 2036, 2038, 2042, 2044, 2049,
- 2052, 2055, 2057, 2059, 2063, 2068, 2075, 2079, 2083, 2090,
- 2094, 2097, 2100, 2106, 2118, 2120, 2123, 2143, 2145, 2148,
- 2150, 2155, 2157, 2159, 2161, 2163, 2165, 2169, 2174, 2177,
- 2179, 2183, 2189, 2194, 2199, 2201, 2205, 2210, 2213, 2220,
- 2237, 2243, 2245, 2248, 2251, 2253, 2257, 2259, 2263, 2268,
- 2274, 2277, 2278, 2299, 2322, 2324, 2328, 2339, 2353, 2358,
- 2365, 2368, 2376, 2387, 2396, 2400, 2415, 2418, 2423, 2425,
- 2427, 2429, 2431, 2433, 2436, 2438, 2442, 2448, 2450, 2453,
- 2456, 2458, 2469, 2474, 2477, 2482, 2485, 2486, 2497, 2500,
- 2501, 2512, 2514, 2517, 2519, 2522, 2529, 2537, 2544, 2550,
- 2556, 2564, 2568, 2573, 2577, 2580, 2589, 2591, 2595, 2598,
- 2603, 2607, 2613, 2624, 2627, 2631, 2635, 2643, 2648, 2654,
- 2657, 2659, 2661, 2667, 2670, 2672, 2674, 2676, 2680, 2683,
- 2701, 2711, 2713, 2714, 2718, 2723, 2726, 2728, 2730, 2732,
- 2736, 2742, 2745, 2747, 2749, 2751, 2755, 2758, 2761, 2763,
- 2765, 2767, 2771, 2774, 2777, 2779, 2781, 2783, 2785, 2792,
- 2796, 2801, 2805, 2810, 2812, 2816, 2819, 2821, 2824, 2826,
- 2827, 2830, 2832, 2834, 2840, 2855, 2861, 2867, 2881, 2883,
- 2887, 2901, 2903, 2905, 2909, 2915, 2928, 2930, 2934, 2947,
- 2953, 2955, 2956, 2957, 2965, 2970, 2979, 2980, 2984, 2987,
- 2993, 2999, 3002, 3004, 3006, 3008, 3012, 3016, 3020, 3023,
- 3028, 3031, 3033, 3035, 3037, 3039, 3041, 3043, 3045, 3049,
- 3053, 3057, 3061, 3062, 3064, 3066, 3068, 3070, 3072, 3074,
- 3076, 3078, 3086, 3088, 3089, 3090, 3093, 3099, 3101, 3106,
- 3108, 3111, 3125, 3128, 3131, 3135, 3138, 3145, 3147, 3150,
- 3152, 3154, 3157, 3160, 3163, 3166, 3168, 3171, 3175, 3177,
- 3183, 3185, 3186, 3188, 3193, 3195, 3197, 3199, 3201, 3204,
- 3205, 3207, 3210, 3211, 3214, 3214, 3217, 3217, 3220, 3220,
- 3222, 3224, 3226, 3228, 3234, 3240, 3243, 3246, 3252, 3254,
- 3256, 3260, 3262, 3263, 3264, 3266, 3269, 3276, 3281, 3289,
- 3293, 3295, 3298, 3300, 3303, 3307, 3309, 3312, 3314, 3317,
- 3334, 3340, 3348, 3350, 3352, 3356, 3359, 3360, 3368, 3372,
- 3376, 3379, 3380, 3386, 3389, 3392, 3394, 3398, 3403, 3406,
- 3416, 3421, 3422, 3429, 3432, 3435, 3437, 3440, 3442, 3452,
- 3466, 3470, 3473, 3475, 3479, 3483, 3486, 3489, 3491, 3495,
- 3497, 3504, 3511, 3514, 3517, 3521, 3525, 3531, 3535, 3540,
- 3542, 3545, 3550, 3556, 3567, 3570, 3572, 3576, 3581, 3583,
- 3590, 3593, 3595, 3597, 3603, 3608, 3611, 3613, 3615, 3617,
- 3619, 3621, 3623, 3625, 3627, 3629, 3631, 3633, 3635, 3637,
- 3639, 3641, 3643, 3645, 3647, 3649, 3651, 3653, 3655, 3657,
- 3659, 3661, 3663, 3665, 3667, 3669, 3671, 3673, 3676, 3678
+ 478, 480, 481, 483, 487, 490, 497, 500, 502, 507,
+ 510, 514, 517, 520, 523, 527, 532, 542, 544, 546,
+ 548, 550, 563, 566, 570, 573, 575, 577, 580, 583,
+ 587, 589, 591, 593, 598, 600, 602, 604, 606, 607,
+ 614, 615, 616, 619, 622, 626, 628, 629, 632, 634,
+ 637, 640, 642, 646, 649, 651, 655, 657, 659, 663,
+ 665, 667, 671, 673, 675, 681, 685, 688, 691, 694,
+ 699, 702, 704, 706, 712, 722, 724, 727, 730, 732,
+ 735, 739, 748, 751, 753, 757, 770, 790, 793, 795,
+ 796, 799, 806, 812, 814, 816, 818, 820, 823, 828,
+ 830, 831, 832, 833, 836, 838, 839, 842, 844, 845,
+ 848, 853, 853, 857, 857, 860, 860, 863, 863, 867,
+ 867, 872, 872, 875, 875, 878, 880, 883, 890, 894,
+ 897, 900, 906, 915, 917, 925, 928, 931, 934, 938,
+ 941, 943, 946, 949, 951, 953, 955, 959, 962, 965,
+ 970, 974, 979, 983, 986, 987, 991, 1010, 1017, 1020,
+ 1022, 1023, 1024, 1027, 1031, 1032, 1036, 1040, 1043, 1045,
+ 1049, 1052, 1055, 1059, 1062, 1064, 1066, 1068, 1071, 1075,
+ 1077, 1079, 1081, 1087, 1090, 1093, 1096, 1108, 1113, 1117,
+ 1121, 1126, 1128, 1132, 1136, 1138, 1147, 1151, 1154, 1157,
+ 1162, 1165, 1167, 1175, 1188, 1193, 1199, 1201, 1203, 1216,
+ 1219, 1221, 1223, 1225, 1227, 1229, 1231, 1233, 1235, 1237,
+ 1239, 1241, 1243, 1245, 1247, 1249, 1251, 1253, 1255, 1257,
+ 1259, 1263, 1265, 1267, 1284, 1287, 1289, 1290, 1291, 1292,
+ 1293, 1296, 1299, 1302, 1306, 1309, 1311, 1316, 1318, 1319,
+ 1322, 1324, 1326, 1328, 1332, 1335, 1339, 1343, 1344, 1345,
+ 1349, 1357, 1358, 1359, 1373, 1375, 1378, 1380, 1391, 1396,
+ 1398, 1400, 1402, 1404, 1406, 1408, 1411, 1413, 1457, 1458,
+ 1462, 1466, 1470, 1474, 1476, 1480, 1482, 1484, 1492, 1494,
+ 1496, 1498, 1502, 1504, 1506, 1508, 1513, 1515, 1517, 1519,
+ 1522, 1524, 1526, 1570, 1573, 1577, 1580, 1584, 1587, 1592,
+ 1594, 1598, 1611, 1614, 1621, 1628, 1633, 1635, 1640, 1642,
+ 1649, 1651, 1655, 1659, 1665, 1669, 1672, 1675, 1678, 1688,
+ 1690, 1693, 1697, 1700, 1703, 1706, 1709, 1715, 1721, 1723,
+ 1728, 1730, 1739, 1742, 1744, 1747, 1753, 1755, 1765, 1769,
+ 1772, 1775, 1780, 1783, 1791, 1793, 1795, 1797, 1800, 1803,
+ 1818, 1837, 1840, 1842, 1845, 1847, 1850, 1852, 1855, 1857,
+ 1860, 1863, 1867, 1873, 1874, 1886, 1893, 1896, 1902, 1906,
+ 1911, 1917, 1918, 1926, 1929, 1933, 1936, 1940, 1945, 1948,
+ 1952, 1955, 1957, 1959, 1961, 1968, 1970, 1971, 1972, 1976,
+ 1979, 1983, 1986, 1992, 1994, 1997, 2000, 2003, 2009, 2012,
+ 2015, 2017, 2019, 2023, 2029, 2037, 2039, 2043, 2045, 2050,
+ 2053, 2056, 2058, 2060, 2064, 2069, 2076, 2080, 2084, 2091,
+ 2095, 2098, 2101, 2107, 2119, 2121, 2124, 2144, 2146, 2149,
+ 2151, 2156, 2158, 2160, 2162, 2164, 2166, 2170, 2175, 2178,
+ 2180, 2184, 2190, 2195, 2200, 2202, 2206, 2211, 2214, 2221,
+ 2238, 2244, 2246, 2249, 2252, 2254, 2258, 2260, 2264, 2269,
+ 2275, 2278, 2279, 2300, 2323, 2325, 2329, 2340, 2354, 2359,
+ 2366, 2369, 2377, 2388, 2397, 2401, 2416, 2419, 2424, 2426,
+ 2428, 2430, 2432, 2434, 2437, 2439, 2443, 2449, 2451, 2454,
+ 2457, 2459, 2470, 2475, 2478, 2483, 2486, 2487, 2498, 2501,
+ 2502, 2513, 2515, 2518, 2520, 2523, 2530, 2538, 2545, 2551,
+ 2557, 2565, 2569, 2574, 2578, 2581, 2590, 2592, 2596, 2599,
+ 2604, 2608, 2614, 2625, 2628, 2632, 2636, 2644, 2649, 2655,
+ 2658, 2660, 2662, 2668, 2671, 2673, 2675, 2677, 2681, 2684,
+ 2702, 2712, 2714, 2715, 2719, 2724, 2727, 2729, 2731, 2733,
+ 2737, 2743, 2746, 2748, 2750, 2752, 2756, 2759, 2762, 2764,
+ 2766, 2768, 2772, 2775, 2778, 2780, 2782, 2784, 2786, 2793,
+ 2797, 2802, 2806, 2811, 2813, 2817, 2820, 2822, 2825, 2827,
+ 2828, 2831, 2833, 2835, 2841, 2856, 2862, 2868, 2882, 2884,
+ 2888, 2902, 2904, 2906, 2910, 2916, 2929, 2931, 2935, 2948,
+ 2954, 2956, 2957, 2958, 2966, 2971, 2980, 2981, 2985, 2988,
+ 2994, 3000, 3003, 3005, 3007, 3009, 3013, 3017, 3021, 3024,
+ 3029, 3032, 3034, 3036, 3038, 3040, 3042, 3044, 3046, 3050,
+ 3054, 3058, 3062, 3063, 3065, 3067, 3069, 3071, 3073, 3075,
+ 3077, 3079, 3087, 3089, 3090, 3091, 3094, 3100, 3102, 3107,
+ 3109, 3112, 3126, 3129, 3132, 3136, 3139, 3146, 3148, 3151,
+ 3153, 3155, 3158, 3161, 3164, 3167, 3169, 3172, 3176, 3178,
+ 3184, 3186, 3187, 3189, 3194, 3196, 3198, 3200, 3202, 3205,
+ 3206, 3208, 3211, 3212, 3215, 3215, 3218, 3218, 3221, 3221,
+ 3223, 3225, 3227, 3229, 3235, 3241, 3244, 3247, 3253, 3255,
+ 3257, 3261, 3263, 3264, 3265, 3267, 3270, 3277, 3282, 3290,
+ 3294, 3296, 3299, 3301, 3304, 3308, 3310, 3313, 3315, 3318,
+ 3335, 3341, 3349, 3351, 3353, 3357, 3360, 3361, 3369, 3373,
+ 3377, 3380, 3381, 3387, 3390, 3393, 3395, 3399, 3404, 3407,
+ 3417, 3422, 3423, 3430, 3433, 3436, 3438, 3441, 3443, 3453,
+ 3467, 3471, 3474, 3476, 3480, 3484, 3487, 3490, 3492, 3496,
+ 3498, 3505, 3512, 3515, 3518, 3522, 3526, 3532, 3536, 3541,
+ 3543, 3546, 3551, 3557, 3570, 3573, 3575, 3579, 3584, 3586,
+ 3593, 3596, 3598, 3600, 3606, 3611, 3614, 3616, 3618, 3620,
+ 3622, 3624, 3626, 3628, 3630, 3632, 3634, 3636, 3638, 3640,
+ 3642, 3644, 3646, 3648, 3650, 3652, 3654, 3656, 3658, 3660,
+ 3662, 3664, 3666, 3668, 3670, 3672, 3674, 3676, 3679, 3681
};
#endif
@@ -4270,144 +4270,145 @@ case 45:
case 46:
#line 491 "parse.y"
{ if (current_lang_name != yyvsp[0].ttype)
- cp_error ("use of linkage spec `%D' is different from previous spec `%D'", yyvsp[0].ttype, current_lang_name);
+ cp_error
+ (ec_use_of_linkage_spec_is_different_from_previous_spec, yyvsp[0].ttype, current_lang_name);
pop_lang_context (); push_lang_context (yyvsp[0].ttype); ;
break;}
case 47:
-#line 498 "parse.y"
+#line 499 "parse.y"
{ begin_template_parm_list (); ;
break;}
case 48:
-#line 500 "parse.y"
+#line 501 "parse.y"
{ yyval.ttype = end_template_parm_list (yyvsp[-1].ttype); ;
break;}
case 49:
-#line 502 "parse.y"
+#line 503 "parse.y"
{ begin_specialization();
yyval.ttype = NULL_TREE; ;
break;}
case 50:
-#line 508 "parse.y"
+#line 509 "parse.y"
{ yyval.ttype = process_template_parm (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 51:
-#line 510 "parse.y"
+#line 511 "parse.y"
{ yyval.ttype = process_template_parm (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 52:
-#line 515 "parse.y"
+#line 516 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 53:
-#line 517 "parse.y"
+#line 518 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 54:
-#line 521 "parse.y"
+#line 522 "parse.y"
{ yyval.ttype = finish_template_type_parm (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 55:
-#line 523 "parse.y"
+#line 524 "parse.y"
{ yyval.ttype = finish_template_type_parm (class_type_node, yyvsp[0].ttype); ;
break;}
case 56:
-#line 528 "parse.y"
+#line 529 "parse.y"
{ yyval.ttype = finish_template_template_parm (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 57:
-#line 540 "parse.y"
+#line 541 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 58:
-#line 542 "parse.y"
+#line 543 "parse.y"
{ yyval.ttype = build_tree_list (groktypename (yyvsp[0].ftype.t), yyvsp[-2].ttype); ;
break;}
case 59:
-#line 544 "parse.y"
+#line 545 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;}
case 60:
-#line 546 "parse.y"
+#line 547 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-2].ftype.t); ;
break;}
case 61:
-#line 548 "parse.y"
+#line 549 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 62:
-#line 550 "parse.y"
+#line 551 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) != TEMPLATE_DECL
&& TREE_CODE (yyvsp[0].ttype) != TEMPLATE_TEMPLATE_PARM
&& TREE_CODE (yyvsp[0].ttype) != TYPE_DECL)
{
- error ("invalid default template argument");
+ cp_error (ec_invalid_default_template_argument);
yyvsp[0].ttype = error_mark_node;
}
yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-2].ttype);
;
break;}
case 63:
-#line 564 "parse.y"
+#line 565 "parse.y"
{ finish_template_decl (yyvsp[-1].ttype); ;
break;}
case 64:
-#line 566 "parse.y"
+#line 567 "parse.y"
{ finish_template_decl (yyvsp[-1].ttype); ;
break;}
case 65:
-#line 571 "parse.y"
+#line 572 "parse.y"
{ if (pending_inlines) do_pending_inlines (); ;
break;}
case 66:
-#line 573 "parse.y"
+#line 574 "parse.y"
{ if (pending_inlines) do_pending_inlines (); ;
break;}
case 67:
-#line 575 "parse.y"
+#line 576 "parse.y"
{ if (pending_inlines) do_pending_inlines (); ;
break;}
case 68:
-#line 577 "parse.y"
+#line 578 "parse.y"
{ if (pending_inlines) do_pending_inlines ();
pop_lang_context (); ;
break;}
case 69:
-#line 580 "parse.y"
+#line 581 "parse.y"
{ if (pending_inlines) do_pending_inlines ();
pop_lang_context (); ;
break;}
case 70:
-#line 583 "parse.y"
+#line 584 "parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 72:
-#line 589 "parse.y"
+#line 590 "parse.y"
{;
break;}
case 73:
-#line 591 "parse.y"
+#line 592 "parse.y"
{ note_list_got_semicolon (yyvsp[-2].ftype.t); ;
break;}
case 74:
-#line 593 "parse.y"
+#line 594 "parse.y"
{ maybe_process_partial_specialization (yyvsp[-1].ftype.t);
note_got_semicolon (yyvsp[-1].ftype.t); ;
break;}
case 76:
-#line 600 "parse.y"
+#line 601 "parse.y"
{;
break;}
case 77:
-#line 602 "parse.y"
+#line 603 "parse.y"
{ note_list_got_semicolon (yyvsp[-2].ftype.t); ;
break;}
case 78:
-#line 604 "parse.y"
-{ pedwarn ("empty declaration"); ;
+#line 605 "parse.y"
+{ cp_pedwarn (ec_empty_declaration); ;
break;}
case 80:
-#line 607 "parse.y"
+#line 608 "parse.y"
{
tree t, attrs;
split_specs_attrs (yyvsp[-1].ftype.t, &t, &attrs);
@@ -4416,124 +4417,124 @@ case 80:
;
break;}
case 84:
-#line 620 "parse.y"
+#line 621 "parse.y"
{ yyval.itype = 0; ;
break;}
case 85:
-#line 622 "parse.y"
+#line 623 "parse.y"
{ yyval.itype = 1; ;
break;}
case 91:
-#line 638 "parse.y"
+#line 639 "parse.y"
{ finish_function (lineno, (int)yyvsp[-1].itype, 0); ;
break;}
case 92:
-#line 640 "parse.y"
+#line 641 "parse.y"
{ ;
break;}
case 93:
-#line 642 "parse.y"
+#line 643 "parse.y"
{ ;
break;}
case 94:
-#line 647 "parse.y"
+#line 648 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 95:
-#line 649 "parse.y"
+#line 650 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 96:
-#line 651 "parse.y"
+#line 652 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 97:
-#line 655 "parse.y"
+#line 656 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 98:
-#line 657 "parse.y"
+#line 658 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 99:
-#line 659 "parse.y"
+#line 660 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 100:
-#line 663 "parse.y"
+#line 664 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 101:
-#line 665 "parse.y"
+#line 666 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 102:
-#line 667 "parse.y"
+#line 668 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 103:
-#line 671 "parse.y"
+#line 672 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 104:
-#line 673 "parse.y"
+#line 674 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 105:
-#line 675 "parse.y"
+#line 676 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 106:
-#line 682 "parse.y"
+#line 683 "parse.y"
{ if (!begin_function_definition (yyvsp[-1].ftype.t, yyvsp[0].ttype))
YYERROR1; ;
break;}
case 107:
-#line 685 "parse.y"
+#line 686 "parse.y"
{ if (!begin_function_definition (yyvsp[-1].ttype, yyvsp[0].ttype))
YYERROR1; ;
break;}
case 108:
-#line 688 "parse.y"
+#line 689 "parse.y"
{ if (!begin_function_definition (NULL_TREE, yyvsp[0].ttype))
YYERROR1; ;
break;}
case 109:
-#line 691 "parse.y"
+#line 692 "parse.y"
{ if (!begin_function_definition (yyvsp[-1].ttype, yyvsp[0].ttype))
YYERROR1; ;
break;}
case 110:
-#line 694 "parse.y"
+#line 695 "parse.y"
{ if (!begin_function_definition (NULL_TREE, yyvsp[0].ttype))
YYERROR1; ;
break;}
case 111:
-#line 700 "parse.y"
+#line 701 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-5].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 112:
-#line 702 "parse.y"
+#line 703 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-3].ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 113:
-#line 704 "parse.y"
+#line 705 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-5].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 114:
-#line 706 "parse.y"
+#line 707 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-3].ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 115:
-#line 713 "parse.y"
+#line 714 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ttype = start_method (specs, yyvsp[0].ttype);
rest_of_mdef:
@@ -4544,34 +4545,34 @@ case 115:
reinit_parse_for_method (yychar, yyval.ttype); ;
break;}
case 116:
-#line 722 "parse.y"
+#line 723 "parse.y"
{ yyval.ttype = start_method (NULL_TREE, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
case 117:
-#line 724 "parse.y"
+#line 725 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ttype = start_method (specs, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
case 118:
-#line 727 "parse.y"
+#line 728 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ttype = start_method (specs, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
case 119:
-#line 730 "parse.y"
+#line 731 "parse.y"
{ yyval.ttype = start_method (NULL_TREE, yyval.ttype); goto rest_of_mdef; ;
break;}
case 120:
-#line 732 "parse.y"
+#line 733 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ttype = start_method (specs, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
case 121:
-#line 735 "parse.y"
+#line 736 "parse.y"
{ yyval.ttype = start_method (NULL_TREE, yyval.ttype); goto rest_of_mdef; ;
break;}
case 122:
-#line 740 "parse.y"
+#line 741 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
@@ -4579,22 +4580,22 @@ case 122:
;
break;}
case 123:
-#line 749 "parse.y"
+#line 750 "parse.y"
{ store_return_init (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 124:
-#line 751 "parse.y"
+#line 752 "parse.y"
{ store_return_init (yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 125:
-#line 753 "parse.y"
+#line 754 "parse.y"
{ store_return_init (yyval.ttype, NULL_TREE); ;
break;}
case 126:
-#line 758 "parse.y"
+#line 759 "parse.y"
{
if (yyvsp[0].itype == 0)
- error ("no base initializers given following ':'");
+ cp_error (ec_no_base_initializers_given_following);
setup_vtbl_ptr ();
/* Always keep the BLOCK node associated with the outermost
pair of curley braces of a function. These are needed
@@ -4603,7 +4604,7 @@ case 126:
;
break;}
case 127:
-#line 771 "parse.y"
+#line 772 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
@@ -4616,119 +4617,119 @@ case 127:
expand_start_bindings (0);
}
else if (current_class_type == NULL_TREE)
- error ("base initializers not allowed for non-member functions");
+ cp_error (ec_base_initializers_not_allowed_for_nonmember_functions);
else if (! DECL_CONSTRUCTOR_P (current_function_decl))
- error ("only constructors take base initializers");
+ cp_error (ec_only_constructors_take_base_initializers);
;
break;}
case 128:
-#line 791 "parse.y"
+#line 792 "parse.y"
{ yyval.itype = 0; ;
break;}
case 129:
-#line 793 "parse.y"
+#line 794 "parse.y"
{ yyval.itype = 1; ;
break;}
case 132:
-#line 800 "parse.y"
+#line 801 "parse.y"
{
if (current_class_name)
- pedwarn ("anachronistic old style base class initializer");
+ cp_pedwarn (ec_anachronistic_old_style_base_class_initializer);
expand_member_init (current_class_ref, NULL_TREE, yyvsp[-1].ttype);
;
break;}
case 133:
-#line 806 "parse.y"
+#line 807 "parse.y"
{
if (current_class_name)
- pedwarn ("anachronistic old style base class initializer");
+ cp_pedwarn (ec_anachronistic_old_style_base_class_initializer);
expand_member_init (current_class_ref, NULL_TREE, void_type_node);
;
break;}
case 134:
-#line 812 "parse.y"
+#line 813 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 135:
-#line 814 "parse.y"
+#line 815 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-1].ttype, void_type_node); ;
break;}
case 136:
-#line 816 "parse.y"
+#line 817 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 137:
-#line 818 "parse.y"
+#line 819 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-1].ttype, void_type_node); ;
break;}
case 138:
-#line 820 "parse.y"
+#line 821 "parse.y"
{ expand_member_init (current_class_ref, TYPE_MAIN_DECL (yyvsp[-3].ttype),
yyvsp[-1].ttype); ;
break;}
case 139:
-#line 823 "parse.y"
+#line 824 "parse.y"
{ expand_member_init (current_class_ref, TYPE_MAIN_DECL (yyvsp[-1].ttype),
void_type_node); ;
break;}
case 151:
-#line 849 "parse.y"
+#line 850 "parse.y"
{ do_type_instantiation (yyvsp[-1].ftype.t, NULL_TREE);
yyungetc (';', 1); ;
break;}
case 153:
-#line 853 "parse.y"
+#line 854 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
do_decl_instantiation (specs, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 155:
-#line 857 "parse.y"
+#line 858 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 157:
-#line 860 "parse.y"
+#line 861 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 159:
-#line 863 "parse.y"
+#line 864 "parse.y"
{ do_type_instantiation (yyvsp[-1].ftype.t, yyvsp[-4].ttype);
yyungetc (';', 1); ;
break;}
case 161:
-#line 868 "parse.y"
+#line 869 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
do_decl_instantiation (specs, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
case 163:
-#line 872 "parse.y"
+#line 873 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, yyvsp[-3].ttype); ;
break;}
case 165:
-#line 875 "parse.y"
+#line 876 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, yyvsp[-3].ttype); ;
break;}
case 167:
-#line 880 "parse.y"
+#line 881 "parse.y"
{ begin_explicit_instantiation(); ;
break;}
case 168:
-#line 883 "parse.y"
+#line 884 "parse.y"
{ end_explicit_instantiation(); ;
break;}
case 169:
-#line 892 "parse.y"
+#line 893 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 170:
-#line 895 "parse.y"
+#line 896 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 172:
-#line 902 "parse.y"
+#line 903 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 173:
-#line 906 "parse.y"
+#line 907 "parse.y"
{
if (yychar == YYEMPTY)
yychar = YYLEX;
@@ -4738,96 +4739,96 @@ case 173:
;
break;}
case 175:
-#line 917 "parse.y"
+#line 918 "parse.y"
{
/* Handle `Class<Class<Type>>' without space in the `>>' */
- pedwarn ("`>>' should be `> >' in template class name");
+ cp_pedwarn (ec_should_be_in_template_class_name);
yyungetc ('>', 1);
;
break;}
case 176:
-#line 926 "parse.y"
+#line 927 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 178:
-#line 932 "parse.y"
+#line 933 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyval.ttype); ;
break;}
case 179:
-#line 934 "parse.y"
+#line 935 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 180:
-#line 939 "parse.y"
+#line 940 "parse.y"
{ yyval.ttype = groktypename (yyvsp[0].ftype.t); ;
break;}
case 181:
-#line 941 "parse.y"
+#line 942 "parse.y"
{ yyval.ttype = lastiddecl; ;
break;}
case 183:
-#line 947 "parse.y"
+#line 948 "parse.y"
{ yyval.code = NEGATE_EXPR; ;
break;}
case 184:
-#line 949 "parse.y"
+#line 950 "parse.y"
{ yyval.code = CONVERT_EXPR; ;
break;}
case 185:
-#line 951 "parse.y"
+#line 952 "parse.y"
{ yyval.code = PREINCREMENT_EXPR; ;
break;}
case 186:
-#line 953 "parse.y"
+#line 954 "parse.y"
{ yyval.code = PREDECREMENT_EXPR; ;
break;}
case 187:
-#line 955 "parse.y"
+#line 956 "parse.y"
{ yyval.code = TRUTH_NOT_EXPR; ;
break;}
case 188:
-#line 960 "parse.y"
+#line 961 "parse.y"
{ yyval.ttype = build_x_compound_expr (yyval.ttype); ;
break;}
case 190:
-#line 966 "parse.y"
-{ error ("ANSI C++ forbids an empty condition for `%s'",
+#line 967 "parse.y"
+{ cp_error (ec_forbids_an_empty_condition_for_s,
cond_stmt_keyword);
yyval.ttype = integer_zero_node; ;
break;}
case 191:
-#line 970 "parse.y"
+#line 971 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 192:
-#line 975 "parse.y"
-{ error ("ANSI C++ forbids an empty condition for `%s'",
+#line 976 "parse.y"
+{ cp_error (ec_forbids_an_empty_condition_for_s,
cond_stmt_keyword);
yyval.ttype = integer_zero_node; ;
break;}
case 193:
-#line 979 "parse.y"
+#line 980 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 194:
-#line 984 "parse.y"
+#line 985 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 196:
-#line 987 "parse.y"
+#line 988 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 197:
-#line 992 "parse.y"
+#line 993 "parse.y"
{ {
tree d;
for (d = getdecls (); d; d = TREE_CHAIN (d))
if (TREE_CODE (d) == TYPE_DECL) {
tree s = TREE_TYPE (d);
if (TREE_CODE (s) == RECORD_TYPE)
- cp_error ("definition of class `%T' in condition", s);
+ cp_error (ec_definition_of_class_in_condition, s);
else if (TREE_CODE (s) == ENUMERAL_TYPE)
- cp_error ("definition of enum `%T' in condition", s);
+ cp_error (ec_definition_of_enum_in_condition, s);
}
}
current_declspecs = yyvsp[-4].ftype.t;
@@ -4837,195 +4838,195 @@ case 197:
;
break;}
case 198:
-#line 1009 "parse.y"
+#line 1010 "parse.y"
{
cp_finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-3].ttype, 1, LOOKUP_ONLYCONVERTING);
resume_momentary (yyvsp[-2].itype);
yyval.ttype = yyvsp[-1].ttype;
if (TREE_CODE (TREE_TYPE (yyval.ttype)) == ARRAY_TYPE)
- cp_error ("definition of array `%#D' in condition", yyval.ttype);
+ cp_error (ec_definition_of_array_in_condition, yyval.ttype);
;
break;}
case 204:
-#line 1028 "parse.y"
+#line 1029 "parse.y"
{ yyval.ttype = begin_compound_stmt (1); ;
break;}
case 205:
-#line 1030 "parse.y"
+#line 1031 "parse.y"
{ finish_compound_stmt (1, yyvsp[-1].ttype); ;
break;}
case 207:
-#line 1037 "parse.y"
+#line 1038 "parse.y"
{ yyval.ttype = expr_tree_cons (NULL_TREE, yyval.ttype,
build_expr_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 208:
-#line 1040 "parse.y"
+#line 1041 "parse.y"
{ yyval.ttype = expr_tree_cons (NULL_TREE, yyval.ttype,
build_expr_list (NULL_TREE, error_mark_node)); ;
break;}
case 209:
-#line 1043 "parse.y"
+#line 1044 "parse.y"
{ chainon (yyval.ttype, build_expr_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 210:
-#line 1045 "parse.y"
+#line 1046 "parse.y"
{ chainon (yyval.ttype, build_expr_list (NULL_TREE, error_mark_node)); ;
break;}
case 211:
-#line 1050 "parse.y"
+#line 1051 "parse.y"
{ yyval.ttype = build_expr_list (NULL_TREE, yyval.ttype); ;
break;}
case 213:
-#line 1056 "parse.y"
+#line 1057 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 214:
-#line 1059 "parse.y"
+#line 1060 "parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 215:
-#line 1062 "parse.y"
+#line 1063 "parse.y"
{ yyval.ttype = build_x_indirect_ref (yyvsp[0].ttype, "unary *"); ;
break;}
case 216:
-#line 1064 "parse.y"
+#line 1065 "parse.y"
{ yyval.ttype = build_x_unary_op (ADDR_EXPR, yyvsp[0].ttype); ;
break;}
case 217:
-#line 1066 "parse.y"
+#line 1067 "parse.y"
{ yyval.ttype = build_x_unary_op (BIT_NOT_EXPR, yyvsp[0].ttype); ;
break;}
case 218:
-#line 1068 "parse.y"
+#line 1069 "parse.y"
{ yyval.ttype = finish_unary_op_expr (yyvsp[-1].code, yyvsp[0].ttype); ;
break;}
case 219:
-#line 1071 "parse.y"
+#line 1072 "parse.y"
{ if (pedantic)
- pedwarn ("ANSI C++ forbids `&&'");
+ cp_pedwarn (ec_forbids);
yyval.ttype = finish_label_address_expr (yyvsp[0].ttype); ;
break;}
case 220:
-#line 1075 "parse.y"
+#line 1076 "parse.y"
{ yyval.ttype = expr_sizeof (yyvsp[0].ttype); ;
break;}
case 221:
-#line 1077 "parse.y"
+#line 1078 "parse.y"
{ yyval.ttype = c_sizeof (groktypename (yyvsp[-1].ftype.t)); ;
break;}
case 222:
-#line 1079 "parse.y"
+#line 1080 "parse.y"
{ yyval.ttype = grok_alignof (yyvsp[0].ttype); ;
break;}
case 223:
-#line 1081 "parse.y"
+#line 1082 "parse.y"
{ yyval.ttype = c_alignof (groktypename (yyvsp[-1].ftype.t));
check_for_new_type ("alignof", yyvsp[-1].ftype); ;
break;}
case 224:
-#line 1087 "parse.y"
+#line 1088 "parse.y"
{ yyval.ttype = build_new (NULL_TREE, yyvsp[0].ftype.t, NULL_TREE, yyvsp[-1].itype);
check_for_new_type ("new", yyvsp[0].ftype); ;
break;}
case 225:
-#line 1090 "parse.y"
+#line 1091 "parse.y"
{ yyval.ttype = build_new (NULL_TREE, yyvsp[-1].ftype.t, yyvsp[0].ttype, yyvsp[-2].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
case 226:
-#line 1093 "parse.y"
+#line 1094 "parse.y"
{ yyval.ttype = build_new (yyvsp[-1].ttype, yyvsp[0].ftype.t, NULL_TREE, yyvsp[-2].itype);
check_for_new_type ("new", yyvsp[0].ftype); ;
break;}
case 227:
-#line 1096 "parse.y"
+#line 1097 "parse.y"
{ yyval.ttype = build_new (yyvsp[-2].ttype, yyvsp[-1].ftype.t, yyvsp[0].ttype, yyvsp[-3].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
case 228:
-#line 1109 "parse.y"
+#line 1110 "parse.y"
{ yyval.ttype = build_new (NULL_TREE, groktypename(yyvsp[-1].ftype.t),
NULL_TREE, yyvsp[-4].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
case 229:
-#line 1114 "parse.y"
+#line 1115 "parse.y"
{ yyval.ttype = build_new (NULL_TREE, groktypename(yyvsp[-2].ftype.t), yyvsp[0].ttype, yyvsp[-5].itype);
check_for_new_type ("new", yyvsp[-2].ftype); ;
break;}
case 230:
-#line 1118 "parse.y"
+#line 1119 "parse.y"
{ yyval.ttype = build_new (yyvsp[-4].ttype, groktypename(yyvsp[-1].ftype.t), NULL_TREE, yyvsp[-5].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
case 231:
-#line 1122 "parse.y"
+#line 1123 "parse.y"
{ yyval.ttype = build_new (yyvsp[-5].ttype, groktypename(yyvsp[-2].ftype.t), yyvsp[0].ttype, yyvsp[-6].itype);
check_for_new_type ("new", yyvsp[-2].ftype); ;
break;}
case 232:
-#line 1126 "parse.y"
+#line 1127 "parse.y"
{ yyval.ttype = delete_sanity (yyvsp[0].ttype, NULL_TREE, 0, yyvsp[-1].itype); ;
break;}
case 233:
-#line 1128 "parse.y"
+#line 1129 "parse.y"
{ yyval.ttype = delete_sanity (yyvsp[0].ttype, NULL_TREE, 1, yyvsp[-3].itype);
if (yychar == YYEMPTY)
yychar = YYLEX; ;
break;}
case 234:
-#line 1132 "parse.y"
+#line 1133 "parse.y"
{ yyval.ttype = delete_sanity (yyvsp[0].ttype, yyvsp[-2].ttype, 2, yyvsp[-4].itype);
if (yychar == YYEMPTY)
yychar = YYLEX; ;
break;}
case 235:
-#line 1136 "parse.y"
+#line 1137 "parse.y"
{ yyval.ttype = build_x_unary_op (REALPART_EXPR, yyvsp[0].ttype); ;
break;}
case 236:
-#line 1138 "parse.y"
+#line 1139 "parse.y"
{ yyval.ttype = build_x_unary_op (IMAGPART_EXPR, yyvsp[0].ttype); ;
break;}
case 237:
-#line 1148 "parse.y"
+#line 1149 "parse.y"
{ finish_new_placement (NULL_TREE, yyvsp[-2].itype); ;
break;}
case 238:
-#line 1151 "parse.y"
+#line 1152 "parse.y"
{ yyval.itype = begin_new_placement (); ;
break;}
case 239:
-#line 1155 "parse.y"
+#line 1156 "parse.y"
{ yyval.ttype = finish_new_placement (yyvsp[-1].ttype, yyvsp[-2].itype); ;
break;}
case 240:
-#line 1157 "parse.y"
-{ cp_pedwarn ("old style placement syntax, use () instead");
+#line 1158 "parse.y"
+{ cp_pedwarn (ec_old_style_placement_syntax_use_instead);
yyval.ttype = finish_new_placement (yyvsp[-1].ttype, yyvsp[-2].itype); ;
break;}
case 241:
-#line 1163 "parse.y"
+#line 1164 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 242:
-#line 1165 "parse.y"
+#line 1166 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 243:
-#line 1167 "parse.y"
+#line 1168 "parse.y"
{
- cp_error ("`%T' is not a valid expression", yyvsp[-1].ftype.t);
+ cp_error (ec_is_not_a_valid_expression, yyvsp[-1].ftype.t);
yyval.ttype = error_mark_node;
;
break;}
case 244:
-#line 1175 "parse.y"
+#line 1176 "parse.y"
{
if (pedantic)
- pedwarn ("ANSI C++ forbids initialization of new expression with `='");
+ cp_pedwarn (ec_forbids_initialization_of_new_expression_with);
if (TREE_CODE (yyvsp[0].ttype) != TREE_LIST
&& TREE_CODE (yyvsp[0].ttype) != CONSTRUCTOR)
yyval.ttype = build_expr_list (NULL_TREE, yyvsp[0].ttype);
@@ -5034,28 +5035,28 @@ case 244:
;
break;}
case 245:
-#line 1189 "parse.y"
+#line 1190 "parse.y"
{ yyvsp[-1].ftype.t = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[-1].ftype.t), 0);
yyval.ttype = make_call_declarator (NULL_TREE, yyvsp[-1].ftype.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", yyvsp[-1].ftype); ;
break;}
case 246:
-#line 1193 "parse.y"
+#line 1194 "parse.y"
{ yyvsp[-1].ftype.t = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[-1].ftype.t), 0);
yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-1].ftype.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", yyvsp[-1].ftype); ;
break;}
case 248:
-#line 1201 "parse.y"
+#line 1202 "parse.y"
{ yyval.ttype = reparse_absdcl_as_casts (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 249:
-#line 1203 "parse.y"
+#line 1204 "parse.y"
{
tree init = build_nt (CONSTRUCTOR, NULL_TREE,
nreverse (yyvsp[-2].ttype));
if (pedantic)
- pedwarn ("ANSI C++ forbids constructor-expressions");
+ cp_pedwarn (ec_forbids_constructorexpressions);
/* Indicate that this was a GNU C constructor expression. */
TREE_HAS_CONSTRUCTOR (init) = 1;
@@ -5063,161 +5064,161 @@ case 249:
;
break;}
case 251:
-#line 1219 "parse.y"
+#line 1220 "parse.y"
{ yyval.ttype = build_x_binary_op (MEMBER_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 252:
-#line 1221 "parse.y"
+#line 1222 "parse.y"
{ yyval.ttype = build_m_component_ref (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 253:
-#line 1223 "parse.y"
+#line 1224 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 254:
-#line 1225 "parse.y"
+#line 1226 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 255:
-#line 1227 "parse.y"
+#line 1228 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 256:
-#line 1229 "parse.y"
+#line 1230 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 257:
-#line 1231 "parse.y"
+#line 1232 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 258:
-#line 1233 "parse.y"
+#line 1234 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 259:
-#line 1235 "parse.y"
+#line 1236 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 260:
-#line 1237 "parse.y"
+#line 1238 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 261:
-#line 1239 "parse.y"
+#line 1240 "parse.y"
{ yyval.ttype = build_x_binary_op (LT_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 262:
-#line 1241 "parse.y"
+#line 1242 "parse.y"
{ yyval.ttype = build_x_binary_op (GT_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 263:
-#line 1243 "parse.y"
+#line 1244 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 264:
-#line 1245 "parse.y"
+#line 1246 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 265:
-#line 1247 "parse.y"
+#line 1248 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 266:
-#line 1249 "parse.y"
+#line 1250 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 267:
-#line 1251 "parse.y"
+#line 1252 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 268:
-#line 1253 "parse.y"
+#line 1254 "parse.y"
{ yyval.ttype = build_x_binary_op (TRUTH_ANDIF_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 269:
-#line 1255 "parse.y"
+#line 1256 "parse.y"
{ yyval.ttype = build_x_binary_op (TRUTH_ORIF_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 270:
-#line 1257 "parse.y"
+#line 1258 "parse.y"
{ yyval.ttype = build_x_conditional_expr (yyval.ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 271:
-#line 1259 "parse.y"
+#line 1260 "parse.y"
{ yyval.ttype = build_x_modify_expr (yyval.ttype, NOP_EXPR, yyvsp[0].ttype);
if (yyval.ttype != error_mark_node)
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, MODIFY_EXPR); ;
break;}
case 272:
-#line 1263 "parse.y"
+#line 1264 "parse.y"
{ yyval.ttype = build_x_modify_expr (yyval.ttype, yyvsp[-1].code, yyvsp[0].ttype); ;
break;}
case 273:
-#line 1265 "parse.y"
+#line 1266 "parse.y"
{ yyval.ttype = build_throw (NULL_TREE); ;
break;}
case 274:
-#line 1267 "parse.y"
+#line 1268 "parse.y"
{ yyval.ttype = build_throw (yyvsp[0].ttype); ;
break;}
case 275:
-#line 1285 "parse.y"
+#line 1286 "parse.y"
{ yyval.ttype = build_parse_node (BIT_NOT_EXPR, yyvsp[0].ttype); ;
break;}
case 276:
-#line 1287 "parse.y"
+#line 1288 "parse.y"
{ yyval.ttype = build_parse_node (BIT_NOT_EXPR, yyvsp[0].ttype); ;
break;}
case 282:
-#line 1296 "parse.y"
+#line 1297 "parse.y"
{ yyval.ttype = do_identifier (yyvsp[-1].ttype, 1, NULL_TREE); ;
break;}
case 283:
-#line 1300 "parse.y"
+#line 1301 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 284:
-#line 1302 "parse.y"
+#line 1303 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 285:
-#line 1307 "parse.y"
+#line 1308 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 286:
-#line 1309 "parse.y"
+#line 1310 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 287:
-#line 1312 "parse.y"
+#line 1313 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 292:
-#line 1324 "parse.y"
+#line 1325 "parse.y"
{ yyval.ttype = build_parse_node (INDIRECT_REF, yyvsp[0].ttype); ;
break;}
case 293:
-#line 1326 "parse.y"
+#line 1327 "parse.y"
{ yyval.ttype = build_parse_node (ADDR_EXPR, yyvsp[0].ttype); ;
break;}
case 294:
-#line 1328 "parse.y"
+#line 1329 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 295:
-#line 1333 "parse.y"
+#line 1334 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 296:
-#line 1335 "parse.y"
+#line 1336 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 300:
-#line 1345 "parse.y"
+#line 1346 "parse.y"
{ yyval.ttype = finish_decl_parsing (yyvsp[-1].ttype); ;
break;}
case 301:
-#line 1350 "parse.y"
+#line 1351 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == BIT_NOT_EXPR)
yyval.ttype = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND (yyvsp[0].ttype, 0));
@@ -5226,7 +5227,7 @@ case 301:
;
break;}
case 304:
-#line 1359 "parse.y"
+#line 1360 "parse.y"
{
if (processing_template_decl)
push_obstacks (&permanent_obstack, &permanent_obstack);
@@ -5242,69 +5243,69 @@ case 304:
;
break;}
case 305:
-#line 1373 "parse.y"
+#line 1374 "parse.y"
{ yyval.ttype = finish_parenthesized_expr (yyvsp[-1].ttype); ;
break;}
case 306:
-#line 1375 "parse.y"
+#line 1376 "parse.y"
{ yyvsp[-1].ttype = reparse_decl_as_expr (NULL_TREE, yyvsp[-1].ttype);
yyval.ttype = finish_parenthesized_expr (yyvsp[-1].ttype); ;
break;}
case 307:
-#line 1378 "parse.y"
+#line 1379 "parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 308:
-#line 1380 "parse.y"
+#line 1381 "parse.y"
{ tree scope = current_scope ();
if (!scope || TREE_CODE (scope) != FUNCTION_DECL)
{
- error ("braced-group within expression allowed only inside a function");
+ cp_error (ec_bracedgroup_within_expression_allowed_only_inside_a_function);
YYERROR;
}
if (pedantic)
- pedwarn ("ANSI C++ forbids braced-groups within expressions");
+ cp_pedwarn (ec_forbids_bracedgroups_within_expressions);
yyval.ttype = begin_stmt_expr ();
;
break;}
case 309:
-#line 1391 "parse.y"
+#line 1392 "parse.y"
{ yyval.ttype = finish_stmt_expr (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 310:
-#line 1396 "parse.y"
+#line 1397 "parse.y"
{ yyval.ttype = finish_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype, 1); ;
break;}
case 311:
-#line 1398 "parse.y"
+#line 1399 "parse.y"
{ yyval.ttype = finish_call_expr (yyvsp[-1].ttype, NULL_TREE, 1); ;
break;}
case 312:
-#line 1400 "parse.y"
+#line 1401 "parse.y"
{ yyval.ttype = finish_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype, 0); ;
break;}
case 313:
-#line 1402 "parse.y"
+#line 1403 "parse.y"
{ yyval.ttype = finish_call_expr (yyvsp[-1].ttype, NULL_TREE, 0); ;
break;}
case 314:
-#line 1404 "parse.y"
+#line 1405 "parse.y"
{ yyval.ttype = grok_array_decl (yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 315:
-#line 1406 "parse.y"
+#line 1407 "parse.y"
{ yyval.ttype = finish_increment_expr (yyvsp[-1].ttype, POSTINCREMENT_EXPR); ;
break;}
case 316:
-#line 1408 "parse.y"
+#line 1409 "parse.y"
{ yyval.ttype = finish_increment_expr (yyvsp[-1].ttype, POSTDECREMENT_EXPR); ;
break;}
case 317:
-#line 1411 "parse.y"
+#line 1412 "parse.y"
{ yyval.ttype = finish_this_expr (); ;
break;}
case 318:
-#line 1413 "parse.y"
+#line 1414 "parse.y"
{
tree type = NULL_TREE;
tree id = yyval.ttype;
@@ -5318,7 +5319,7 @@ case 318:
#if 0
if (yyvsp[-1].ttype == NULL_TREE)
{
- error ("cannot cast null list to type `%s'",
+ cp_error (ec_cannot_cast_null_list_to_type_s,
IDENTIFIER_POINTER (TYPE_NAME (id)));
yyval.ttype = error_mark_node;
break;
@@ -5339,7 +5340,7 @@ case 318:
/* should not be able to get here (mrs) */
else if (id == ridpointers[(int) RID_FRIEND])
{
- error ("cannot cast expression to `friend' type");
+ cp_error (ec_cannot_cast_expression_to_friend_type);
yyval.ttype = error_mark_node;
break;
}
@@ -5350,49 +5351,49 @@ case 318:
;
break;}
case 320:
-#line 1458 "parse.y"
+#line 1459 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("dynamic_cast", yyvsp[-4].ftype);
yyval.ttype = build_dynamic_cast (type, yyvsp[-1].ttype); ;
break;}
case 321:
-#line 1462 "parse.y"
+#line 1463 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("static_cast", yyvsp[-4].ftype);
yyval.ttype = build_static_cast (type, yyvsp[-1].ttype); ;
break;}
case 322:
-#line 1466 "parse.y"
+#line 1467 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("reinterpret_cast", yyvsp[-4].ftype);
yyval.ttype = build_reinterpret_cast (type, yyvsp[-1].ttype); ;
break;}
case 323:
-#line 1470 "parse.y"
+#line 1471 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("const_cast", yyvsp[-4].ftype);
yyval.ttype = build_const_cast (type, yyvsp[-1].ttype); ;
break;}
case 324:
-#line 1474 "parse.y"
+#line 1475 "parse.y"
{ yyval.ttype = build_x_typeid (yyvsp[-1].ttype); ;
break;}
case 325:
-#line 1476 "parse.y"
+#line 1477 "parse.y"
{ tree type = groktypename (yyvsp[-1].ftype.t);
check_for_new_type ("typeid", yyvsp[-1].ftype);
yyval.ttype = get_typeid (TYPE_MAIN_VARIANT (type)); ;
break;}
case 326:
-#line 1480 "parse.y"
+#line 1481 "parse.y"
{ yyval.ttype = do_scoped_id (yyvsp[0].ttype, 1); ;
break;}
case 327:
-#line 1482 "parse.y"
+#line 1483 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 328:
-#line 1484 "parse.y"
+#line 1485 "parse.y"
{
got_scope = NULL_TREE;
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
@@ -5402,102 +5403,102 @@ case 328:
;
break;}
case 329:
-#line 1492 "parse.y"
+#line 1493 "parse.y"
{ yyval.ttype = build_offset_ref (OP0 (yyval.ttype), OP1 (yyval.ttype)); ;
break;}
case 330:
-#line 1494 "parse.y"
+#line 1495 "parse.y"
{ yyval.ttype = finish_qualified_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 331:
-#line 1496 "parse.y"
+#line 1497 "parse.y"
{ yyval.ttype = finish_qualified_call_expr (yyvsp[-1].ttype, NULL_TREE); ;
break;}
case 332:
-#line 1498 "parse.y"
+#line 1499 "parse.y"
{
yyval.ttype = build_x_component_ref (yyval.ttype, yyvsp[0].ttype, NULL_TREE, 1);
;
break;}
case 333:
-#line 1502 "parse.y"
+#line 1503 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-3].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
case 334:
-#line 1504 "parse.y"
+#line 1505 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-1].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 335:
-#line 1506 "parse.y"
+#line 1507 "parse.y"
{ yyval.ttype = build_x_component_ref (yyval.ttype, yyvsp[0].ttype, NULL_TREE, 1); ;
break;}
case 336:
-#line 1508 "parse.y"
+#line 1509 "parse.y"
{ if (processing_template_decl)
yyval.ttype = build_min_nt (COMPONENT_REF, yyvsp[-1].ttype, copy_to_permanent (yyvsp[0].ttype));
else
yyval.ttype = build_object_ref (yyval.ttype, OP0 (yyvsp[0].ttype), OP1 (yyvsp[0].ttype)); ;
break;}
case 337:
-#line 1513 "parse.y"
+#line 1514 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-3].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
case 338:
-#line 1515 "parse.y"
+#line 1516 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-1].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 339:
-#line 1517 "parse.y"
+#line 1518 "parse.y"
{ yyval.ttype = finish_qualified_object_call_expr (yyvsp[-3].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
case 340:
-#line 1519 "parse.y"
+#line 1520 "parse.y"
{ yyval.ttype = finish_qualified_object_call_expr (yyvsp[-1].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 341:
-#line 1522 "parse.y"
+#line 1523 "parse.y"
{ yyval.ttype = finish_pseudo_destructor_call_expr (yyvsp[-3].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 342:
-#line 1524 "parse.y"
+#line 1525 "parse.y"
{ yyval.ttype = finish_pseudo_destructor_call_expr (yyvsp[-5].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
case 343:
-#line 1526 "parse.y"
+#line 1527 "parse.y"
{
yyval.ttype = error_mark_node;
;
break;}
case 344:
-#line 1571 "parse.y"
+#line 1572 "parse.y"
{ yyval.itype = 0; ;
break;}
case 345:
-#line 1573 "parse.y"
+#line 1574 "parse.y"
{ got_scope = NULL_TREE; yyval.itype = 1; ;
break;}
case 346:
-#line 1578 "parse.y"
+#line 1579 "parse.y"
{ yyval.itype = 0; ;
break;}
case 347:
-#line 1580 "parse.y"
+#line 1581 "parse.y"
{ got_scope = NULL_TREE; yyval.itype = 1; ;
break;}
case 348:
-#line 1585 "parse.y"
+#line 1586 "parse.y"
{ yyval.ttype = boolean_true_node; ;
break;}
case 349:
-#line 1587 "parse.y"
+#line 1588 "parse.y"
{ yyval.ttype = boolean_false_node; ;
break;}
case 351:
-#line 1594 "parse.y"
+#line 1595 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 352:
-#line 1599 "parse.y"
+#line 1600 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
@@ -5509,18 +5510,18 @@ case 352:
;
break;}
case 353:
-#line 1612 "parse.y"
+#line 1613 "parse.y"
{ got_object = TREE_TYPE (yyval.ttype); ;
break;}
case 354:
-#line 1614 "parse.y"
+#line 1615 "parse.y"
{
yyval.ttype = build_x_arrow (yyval.ttype);
got_object = TREE_TYPE (yyval.ttype);
;
break;}
case 355:
-#line 1622 "parse.y"
+#line 1623 "parse.y"
{
resume_momentary (yyvsp[-1].itype);
if (yyvsp[-2].ftype.t && IS_AGGR_TYPE_CODE (TREE_CODE (yyvsp[-2].ftype.t)))
@@ -5528,200 +5529,200 @@ case 355:
;
break;}
case 356:
-#line 1628 "parse.y"
+#line 1629 "parse.y"
{
resume_momentary (yyvsp[-1].itype);
note_list_got_semicolon (yyvsp[-2].ftype.t);
;
break;}
case 357:
-#line 1633 "parse.y"
+#line 1634 "parse.y"
{ resume_momentary (yyvsp[-1].itype); ;
break;}
case 358:
-#line 1635 "parse.y"
+#line 1636 "parse.y"
{
shadow_tag (yyvsp[-1].ftype.t);
note_list_got_semicolon (yyvsp[-1].ftype.t);
;
break;}
case 359:
-#line 1640 "parse.y"
-{ warning ("empty declaration"); ;
+#line 1641 "parse.y"
+{ cp_warning (ec_empty_declaration); ;
break;}
case 360:
-#line 1642 "parse.y"
+#line 1643 "parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 363:
-#line 1656 "parse.y"
+#line 1657 "parse.y"
{ yyval.ttype = make_call_declarator (NULL_TREE, empty_parms (),
NULL_TREE, NULL_TREE); ;
break;}
case 364:
-#line 1659 "parse.y"
+#line 1660 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), NULL_TREE,
NULL_TREE); ;
break;}
case 365:
-#line 1666 "parse.y"
+#line 1667 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 366:
-#line 1669 "parse.y"
+#line 1670 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 367:
-#line 1672 "parse.y"
+#line 1673 "parse.y"
{ yyval.ftype.t = build_decl_list (get_decl_list (yyvsp[-1].ftype.t), yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 368:
-#line 1675 "parse.y"
+#line 1676 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[0].ftype.t, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 369:
-#line 1678 "parse.y"
+#line 1679 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[0].ftype.t, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 372:
-#line 1694 "parse.y"
+#line 1695 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyvsp[-1].ttype);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 373:
-#line 1697 "parse.y"
+#line 1698 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 374:
-#line 1700 "parse.y"
+#line 1701 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-2].ftype.t, chainon (yyvsp[-1].ttype, yyvsp[0].ttype));
yyval.ftype.new_type_flag = yyvsp[-2].ftype.new_type_flag; ;
break;}
case 375:
-#line 1703 "parse.y"
+#line 1704 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, chainon (yyvsp[0].ttype, yyvsp[-2].ttype));
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 376:
-#line 1706 "parse.y"
+#line 1707 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, chainon (yyvsp[0].ttype, yyvsp[-2].ttype));
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 377:
-#line 1709 "parse.y"
+#line 1710 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-2].ftype.t,
chainon (yyvsp[-1].ttype, chainon (yyvsp[0].ttype, yyvsp[-3].ttype)));
yyval.ftype.new_type_flag = yyvsp[-2].ftype.new_type_flag; ;
break;}
case 378:
-#line 1716 "parse.y"
+#line 1717 "parse.y"
{ if (extra_warnings)
- warning ("`%s' is not at beginning of declaration",
+ cp_warning (ec_s_is_not_at_beginning_of_declaration,
IDENTIFIER_POINTER (yyval.ttype));
yyval.ttype = build_decl_list (NULL_TREE, yyval.ttype); ;
break;}
case 379:
-#line 1721 "parse.y"
+#line 1722 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyval.ttype); ;
break;}
case 380:
-#line 1723 "parse.y"
+#line 1724 "parse.y"
{ if (extra_warnings)
- warning ("`%s' is not at beginning of declaration",
+ cp_warning (ec_s_is_not_at_beginning_of_declaration,
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
case 381:
-#line 1728 "parse.y"
+#line 1729 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 382:
-#line 1730 "parse.y"
+#line 1731 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
case 383:
-#line 1740 "parse.y"
+#line 1741 "parse.y"
{ yyval.ttype = yyvsp[0].ftype.t; TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 384:
-#line 1742 "parse.y"
+#line 1743 "parse.y"
{ yyval.ttype = IDENTIFIER_AS_LIST (yyval.ttype); ;
break;}
case 385:
-#line 1744 "parse.y"
+#line 1745 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 386:
-#line 1747 "parse.y"
+#line 1748 "parse.y"
{ if (extra_warnings && TREE_STATIC (yyval.ttype))
- warning ("`%s' is not at beginning of declaration",
+ cp_warning (ec_s_is_not_at_beginning_of_declaration,
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype);
TREE_STATIC (yyval.ttype) = TREE_STATIC (yyvsp[-1].ttype); ;
break;}
case 387:
-#line 1753 "parse.y"
+#line 1754 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 388:
-#line 1755 "parse.y"
+#line 1756 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
case 389:
-#line 1766 "parse.y"
+#line 1767 "parse.y"
{ yyval.ftype.t = get_decl_list (yyvsp[0].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 390:
-#line 1769 "parse.y"
+#line 1770 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 391:
-#line 1772 "parse.y"
+#line 1773 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 392:
-#line 1775 "parse.y"
+#line 1776 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, chainon (yyvsp[0].ttype, yyvsp[-2].ftype.t));
yyval.ftype.new_type_flag = yyvsp[-2].ftype.new_type_flag; ;
break;}
case 393:
-#line 1781 "parse.y"
+#line 1782 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;}
case 394:
-#line 1783 "parse.y"
+#line 1784 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyvsp[-1].ttype); ;
break;}
case 396:
-#line 1793 "parse.y"
+#line 1794 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
case 397:
-#line 1795 "parse.y"
+#line 1796 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
case 398:
-#line 1797 "parse.y"
+#line 1798 "parse.y"
{ yyval.ftype.t = TREE_TYPE (yyvsp[-1].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
case 399:
-#line 1800 "parse.y"
+#line 1801 "parse.y"
{ yyval.ftype.t = groktypename (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = 0; ;
break;}
case 400:
-#line 1803 "parse.y"
+#line 1804 "parse.y"
{ tree type = TREE_TYPE (yyvsp[-1].ttype);
yyval.ftype.new_type_flag = 0;
@@ -5732,13 +5733,13 @@ case 400:
}
else
{
- error ("`sigof' applied to non-aggregate expression");
+ cp_error (ec_sigof_applied_to_nonaggregate_expression);
yyval.ftype.t = error_mark_node;
}
;
break;}
case 401:
-#line 1818 "parse.y"
+#line 1819 "parse.y"
{ tree type = groktypename (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = 0;
@@ -5749,194 +5750,194 @@ case 401:
}
else
{
- error("`sigof' applied to non-aggregate type");
+ cp_error (ec_sigof_applied_to_nonaggregate_type);
yyval.ftype.t = error_mark_node;
}
;
break;}
case 402:
-#line 1838 "parse.y"
+#line 1839 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
case 403:
-#line 1840 "parse.y"
+#line 1841 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
case 411:
-#line 1861 "parse.y"
+#line 1862 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 412:
-#line 1863 "parse.y"
+#line 1864 "parse.y"
{ if (TREE_CHAIN (yyvsp[-1].ttype)) yyvsp[-1].ttype = combine_strings (yyvsp[-1].ttype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 413:
-#line 1868 "parse.y"
+#line 1869 "parse.y"
{ yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1,
yyvsp[-1].ttype, prefix_attributes); ;
break;}
case 414:
-#line 1872 "parse.y"
+#line 1873 "parse.y"
{ cp_finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype, 1, LOOKUP_ONLYCONVERTING); ;
break;}
case 415:
-#line 1874 "parse.y"
+#line 1875 "parse.y"
{ yyval.ttype = start_decl (yyvsp[-2].ttype, current_declspecs, 0,
yyvsp[0].ttype, prefix_attributes);
cp_finish_decl (yyval.ttype, NULL_TREE, yyvsp[-1].ttype, 1, 0); ;
break;}
case 416:
-#line 1887 "parse.y"
+#line 1888 "parse.y"
{ yyvsp[0].itype = parse_decl (yyvsp[-3].ttype, yyvsp[-4].ttype,
yyvsp[-1].ttype, 1, &yyval.ttype); ;
break;}
case 417:
-#line 1892 "parse.y"
+#line 1893 "parse.y"
{ cp_finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype, 1,
LOOKUP_ONLYCONVERTING);
yyval.itype = yyvsp[-2].itype; ;
break;}
case 418:
-#line 1896 "parse.y"
+#line 1897 "parse.y"
{ tree d;
yyval.itype = parse_decl (yyvsp[-2].ttype, yyvsp[-3].ttype, yyvsp[0].ttype, 0, &d);
cp_finish_decl (d, NULL_TREE, yyvsp[-1].ttype, 1, 0); ;
break;}
case 419:
-#line 1903 "parse.y"
+#line 1904 "parse.y"
{ yyval.itype = yyvsp[0].itype; ;
break;}
case 420:
-#line 1907 "parse.y"
+#line 1908 "parse.y"
{ yyval.itype = yyvsp[0].itype; ;
break;}
case 421:
-#line 1912 "parse.y"
+#line 1913 "parse.y"
{ /* Set things up as initdcl0_innards expects. */
yyval.ttype = yyvsp[-1].ttype;
yyvsp[-1].ttype = NULL_TREE; ;
break;}
case 422:
-#line 1916 "parse.y"
+#line 1917 "parse.y"
{;
break;}
case 423:
-#line 1918 "parse.y"
+#line 1919 "parse.y"
{ tree d;
parse_decl(yyvsp[-2].ttype, NULL_TREE, yyvsp[0].ttype, 0, &d);
cp_finish_decl (d, NULL_TREE, yyvsp[-1].ttype, 1, 0); ;
break;}
case 424:
-#line 1927 "parse.y"
+#line 1928 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 425:
-#line 1929 "parse.y"
+#line 1930 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 426:
-#line 1934 "parse.y"
+#line 1935 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 427:
-#line 1936 "parse.y"
+#line 1937 "parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 428:
-#line 1941 "parse.y"
+#line 1942 "parse.y"
{ yyval.ttype = yyvsp[-2].ttype; ;
break;}
case 429:
-#line 1946 "parse.y"
+#line 1947 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 430:
-#line 1948 "parse.y"
+#line 1949 "parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 431:
-#line 1953 "parse.y"
+#line 1954 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 432:
-#line 1955 "parse.y"
+#line 1956 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 433:
-#line 1957 "parse.y"
+#line 1958 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, build_tree_list (NULL_TREE, yyvsp[-1].ttype)); ;
break;}
case 434:
-#line 1959 "parse.y"
+#line 1960 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-5].ttype, tree_cons (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype)); ;
break;}
case 435:
-#line 1961 "parse.y"
+#line 1962 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 440:
-#line 1977 "parse.y"
+#line 1978 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 441:
-#line 1979 "parse.y"
+#line 1980 "parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 442:
-#line 1984 "parse.y"
+#line 1985 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 443:
-#line 1986 "parse.y"
+#line 1987 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 445:
-#line 1994 "parse.y"
+#line 1995 "parse.y"
{ yyval.ttype = build_nt (CONSTRUCTOR, NULL_TREE, NULL_TREE);
TREE_HAS_CONSTRUCTOR (yyval.ttype) = 1; ;
break;}
case 446:
-#line 1997 "parse.y"
+#line 1998 "parse.y"
{ yyval.ttype = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (yyvsp[-1].ttype));
TREE_HAS_CONSTRUCTOR (yyval.ttype) = 1; ;
break;}
case 447:
-#line 2000 "parse.y"
+#line 2001 "parse.y"
{ yyval.ttype = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (yyvsp[-2].ttype));
TREE_HAS_CONSTRUCTOR (yyval.ttype) = 1; ;
break;}
case 448:
-#line 2003 "parse.y"
+#line 2004 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 449:
-#line 2010 "parse.y"
+#line 2011 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyval.ttype); ;
break;}
case 450:
-#line 2012 "parse.y"
+#line 2013 "parse.y"
{ yyval.ttype = expr_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
case 451:
-#line 2015 "parse.y"
+#line 2016 "parse.y"
{ yyval.ttype = build_expr_list (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 452:
-#line 2017 "parse.y"
+#line 2018 "parse.y"
{ yyval.ttype = build_expr_list (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 453:
-#line 2019 "parse.y"
+#line 2020 "parse.y"
{ yyval.ttype = expr_tree_cons (yyvsp[-2].ttype, yyvsp[0].ttype, yyval.ttype); ;
break;}
case 454:
-#line 2024 "parse.y"
+#line 2025 "parse.y"
{ start_function (NULL_TREE, TREE_VALUE (yyvsp[0].ttype),
NULL_TREE, 1);
reinit_parse_for_function (); ;
break;}
case 455:
-#line 2030 "parse.y"
+#line 2031 "parse.y"
{
int nested = (hack_decl_function_context
(current_function_decl) != NULL_TREE);
@@ -5945,37 +5946,37 @@ case 455:
;
break;}
case 456:
-#line 2037 "parse.y"
+#line 2038 "parse.y"
{ process_next_inline (yyvsp[-2].ttype); ;
break;}
case 457:
-#line 2039 "parse.y"
+#line 2040 "parse.y"
{ process_next_inline (yyvsp[-2].ttype); ;
break;}
case 460:
-#line 2051 "parse.y"
+#line 2052 "parse.y"
{ replace_defarg (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 461:
-#line 2053 "parse.y"
+#line 2054 "parse.y"
{ replace_defarg (yyvsp[-2].ttype, error_mark_node); ;
break;}
case 463:
-#line 2058 "parse.y"
+#line 2059 "parse.y"
{ do_pending_defargs (); ;
break;}
case 464:
-#line 2060 "parse.y"
+#line 2061 "parse.y"
{ do_pending_defargs (); ;
break;}
case 465:
-#line 2065 "parse.y"
+#line 2066 "parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = current_enum_type;
current_enum_type = start_enum (yyvsp[-1].ttype); ;
break;}
case 466:
-#line 2069 "parse.y"
+#line 2070 "parse.y"
{ TYPE_VALUES (current_enum_type) = yyvsp[-2].ttype;
yyval.ftype.t = finish_enum (current_enum_type);
yyval.ftype.new_type_flag = 1;
@@ -5984,19 +5985,19 @@ case 466:
check_for_missing_semicolon (yyval.ftype.t); ;
break;}
case 467:
-#line 2076 "parse.y"
+#line 2077 "parse.y"
{ yyval.ftype.t = finish_enum (start_enum (yyvsp[-2].ttype));
yyval.ftype.new_type_flag = 1;
check_for_missing_semicolon (yyval.ftype.t); ;
break;}
case 468:
-#line 2080 "parse.y"
+#line 2081 "parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = current_enum_type;
current_enum_type = start_enum (make_anon_name ()); ;
break;}
case 469:
-#line 2084 "parse.y"
+#line 2085 "parse.y"
{ TYPE_VALUES (current_enum_type) = yyvsp[-2].ttype;
yyval.ftype.t = finish_enum (current_enum_type);
yyval.ftype.new_type_flag = 1;
@@ -6005,30 +6006,30 @@ case 469:
check_for_missing_semicolon (yyval.ftype.t); ;
break;}
case 470:
-#line 2091 "parse.y"
+#line 2092 "parse.y"
{ yyval.ftype.t = finish_enum (start_enum (make_anon_name()));
yyval.ftype.new_type_flag = 1;
check_for_missing_semicolon (yyval.ftype.t); ;
break;}
case 471:
-#line 2095 "parse.y"
+#line 2096 "parse.y"
{ yyval.ftype.t = xref_tag (enum_type_node, yyvsp[0].ttype, 1);
yyval.ftype.new_type_flag = 0; ;
break;}
case 472:
-#line 2098 "parse.y"
+#line 2099 "parse.y"
{ yyval.ftype.t = xref_tag (enum_type_node, yyvsp[0].ttype, 1);
yyval.ftype.new_type_flag = 0; ;
break;}
case 473:
-#line 2101 "parse.y"
+#line 2102 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype;
yyval.ftype.new_type_flag = 0;
if (!processing_template_decl)
- cp_pedwarn ("using `typename' outside of template"); ;
+ cp_pedwarn (ec_using_typename_outside_of_template); ;
break;}
case 474:
-#line 2108 "parse.y"
+#line 2109 "parse.y"
{
int semi;
@@ -6040,22 +6041,22 @@ case 474:
;
break;}
case 475:
-#line 2118 "parse.y"
+#line 2119 "parse.y"
{ finish_default_args (); ;
break;}
case 476:
-#line 2120 "parse.y"
+#line 2121 "parse.y"
{ yyval.ftype.t = yyvsp[-3].ttype;
yyval.ftype.new_type_flag = 1;
begin_inline_definitions (); ;
break;}
case 477:
-#line 2124 "parse.y"
+#line 2125 "parse.y"
{
yyval.ftype.new_type_flag = 0;
if (TYPE_BINFO (yyvsp[0].ttype) == NULL_TREE)
{
- cp_error ("%T is not a class type", yyvsp[0].ttype);
+ cp_error (ec_is_not_a_class_type, yyvsp[0].ttype);
yyval.ftype.t = error_mark_node;
}
else
@@ -6064,91 +6065,91 @@ case 477:
/* struct B: public A; is not accepted by the WP grammar. */
if (TYPE_BINFO_BASETYPES (yyval.ftype.t) && !TYPE_SIZE (yyval.ftype.t)
&& ! TYPE_BEING_DEFINED (yyval.ftype.t))
- cp_error ("base clause without member specification for `%#T'",
+ cp_error (ec_base_clause_without_member_specification_for,
yyval.ftype.t);
}
;
break;}
case 481:
-#line 2151 "parse.y"
+#line 2152 "parse.y"
{ if (pedantic && !in_system_header)
- pedwarn ("comma at end of enumerator list"); ;
+ cp_pedwarn (ec_comma_at_end_of_enumerator_list); ;
break;}
case 483:
-#line 2158 "parse.y"
-{ error ("storage class specifier `%s' not allowed after struct or class", IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
+#line 2159 "parse.y"
+{ cp_error (ec_storage_class_specifier_s_not_allowed_after_struct_or_class, IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
break;}
case 484:
-#line 2160 "parse.y"
-{ error ("type specifier `%s' not allowed after struct or class", IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
+#line 2161 "parse.y"
+{ cp_error (ec_type_specifier_s_not_allowed_after_struct_or_class, IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
break;}
case 485:
-#line 2162 "parse.y"
-{ error ("type qualifier `%s' not allowed after struct or class", IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
+#line 2163 "parse.y"
+{ cp_error (ec_type_qualifier_s_not_allowed_after_struct_or_class, IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
break;}
case 486:
-#line 2164 "parse.y"
-{ error ("no body nor ';' separates two class, struct or union declarations"); ;
+#line 2165 "parse.y"
+{ cp_error (ec_no_body_nor_separates_two_class_struct_or_union_declarations); ;
break;}
case 487:
-#line 2166 "parse.y"
+#line 2167 "parse.y"
{ yyval.ttype = build_decl_list (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 488:
-#line 2171 "parse.y"
+#line 2172 "parse.y"
{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
case 489:
-#line 2176 "parse.y"
+#line 2177 "parse.y"
{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
case 490:
-#line 2178 "parse.y"
+#line 2179 "parse.y"
{ yyungetc ('{', 1); ;
break;}
case 491:
-#line 2180 "parse.y"
+#line 2181 "parse.y"
{ yyungetc (':', 1); ;
break;}
case 492:
-#line 2185 "parse.y"
+#line 2186 "parse.y"
{
current_aggr = yyvsp[-2].ttype;
yyval.ttype = handle_class_head (yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 493:
-#line 2190 "parse.y"
+#line 2191 "parse.y"
{
current_aggr = yyvsp[-3].ttype;
yyval.ttype = handle_class_head (yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
case 494:
-#line 2195 "parse.y"
+#line 2196 "parse.y"
{
current_aggr = yyvsp[-2].ttype;
yyval.ttype = handle_class_head (yyvsp[-2].ttype, NULL_TREE, yyvsp[0].ttype);
;
break;}
case 495:
-#line 2200 "parse.y"
+#line 2201 "parse.y"
{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
case 496:
-#line 2202 "parse.y"
+#line 2203 "parse.y"
{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
case 497:
-#line 2207 "parse.y"
+#line 2208 "parse.y"
{ yyval.ttype = xref_tag (current_aggr, yyvsp[0].ttype, 0); ;
break;}
case 498:
-#line 2212 "parse.y"
+#line 2213 "parse.y"
{ yyval.ttype = xref_tag (current_aggr, yyvsp[0].ttype, 1); ;
break;}
case 499:
-#line 2215 "parse.y"
+#line 2216 "parse.y"
{
yyval.ttype = yyvsp[-1].ttype;
if (yyvsp[0].ttype)
@@ -6156,15 +6157,15 @@ case 499:
;
break;}
case 500:
-#line 2221 "parse.y"
+#line 2222 "parse.y"
{
yyval.ttype = TREE_TYPE (yyvsp[-1].ttype);
if (TREE_INT_CST_LOW (current_aggr) == union_type
&& TREE_CODE (yyval.ttype) != UNION_TYPE)
- cp_pedwarn ("`union' tag used in declaring `%#T'", yyval.ttype);
+ cp_pedwarn (ec_union_tag_used_in_declaring, yyval.ttype);
else if (TREE_CODE (yyval.ttype) == UNION_TYPE
&& TREE_INT_CST_LOW (current_aggr) != union_type)
- cp_pedwarn ("non-`union' tag used in declaring `%#T'", yyval.ttype);
+ cp_pedwarn (ec_nonunion_tag_used_in_declaring, yyval.ttype);
if (yyvsp[0].ttype)
{
maybe_process_partial_specialization (yyval.ttype);
@@ -6173,44 +6174,44 @@ case 500:
;
break;}
case 501:
-#line 2239 "parse.y"
+#line 2240 "parse.y"
{ yyval.ttype = xref_tag (yyval.ttype, make_anon_name (), 0);
yyungetc ('{', 1); ;
break;}
case 504:
-#line 2250 "parse.y"
+#line 2251 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 505:
-#line 2252 "parse.y"
+#line 2253 "parse.y"
{ yyungetc(':', 1); yyval.ttype = NULL_TREE; ;
break;}
case 506:
-#line 2254 "parse.y"
+#line 2255 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 508:
-#line 2260 "parse.y"
+#line 2261 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 509:
-#line 2265 "parse.y"
+#line 2266 "parse.y"
{ yyval.ttype = finish_base_specifier (access_default_node, yyvsp[0].ttype,
current_aggr
== signature_type_node); ;
break;}
case 510:
-#line 2269 "parse.y"
+#line 2270 "parse.y"
{ yyval.ttype = finish_base_specifier (yyvsp[-2].ttype, yyvsp[0].ttype,
current_aggr
== signature_type_node); ;
break;}
case 511:
-#line 2276 "parse.y"
+#line 2277 "parse.y"
{ yyval.ttype = TYPE_MAIN_DECL (yyvsp[0].ttype); ;
break;}
case 513:
-#line 2279 "parse.y"
+#line 2280 "parse.y"
{
if (current_aggr == signature_type_node)
{
@@ -6221,19 +6222,19 @@ case 513:
}
else
{
- error ("`sigof' applied to non-aggregate expression");
+ cp_error (ec_sigof_applied_to_nonaggregate_expression);
yyval.ttype = error_mark_node;
}
}
else
{
- error ("`sigof' in struct or class declaration");
+ cp_error (ec_sigof_in_struct_or_class_declaration);
yyval.ttype = error_mark_node;
}
;
break;}
case 514:
-#line 2300 "parse.y"
+#line 2301 "parse.y"
{
if (current_aggr == signature_type_node)
{
@@ -6244,28 +6245,28 @@ case 514:
}
else
{
- error ("`sigof' applied to non-aggregate expression");
+ cp_error (ec_sigof_applied_to_nonaggregate_expression);
yyval.ttype = error_mark_node;
}
}
else
{
- error ("`sigof' in struct or class declaration");
+ cp_error (ec_sigof_in_struct_or_class_declaration);
yyval.ttype = error_mark_node;
}
;
break;}
case 516:
-#line 2325 "parse.y"
+#line 2326 "parse.y"
{ if (yyvsp[-1].ttype != ridpointers[(int)RID_VIRTUAL])
- cp_error ("`%D' access", yyvsp[-1].ttype);
+ cp_error (ec_access, yyvsp[-1].ttype);
yyval.ttype = access_default_virtual_node; ;
break;}
case 517:
-#line 2329 "parse.y"
+#line 2330 "parse.y"
{
if (yyvsp[-2].ttype != access_default_virtual_node)
- error ("multiple access specifiers");
+ cp_error (ec_multiple_access_specifiers);
else if (yyvsp[-1].ttype == access_public_node)
yyval.ttype = access_public_virtual_node;
else if (yyvsp[-1].ttype == access_protected_node)
@@ -6275,9 +6276,9 @@ case 517:
;
break;}
case 518:
-#line 2340 "parse.y"
+#line 2341 "parse.y"
{ if (yyvsp[-1].ttype != ridpointers[(int)RID_VIRTUAL])
- cp_error ("`%D' access", yyvsp[-1].ttype);
+ cp_error (ec_access, yyvsp[-1].ttype);
else if (yyval.ttype == access_public_node)
yyval.ttype = access_public_virtual_node;
else if (yyval.ttype == access_protected_node)
@@ -6285,25 +6286,25 @@ case 518:
else if (yyval.ttype == access_private_node)
yyval.ttype = access_private_virtual_node;
else
- error ("multiple `virtual' specifiers");
+ cp_error (ec_multiple_virtual_specifiers);
;
break;}
case 519:
-#line 2355 "parse.y"
+#line 2356 "parse.y"
{ yyvsp[-1].ttype = begin_class_definition (yyvsp[-1].ttype); ;
break;}
case 520:
-#line 2360 "parse.y"
+#line 2361 "parse.y"
{
yyval.ttype = build_self_reference ();
;
break;}
case 521:
-#line 2367 "parse.y"
+#line 2368 "parse.y"
{ if (yyval.ttype) yyval.ttype = build_tree_list (access_public_node, yyval.ttype); ;
break;}
case 522:
-#line 2369 "parse.y"
+#line 2370 "parse.y"
{
if (current_aggr == signature_type_node)
yyval.ttype = build_tree_list (access_public_node, yyvsp[0].ttype);
@@ -6313,32 +6314,32 @@ case 522:
;
break;}
case 523:
-#line 2377 "parse.y"
+#line 2378 "parse.y"
{
tree visspec = yyvsp[-2].ttype;
if (current_aggr == signature_type_node)
{
- error ("access specifier not allowed in signature");
+ cp_error (ec_access_specifier_not_allowed_in_signature);
visspec = access_public_node;
}
yyval.ttype = chainon (yyval.ttype, build_tree_list (visspec, yyvsp[0].ttype));
;
break;}
case 524:
-#line 2388 "parse.y"
+#line 2389 "parse.y"
{
if (current_aggr == signature_type_node)
- error ("access specifier not allowed in signature");
+ cp_error (ec_access_specifier_not_allowed_in_signature);
;
break;}
case 525:
-#line 2398 "parse.y"
+#line 2399 "parse.y"
{ if (yyval.ttype == void_type_node) yyval.ttype = NULL_TREE;
;
break;}
case 526:
-#line 2401 "parse.y"
+#line 2402 "parse.y"
{ /* In pushdecl, we created a reverse list of names
in this binding level. Make sure that the chain
of what we're trying to add isn't the item itself
@@ -6353,95 +6354,95 @@ case 526:
;
break;}
case 527:
-#line 2417 "parse.y"
+#line 2418 "parse.y"
{ ;
break;}
case 528:
-#line 2419 "parse.y"
-{ error ("missing ';' before right brace");
+#line 2420 "parse.y"
+{ cp_error (ec_missing_before_right_brace);
yyungetc ('}', 0); ;
break;}
case 529:
-#line 2424 "parse.y"
+#line 2425 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
case 530:
-#line 2426 "parse.y"
+#line 2427 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
case 531:
-#line 2428 "parse.y"
+#line 2429 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
case 532:
-#line 2430 "parse.y"
+#line 2431 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
case 533:
-#line 2432 "parse.y"
+#line 2433 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 534:
-#line 2434 "parse.y"
+#line 2435 "parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 535:
-#line 2437 "parse.y"
+#line 2438 "parse.y"
{ yyval.ttype = finish_member_template_decl (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 536:
-#line 2439 "parse.y"
+#line 2440 "parse.y"
{ yyval.ttype = finish_member_class_template (yyvsp[-2].ttype, yyvsp[-1].ftype.t); ;
break;}
case 537:
-#line 2447 "parse.y"
+#line 2448 "parse.y"
{ yyval.ttype = grok_x_components (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 538:
-#line 2449 "parse.y"
+#line 2450 "parse.y"
{ yyval.ttype = grok_x_components (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 539:
-#line 2451 "parse.y"
+#line 2452 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
case 540:
-#line 2454 "parse.y"
+#line 2455 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
case 541:
-#line 2457 "parse.y"
+#line 2458 "parse.y"
{ yyval.ttype = grokbitfield (NULL_TREE, NULL_TREE, yyvsp[0].ttype); ;
break;}
case 542:
-#line 2459 "parse.y"
+#line 2460 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 543:
-#line 2470 "parse.y"
+#line 2471 "parse.y"
{ tree specs, attrs;
split_specs_attrs (yyvsp[-4].ttype, &specs, &attrs);
yyval.ttype = grokfield (yyvsp[-3].ttype, specs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, attrs)); ;
break;}
case 544:
-#line 2475 "parse.y"
+#line 2476 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
case 545:
-#line 2478 "parse.y"
+#line 2479 "parse.y"
{ yyval.ttype = do_class_using_decl (yyvsp[0].ttype); ;
break;}
case 546:
-#line 2484 "parse.y"
+#line 2485 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 548:
-#line 2487 "parse.y"
+#line 2488 "parse.y"
{
/* In this context, void_type_node encodes
friends. They have been recorded elsewhere. */
@@ -6452,11 +6453,11 @@ case 548:
;
break;}
case 549:
-#line 2499 "parse.y"
+#line 2500 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 551:
-#line 2502 "parse.y"
+#line 2503 "parse.y"
{
/* In this context, void_type_node encodes
friends. They have been recorded elsewhere. */
@@ -6467,7 +6468,7 @@ case 551:
;
break;}
case 556:
-#line 2524 "parse.y"
+#line 2525 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6475,7 +6476,7 @@ case 556:
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 557:
-#line 2530 "parse.y"
+#line 2531 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6483,7 +6484,7 @@ case 557:
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 558:
-#line 2539 "parse.y"
+#line 2540 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6491,7 +6492,7 @@ case 558:
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 559:
-#line 2545 "parse.y"
+#line 2546 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6499,7 +6500,7 @@ case 559:
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 560:
-#line 2551 "parse.y"
+#line 2552 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6507,7 +6508,7 @@ case 560:
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 561:
-#line 2557 "parse.y"
+#line 2558 "parse.y"
{ split_specs_attrs (yyvsp[-3].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-3].ttype = current_declspecs;
@@ -6515,128 +6516,128 @@ case 561:
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 562:
-#line 2566 "parse.y"
+#line 2567 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 563:
-#line 2569 "parse.y"
+#line 2570 "parse.y"
{ yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 564:
-#line 2575 "parse.y"
+#line 2576 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 565:
-#line 2578 "parse.y"
+#line 2579 "parse.y"
{ yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 566:
-#line 2581 "parse.y"
+#line 2582 "parse.y"
{ yyval.ttype = grokbitfield (NULL_TREE, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 568:
-#line 2592 "parse.y"
+#line 2593 "parse.y"
{ TREE_CHAIN (yyvsp[0].ttype) = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
case 569:
-#line 2597 "parse.y"
+#line 2598 "parse.y"
{ yyval.ttype = build_enumerator (yyval.ttype, NULL_TREE, current_enum_type); ;
break;}
case 570:
-#line 2599 "parse.y"
+#line 2600 "parse.y"
{ yyval.ttype = build_enumerator (yyval.ttype, yyvsp[0].ttype, current_enum_type); ;
break;}
case 571:
-#line 2605 "parse.y"
+#line 2606 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 572:
-#line 2608 "parse.y"
+#line 2609 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[0].ftype.t, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 573:
-#line 2615 "parse.y"
+#line 2616 "parse.y"
{
if (pedantic)
- pedwarn ("ANSI C++ forbids array dimensions with parenthesized type in new");
+ cp_pedwarn (ec_forbids_array_dimensions_with_parenthesized_type_in_new);
yyval.ftype.t = build_parse_node (ARRAY_REF, TREE_VALUE (yyvsp[-4].ftype.t), yyvsp[-1].ttype);
yyval.ftype.t = build_decl_list (TREE_PURPOSE (yyvsp[-4].ftype.t), yyval.ftype.t);
yyval.ftype.new_type_flag = yyvsp[-4].ftype.new_type_flag;
;
break;}
case 574:
-#line 2626 "parse.y"
+#line 2627 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 575:
-#line 2628 "parse.y"
+#line 2629 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
case 576:
-#line 2633 "parse.y"
+#line 2634 "parse.y"
{ yyval.ftype.t = IDENTIFIER_AS_LIST (yyvsp[0].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
case 577:
-#line 2636 "parse.y"
+#line 2637 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 578:
-#line 2645 "parse.y"
+#line 2646 "parse.y"
{ yyval.itype = suspend_momentary (); ;
break;}
case 579:
-#line 2650 "parse.y"
+#line 2651 "parse.y"
{ resume_momentary ((int) yyvsp[-1].itype); yyval.ttype = yyvsp[0].ttype; ;
break;}
case 580:
-#line 2656 "parse.y"
+#line 2657 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 581:
-#line 2658 "parse.y"
+#line 2659 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 582:
-#line 2660 "parse.y"
+#line 2661 "parse.y"
{ resume_momentary ((int) yyvsp[-1].itype); yyval.ttype = empty_parms (); ;
break;}
case 583:
-#line 2662 "parse.y"
+#line 2663 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = NULL_TREE; ;
break;}
case 584:
-#line 2669 "parse.y"
+#line 2670 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 585:
-#line 2671 "parse.y"
+#line 2672 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 586:
-#line 2673 "parse.y"
+#line 2674 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 587:
-#line 2675 "parse.y"
+#line 2676 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 588:
-#line 2677 "parse.y"
+#line 2678 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 590:
-#line 2685 "parse.y"
+#line 2686 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
{
@@ -6655,7 +6656,7 @@ case 590:
;
break;}
case 591:
-#line 2702 "parse.y"
+#line 2703 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
yyval.ttype = IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype);
@@ -6665,152 +6666,152 @@ case 591:
;
break;}
case 594:
-#line 2715 "parse.y"
+#line 2716 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 595:
-#line 2720 "parse.y"
+#line 2721 "parse.y"
{ yyval.ttype = get_type_decl (yyvsp[0].ttype); ;
break;}
case 596:
-#line 2725 "parse.y"
+#line 2726 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 597:
-#line 2727 "parse.y"
+#line 2728 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 598:
-#line 2729 "parse.y"
+#line 2730 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
case 599:
-#line 2731 "parse.y"
+#line 2732 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 600:
-#line 2733 "parse.y"
+#line 2734 "parse.y"
{ push_nested_class (yyvsp[-1].ttype, 3);
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype);
TREE_COMPLEXITY (yyval.ttype) = current_class_depth; ;
break;}
case 602:
-#line 2744 "parse.y"
+#line 2745 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 603:
-#line 2746 "parse.y"
+#line 2747 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 604:
-#line 2748 "parse.y"
+#line 2749 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 605:
-#line 2750 "parse.y"
+#line 2751 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 606:
-#line 2752 "parse.y"
+#line 2753 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 608:
-#line 2760 "parse.y"
+#line 2761 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 609:
-#line 2762 "parse.y"
+#line 2763 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 610:
-#line 2764 "parse.y"
+#line 2765 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 611:
-#line 2766 "parse.y"
+#line 2767 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 612:
-#line 2768 "parse.y"
+#line 2769 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 614:
-#line 2776 "parse.y"
+#line 2777 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 615:
-#line 2778 "parse.y"
+#line 2779 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 616:
-#line 2780 "parse.y"
+#line 2781 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 617:
-#line 2782 "parse.y"
+#line 2783 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
case 618:
-#line 2784 "parse.y"
+#line 2785 "parse.y"
{ enter_scope_of (yyvsp[0].ttype); ;
break;}
case 619:
-#line 2786 "parse.y"
+#line 2787 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype);
enter_scope_of (yyval.ttype);
;
break;}
case 620:
-#line 2794 "parse.y"
+#line 2795 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 621:
-#line 2797 "parse.y"
+#line 2798 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 622:
-#line 2803 "parse.y"
+#line 2804 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 623:
-#line 2806 "parse.y"
+#line 2807 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 625:
-#line 2813 "parse.y"
+#line 2814 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 626:
-#line 2818 "parse.y"
+#line 2819 "parse.y"
{ yyval.ttype = build_functional_cast (yyvsp[-3].ftype.t, yyvsp[-1].ttype); ;
break;}
case 627:
-#line 2820 "parse.y"
+#line 2821 "parse.y"
{ yyval.ttype = reparse_decl_as_expr (yyvsp[-3].ftype.t, yyvsp[-1].ttype); ;
break;}
case 628:
-#line 2822 "parse.y"
+#line 2823 "parse.y"
{ yyval.ttype = reparse_absdcl_as_expr (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 633:
-#line 2833 "parse.y"
+#line 2834 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 634:
-#line 2835 "parse.y"
+#line 2836 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 635:
-#line 2842 "parse.y"
+#line 2843 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE)
{
@@ -6826,7 +6827,7 @@ case 635:
;
break;}
case 636:
-#line 2856 "parse.y"
+#line 2857 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6834,7 +6835,7 @@ case 636:
;
break;}
case 637:
-#line 2862 "parse.y"
+#line 2863 "parse.y"
{
if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6842,20 +6843,20 @@ case 637:
;
break;}
case 638:
-#line 2868 "parse.y"
+#line 2869 "parse.y"
{ got_scope = yyval.ttype = complete_type (TREE_TYPE (yyvsp[-1].ttype)); ;
break;}
case 640:
-#line 2884 "parse.y"
+#line 2885 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 641:
-#line 2889 "parse.y"
+#line 2890 "parse.y"
{
if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype);
else if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
- cp_error ("`%T' is not a class or namespace", yyvsp[0].ttype);
+ cp_error (ec_is_not_a_class_or_namespace, yyvsp[0].ttype);
else
{
yyval.ttype = yyvsp[0].ttype;
@@ -6865,31 +6866,31 @@ case 641:
;
break;}
case 642:
-#line 2902 "parse.y"
+#line 2903 "parse.y"
{ yyval.ttype = TREE_TYPE (yyvsp[0].ttype); ;
break;}
case 643:
-#line 2904 "parse.y"
+#line 2905 "parse.y"
{ yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 644:
-#line 2906 "parse.y"
+#line 2907 "parse.y"
{ yyval.ttype = make_typename_type (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 645:
-#line 2911 "parse.y"
+#line 2912 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
- cp_error ("`%T' is not a class or namespace", yyvsp[0].ttype);
+ cp_error (ec_is_not_a_class_or_namespace, yyvsp[0].ttype);
;
break;}
case 646:
-#line 2916 "parse.y"
+#line 2917 "parse.y"
{
if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype);
else if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
- cp_error ("`%T' is not a class or namespace", yyvsp[0].ttype);
+ cp_error (ec_is_not_a_class_or_namespace, yyvsp[0].ttype);
else
{
yyval.ttype = yyvsp[0].ttype;
@@ -6899,15 +6900,15 @@ case 646:
;
break;}
case 647:
-#line 2929 "parse.y"
+#line 2930 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 648:
-#line 2931 "parse.y"
+#line 2932 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 649:
-#line 2936 "parse.y"
+#line 2937 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) != IDENTIFIER_NODE)
yyvsp[-1].ttype = lastiddecl;
@@ -6917,11 +6918,11 @@ case 649:
got_scope = yyval.ttype = complete_type (IDENTIFIER_TYPE_VALUE (yyvsp[-1].ttype));
if (yyval.ttype == error_mark_node)
- cp_error ("`%T' is not a class or namespace", yyvsp[-1].ttype);
+ cp_error (ec_is_not_a_class_or_namespace, yyvsp[-1].ttype);
;
break;}
case 650:
-#line 2948 "parse.y"
+#line 2949 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) != IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6929,11 +6930,11 @@ case 650:
;
break;}
case 651:
-#line 2954 "parse.y"
+#line 2955 "parse.y"
{ got_scope = yyval.ttype = complete_type (TREE_TYPE (yyval.ttype)); ;
break;}
case 654:
-#line 2958 "parse.y"
+#line 2959 "parse.y"
{
if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6941,11 +6942,11 @@ case 654:
;
break;}
case 655:
-#line 2967 "parse.y"
+#line 2968 "parse.y"
{ yyval.ttype = build_min_nt (TEMPLATE_ID_EXPR, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 656:
-#line 2972 "parse.y"
+#line 2973 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
yyval.ttype = IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype);
@@ -6955,148 +6956,148 @@ case 656:
;
break;}
case 658:
-#line 2981 "parse.y"
+#line 2982 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 659:
-#line 2986 "parse.y"
+#line 2987 "parse.y"
{ got_scope = NULL_TREE; ;
break;}
case 660:
-#line 2988 "parse.y"
+#line 2989 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; got_scope = NULL_TREE; ;
break;}
case 661:
-#line 2995 "parse.y"
+#line 2996 "parse.y"
{ got_scope = void_type_node; ;
break;}
case 662:
-#line 3001 "parse.y"
+#line 3002 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 663:
-#line 3003 "parse.y"
+#line 3004 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 664:
-#line 3005 "parse.y"
+#line 3006 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 665:
-#line 3007 "parse.y"
+#line 3008 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 666:
-#line 3009 "parse.y"
+#line 3010 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, arg);
;
break;}
case 667:
-#line 3013 "parse.y"
+#line 3014 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 669:
-#line 3022 "parse.y"
+#line 3023 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 670:
-#line 3024 "parse.y"
+#line 3025 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 671:
-#line 3030 "parse.y"
+#line 3031 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 672:
-#line 3032 "parse.y"
+#line 3033 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 673:
-#line 3034 "parse.y"
+#line 3035 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ftype.t, NULL_TREE); ;
break;}
case 674:
-#line 3036 "parse.y"
+#line 3037 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, NULL_TREE); ;
break;}
case 675:
-#line 3038 "parse.y"
+#line 3039 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 676:
-#line 3040 "parse.y"
+#line 3041 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 677:
-#line 3042 "parse.y"
+#line 3043 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[0].ftype.t, NULL_TREE); ;
break;}
case 678:
-#line 3044 "parse.y"
+#line 3045 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, NULL_TREE); ;
break;}
case 679:
-#line 3046 "parse.y"
+#line 3047 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, arg);
;
break;}
case 680:
-#line 3050 "parse.y"
+#line 3051 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 682:
-#line 3059 "parse.y"
+#line 3060 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 684:
-#line 3063 "parse.y"
+#line 3064 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 685:
-#line 3065 "parse.y"
+#line 3066 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 686:
-#line 3067 "parse.y"
+#line 3068 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 687:
-#line 3069 "parse.y"
+#line 3070 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
case 688:
-#line 3071 "parse.y"
+#line 3072 "parse.y"
{ yyval.ttype = make_call_declarator (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 689:
-#line 3073 "parse.y"
+#line 3074 "parse.y"
{ set_quals_and_spec (yyval.ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 690:
-#line 3075 "parse.y"
+#line 3076 "parse.y"
{ set_quals_and_spec (yyval.ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 691:
-#line 3077 "parse.y"
+#line 3078 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 692:
-#line 3079 "parse.y"
+#line 3080 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, NULL_TREE); ;
break;}
case 699:
-#line 3102 "parse.y"
+#line 3103 "parse.y"
{ if (pedantic)
- pedwarn ("ANSI C++ forbids label declarations"); ;
+ cp_pedwarn (ec_forbids_label_declarations); ;
break;}
case 702:
-#line 3113 "parse.y"
+#line 3114 "parse.y"
{ tree link;
for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link))
{
@@ -7107,211 +7108,211 @@ case 702:
;
break;}
case 703:
-#line 3127 "parse.y"
+#line 3128 "parse.y"
{;
break;}
case 705:
-#line 3133 "parse.y"
+#line 3134 "parse.y"
{ yyval.ttype = begin_compound_stmt (0); ;
break;}
case 706:
-#line 3135 "parse.y"
+#line 3136 "parse.y"
{ yyval.ttype = finish_compound_stmt (0, yyvsp[-1].ttype); ;
break;}
case 707:
-#line 3140 "parse.y"
+#line 3141 "parse.y"
{
yyval.ttype = begin_if_stmt ();
cond_stmt_keyword = "if";
;
break;}
case 708:
-#line 3145 "parse.y"
+#line 3146 "parse.y"
{ finish_if_stmt_cond (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 709:
-#line 3147 "parse.y"
+#line 3148 "parse.y"
{ yyval.ttype = finish_then_clause (yyvsp[-3].ttype); ;
break;}
case 711:
-#line 3152 "parse.y"
+#line 3153 "parse.y"
{ yyval.ttype = begin_compound_stmt (0); ;
break;}
case 712:
-#line 3154 "parse.y"
+#line 3155 "parse.y"
{ yyval.ttype = finish_compound_stmt (0, yyvsp[-1].ttype); ;
break;}
case 713:
-#line 3159 "parse.y"
+#line 3160 "parse.y"
{;
break;}
case 715:
-#line 3165 "parse.y"
+#line 3166 "parse.y"
{ finish_stmt (); ;
break;}
case 716:
-#line 3167 "parse.y"
+#line 3168 "parse.y"
{ finish_expr_stmt (yyvsp[-1].ttype); ;
break;}
case 717:
-#line 3169 "parse.y"
+#line 3170 "parse.y"
{ begin_else_clause (); ;
break;}
case 718:
-#line 3171 "parse.y"
+#line 3172 "parse.y"
{
finish_else_clause (yyvsp[-3].ttype);
finish_if_stmt ();
;
break;}
case 719:
-#line 3176 "parse.y"
+#line 3177 "parse.y"
{ finish_if_stmt (); ;
break;}
case 720:
-#line 3178 "parse.y"
+#line 3179 "parse.y"
{
yyval.ttype = begin_while_stmt ();
cond_stmt_keyword = "while";
;
break;}
case 721:
-#line 3183 "parse.y"
+#line 3184 "parse.y"
{ finish_while_stmt_cond (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 722:
-#line 3185 "parse.y"
+#line 3186 "parse.y"
{ finish_while_stmt (yyvsp[-3].ttype); ;
break;}
case 723:
-#line 3187 "parse.y"
+#line 3188 "parse.y"
{ yyval.ttype = begin_do_stmt (); ;
break;}
case 724:
-#line 3189 "parse.y"
+#line 3190 "parse.y"
{
finish_do_body (yyvsp[-2].ttype);
cond_stmt_keyword = "do";
;
break;}
case 725:
-#line 3194 "parse.y"
+#line 3195 "parse.y"
{ finish_do_stmt (yyvsp[-1].ttype, yyvsp[-5].ttype); ;
break;}
case 726:
-#line 3196 "parse.y"
+#line 3197 "parse.y"
{ yyval.ttype = begin_for_stmt (); ;
break;}
case 727:
-#line 3198 "parse.y"
+#line 3199 "parse.y"
{ finish_for_init_stmt (yyvsp[-2].ttype); ;
break;}
case 728:
-#line 3200 "parse.y"
+#line 3201 "parse.y"
{ finish_for_cond (yyvsp[-1].ttype, yyvsp[-5].ttype); ;
break;}
case 729:
-#line 3202 "parse.y"
+#line 3203 "parse.y"
{ finish_for_expr (yyvsp[-1].ttype, yyvsp[-8].ttype); ;
break;}
case 730:
-#line 3204 "parse.y"
+#line 3205 "parse.y"
{ finish_for_stmt (yyvsp[-3].ttype, yyvsp[-10].ttype); ;
break;}
case 731:
-#line 3206 "parse.y"
+#line 3207 "parse.y"
{ begin_switch_stmt (); ;
break;}
case 732:
-#line 3208 "parse.y"
+#line 3209 "parse.y"
{ yyval.ttype = finish_switch_cond (yyvsp[-1].ttype); ;
break;}
case 733:
-#line 3210 "parse.y"
+#line 3211 "parse.y"
{ finish_switch_stmt (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 734:
-#line 3212 "parse.y"
+#line 3213 "parse.y"
{ finish_case_label (yyvsp[-1].ttype, NULL_TREE); ;
break;}
case 736:
-#line 3215 "parse.y"
+#line 3216 "parse.y"
{ finish_case_label (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 738:
-#line 3218 "parse.y"
+#line 3219 "parse.y"
{ finish_case_label (NULL_TREE, NULL_TREE); ;
break;}
case 740:
-#line 3221 "parse.y"
+#line 3222 "parse.y"
{ finish_break_stmt (); ;
break;}
case 741:
-#line 3223 "parse.y"
+#line 3224 "parse.y"
{ finish_continue_stmt (); ;
break;}
case 742:
-#line 3225 "parse.y"
+#line 3226 "parse.y"
{ finish_return_stmt (NULL_TREE); ;
break;}
case 743:
-#line 3227 "parse.y"
+#line 3228 "parse.y"
{ finish_return_stmt (yyvsp[-1].ttype); ;
break;}
case 744:
-#line 3229 "parse.y"
+#line 3230 "parse.y"
{
finish_asm_stmt (yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE, NULL_TREE,
NULL_TREE);
;
break;}
case 745:
-#line 3235 "parse.y"
+#line 3236 "parse.y"
{
finish_asm_stmt (yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE,
NULL_TREE);
;
break;}
case 746:
-#line 3241 "parse.y"
+#line 3242 "parse.y"
{ finish_asm_stmt (yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 747:
-#line 3245 "parse.y"
+#line 3246 "parse.y"
{ finish_asm_stmt (yyvsp[-10].ttype, yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype); ;
break;}
case 748:
-#line 3247 "parse.y"
+#line 3248 "parse.y"
{
if (pedantic)
- pedwarn ("ANSI C++ forbids computed gotos");
+ cp_pedwarn (ec_forbids_computed_gotos);
finish_goto_stmt (yyvsp[-1].ttype);
;
break;}
case 749:
-#line 3253 "parse.y"
+#line 3254 "parse.y"
{ finish_goto_stmt (yyvsp[-1].ttype); ;
break;}
case 750:
-#line 3255 "parse.y"
+#line 3256 "parse.y"
{ finish_stmt (); ;
break;}
case 751:
-#line 3257 "parse.y"
-{ error ("label must be followed by statement");
+#line 3258 "parse.y"
+{ cp_error (ec_label_must_be_followed_by_statement);
yyungetc ('}', 0);
finish_stmt (); ;
break;}
case 752:
-#line 3261 "parse.y"
+#line 3262 "parse.y"
{ finish_stmt (); ;
break;}
case 755:
-#line 3265 "parse.y"
+#line 3266 "parse.y"
{ do_local_using_decl (yyvsp[0].ttype); ;
break;}
case 757:
-#line 3271 "parse.y"
+#line 3272 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
@@ -7319,13 +7320,13 @@ case 757:
;
break;}
case 758:
-#line 3277 "parse.y"
+#line 3278 "parse.y"
{
expand_start_all_catch ();
;
break;}
case 759:
-#line 3281 "parse.y"
+#line 3282 "parse.y"
{
int nested = (hack_decl_function_context
(current_function_decl) != NULL_TREE);
@@ -7334,41 +7335,41 @@ case 759:
;
break;}
case 760:
-#line 3291 "parse.y"
+#line 3292 "parse.y"
{ yyval.ttype = begin_try_block (); ;
break;}
case 761:
-#line 3293 "parse.y"
+#line 3294 "parse.y"
{ finish_try_block (yyvsp[-1].ttype); ;
break;}
case 762:
-#line 3295 "parse.y"
+#line 3296 "parse.y"
{ finish_handler_sequence (yyvsp[-3].ttype); ;
break;}
case 765:
-#line 3305 "parse.y"
+#line 3306 "parse.y"
{ yyval.ttype = begin_handler(); ;
break;}
case 766:
-#line 3307 "parse.y"
+#line 3308 "parse.y"
{ finish_handler_parms (yyvsp[-1].ttype); ;
break;}
case 767:
-#line 3309 "parse.y"
+#line 3310 "parse.y"
{ finish_handler (yyvsp[-3].ttype); ;
break;}
case 770:
-#line 3319 "parse.y"
+#line 3320 "parse.y"
{ expand_start_catch_block (NULL_TREE, NULL_TREE); ;
break;}
case 771:
-#line 3335 "parse.y"
+#line 3336 "parse.y"
{ check_for_new_type ("inside exception declarations", yyvsp[-1].ftype);
expand_start_catch_block (TREE_PURPOSE (yyvsp[-1].ftype.t),
TREE_VALUE (yyvsp[-1].ftype.t)); ;
break;}
case 772:
-#line 3342 "parse.y"
+#line 3343 "parse.y"
{ tree label;
do_label:
label = define_label (input_filename, lineno, yyvsp[-1].ttype);
@@ -7377,98 +7378,98 @@ case 772:
;
break;}
case 773:
-#line 3349 "parse.y"
+#line 3350 "parse.y"
{ goto do_label; ;
break;}
case 774:
-#line 3351 "parse.y"
+#line 3352 "parse.y"
{ goto do_label; ;
break;}
case 775:
-#line 3353 "parse.y"
+#line 3354 "parse.y"
{ goto do_label; ;
break;}
case 776:
-#line 3358 "parse.y"
+#line 3359 "parse.y"
{ if (yyvsp[-1].ttype) cplus_expand_expr_stmt (yyvsp[-1].ttype); ;
break;}
case 778:
-#line 3361 "parse.y"
+#line 3362 "parse.y"
{ if (pedantic)
- pedwarn ("ANSI C++ forbids compound statements inside for initializations");
+ cp_pedwarn (ec_forbids_compound_statements_inside_for_initializations);
;
break;}
case 779:
-#line 3370 "parse.y"
+#line 3371 "parse.y"
{ emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ;
break;}
case 780:
-#line 3373 "parse.y"
+#line 3374 "parse.y"
{ emit_line_note (input_filename, lineno); ;
break;}
case 781:
-#line 3378 "parse.y"
+#line 3379 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 783:
-#line 3381 "parse.y"
+#line 3382 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 784:
-#line 3388 "parse.y"
+#line 3389 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 787:
-#line 3395 "parse.y"
+#line 3396 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 788:
-#line 3400 "parse.y"
+#line 3401 "parse.y"
{ yyval.ttype = build_tree_list (yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 789:
-#line 3405 "parse.y"
+#line 3406 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyval.ttype, NULL_TREE); ;
break;}
case 790:
-#line 3407 "parse.y"
+#line 3408 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
case 791:
-#line 3418 "parse.y"
+#line 3419 "parse.y"
{
yyval.ttype = empty_parms();
;
break;}
case 793:
-#line 3423 "parse.y"
+#line 3424 "parse.y"
{ yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[0].ftype.t), 0);
check_for_new_type ("inside parameter list", yyvsp[0].ftype); ;
break;}
case 794:
-#line 3431 "parse.y"
+#line 3432 "parse.y"
{ yyval.ttype = finish_parmlist (yyval.ttype, 0); ;
break;}
case 795:
-#line 3433 "parse.y"
+#line 3434 "parse.y"
{ yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ;
break;}
case 796:
-#line 3436 "parse.y"
+#line 3437 "parse.y"
{ yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ;
break;}
case 797:
-#line 3438 "parse.y"
+#line 3439 "parse.y"
{ yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE,
yyvsp[-1].ftype.t), 1); ;
break;}
case 798:
-#line 3441 "parse.y"
+#line 3442 "parse.y"
{ yyval.ttype = finish_parmlist (NULL_TREE, 1); ;
break;}
case 799:
-#line 3443 "parse.y"
+#line 3444 "parse.y"
{
/* This helps us recover from really nasty
parse errors, for example, a missing right
@@ -7480,7 +7481,7 @@ case 799:
;
break;}
case 800:
-#line 3453 "parse.y"
+#line 3454 "parse.y"
{
/* This helps us recover from really nasty
parse errors, for example, a missing right
@@ -7493,290 +7494,292 @@ case 800:
;
break;}
case 801:
-#line 3468 "parse.y"
+#line 3469 "parse.y"
{ maybe_snarf_defarg (); ;
break;}
case 802:
-#line 3470 "parse.y"
+#line 3471 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 805:
-#line 3481 "parse.y"
+#line 3482 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;}
case 806:
-#line 3484 "parse.y"
+#line 3485 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t); ;
break;}
case 807:
-#line 3487 "parse.y"
+#line 3488 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = chainon (yyval.ttype, yyvsp[0].ftype.t); ;
break;}
case 808:
-#line 3490 "parse.y"
+#line 3491 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 809:
-#line 3492 "parse.y"
+#line 3493 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (yyvsp[0].ttype, yyvsp[-2].ttype)); ;
break;}
case 811:
-#line 3498 "parse.y"
+#line 3499 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t); ;
break;}
case 812:
-#line 3508 "parse.y"
+#line 3509 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag;
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype); ;
break;}
case 813:
-#line 3512 "parse.y"
+#line 3513 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 814:
-#line 3515 "parse.y"
+#line 3516 "parse.y"
{ yyval.ftype.t = build_tree_list (get_decl_list (yyvsp[-1].ftype.t), yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 815:
-#line 3518 "parse.y"
+#line 3519 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 816:
-#line 3522 "parse.y"
+#line 3523 "parse.y"
{ tree specs = strip_attrs (yyvsp[0].ftype.t);
yyval.ftype.t = build_tree_list (specs, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 817:
-#line 3526 "parse.y"
+#line 3527 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
case 818:
-#line 3533 "parse.y"
+#line 3534 "parse.y"
{ yyval.ftype.t = build_tree_list (NULL_TREE, yyvsp[0].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 819:
-#line 3536 "parse.y"
+#line 3537 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 822:
-#line 3547 "parse.y"
+#line 3548 "parse.y"
{ see_typename (); ;
break;}
case 823:
-#line 3552 "parse.y"
+#line 3553 "parse.y"
{
- error ("type specifier omitted for parameter");
+ cp_error (ec_type_specifier_omitted_for_parameter);
yyval.ttype = build_tree_list (integer_type_node, NULL_TREE);
;
break;}
case 824:
-#line 3557 "parse.y"
+#line 3558 "parse.y"
{
- error ("type specifier omitted for parameter");
+ cp_error (ec_type_specifier_omitted_for_parameter);
if (TREE_CODE (yyval.ttype) == SCOPE_REF
&& (TREE_CODE (TREE_OPERAND (yyval.ttype, 0)) == TEMPLATE_TYPE_PARM
|| TREE_CODE (TREE_OPERAND (yyval.ttype, 0)) == TEMPLATE_TEMPLATE_PARM))
- cp_error (" perhaps you want `typename %E' to make it a type", yyval.ttype);
+ cp_error
+ (ec_perhaps_you_want_typename_expr_to_make_it_a_type,
+ yyval.ttype);
yyval.ttype = build_tree_list (integer_type_node, yyval.ttype);
;
break;}
case 825:
-#line 3569 "parse.y"
+#line 3572 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 826:
-#line 3571 "parse.y"
+#line 3574 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 827:
-#line 3573 "parse.y"
+#line 3576 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, NULL_TREE); ;
break;}
case 828:
-#line 3578 "parse.y"
+#line 3581 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, groktypename(yyvsp[0].ftype.t)); ;
break;}
case 830:
-#line 3584 "parse.y"
+#line 3587 "parse.y"
{
TREE_CHAIN (yyvsp[0].ttype) = yyval.ttype;
yyval.ttype = yyvsp[0].ttype;
;
break;}
case 831:
-#line 3592 "parse.y"
+#line 3595 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 832:
-#line 3594 "parse.y"
+#line 3597 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 833:
-#line 3596 "parse.y"
+#line 3599 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 834:
-#line 3598 "parse.y"
+#line 3601 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 835:
-#line 3605 "parse.y"
+#line 3608 "parse.y"
{ got_scope = NULL_TREE; ;
break;}
case 836:
-#line 3610 "parse.y"
+#line 3613 "parse.y"
{ yyval.ttype = ansi_opname[MULT_EXPR]; ;
break;}
case 837:
-#line 3612 "parse.y"
+#line 3615 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_DIV_EXPR]; ;
break;}
case 838:
-#line 3614 "parse.y"
+#line 3617 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_MOD_EXPR]; ;
break;}
case 839:
-#line 3616 "parse.y"
+#line 3619 "parse.y"
{ yyval.ttype = ansi_opname[PLUS_EXPR]; ;
break;}
case 840:
-#line 3618 "parse.y"
+#line 3621 "parse.y"
{ yyval.ttype = ansi_opname[MINUS_EXPR]; ;
break;}
case 841:
-#line 3620 "parse.y"
+#line 3623 "parse.y"
{ yyval.ttype = ansi_opname[BIT_AND_EXPR]; ;
break;}
case 842:
-#line 3622 "parse.y"
+#line 3625 "parse.y"
{ yyval.ttype = ansi_opname[BIT_IOR_EXPR]; ;
break;}
case 843:
-#line 3624 "parse.y"
+#line 3627 "parse.y"
{ yyval.ttype = ansi_opname[BIT_XOR_EXPR]; ;
break;}
case 844:
-#line 3626 "parse.y"
+#line 3629 "parse.y"
{ yyval.ttype = ansi_opname[BIT_NOT_EXPR]; ;
break;}
case 845:
-#line 3628 "parse.y"
+#line 3631 "parse.y"
{ yyval.ttype = ansi_opname[COMPOUND_EXPR]; ;
break;}
case 846:
-#line 3630 "parse.y"
+#line 3633 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 847:
-#line 3632 "parse.y"
+#line 3635 "parse.y"
{ yyval.ttype = ansi_opname[LT_EXPR]; ;
break;}
case 848:
-#line 3634 "parse.y"
+#line 3637 "parse.y"
{ yyval.ttype = ansi_opname[GT_EXPR]; ;
break;}
case 849:
-#line 3636 "parse.y"
+#line 3639 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 850:
-#line 3638 "parse.y"
+#line 3641 "parse.y"
{ yyval.ttype = ansi_assopname[yyvsp[0].code]; ;
break;}
case 851:
-#line 3640 "parse.y"
+#line 3643 "parse.y"
{ yyval.ttype = ansi_opname [MODIFY_EXPR]; ;
break;}
case 852:
-#line 3642 "parse.y"
+#line 3645 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 853:
-#line 3644 "parse.y"
+#line 3647 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 854:
-#line 3646 "parse.y"
+#line 3649 "parse.y"
{ yyval.ttype = ansi_opname[POSTINCREMENT_EXPR]; ;
break;}
case 855:
-#line 3648 "parse.y"
+#line 3651 "parse.y"
{ yyval.ttype = ansi_opname[PREDECREMENT_EXPR]; ;
break;}
case 856:
-#line 3650 "parse.y"
+#line 3653 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ANDIF_EXPR]; ;
break;}
case 857:
-#line 3652 "parse.y"
+#line 3655 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ORIF_EXPR]; ;
break;}
case 858:
-#line 3654 "parse.y"
+#line 3657 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_NOT_EXPR]; ;
break;}
case 859:
-#line 3656 "parse.y"
+#line 3659 "parse.y"
{ yyval.ttype = ansi_opname[COND_EXPR]; ;
break;}
case 860:
-#line 3658 "parse.y"
+#line 3661 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 861:
-#line 3660 "parse.y"
+#line 3663 "parse.y"
{ yyval.ttype = ansi_opname[COMPONENT_REF]; ;
break;}
case 862:
-#line 3662 "parse.y"
+#line 3665 "parse.y"
{ yyval.ttype = ansi_opname[MEMBER_REF]; ;
break;}
case 863:
-#line 3664 "parse.y"
+#line 3667 "parse.y"
{ yyval.ttype = ansi_opname[CALL_EXPR]; ;
break;}
case 864:
-#line 3666 "parse.y"
+#line 3669 "parse.y"
{ yyval.ttype = ansi_opname[ARRAY_REF]; ;
break;}
case 865:
-#line 3668 "parse.y"
+#line 3671 "parse.y"
{ yyval.ttype = ansi_opname[NEW_EXPR]; ;
break;}
case 866:
-#line 3670 "parse.y"
+#line 3673 "parse.y"
{ yyval.ttype = ansi_opname[DELETE_EXPR]; ;
break;}
case 867:
-#line 3672 "parse.y"
+#line 3675 "parse.y"
{ yyval.ttype = ansi_opname[VEC_NEW_EXPR]; ;
break;}
case 868:
-#line 3674 "parse.y"
+#line 3677 "parse.y"
{ yyval.ttype = ansi_opname[VEC_DELETE_EXPR]; ;
break;}
case 869:
-#line 3677 "parse.y"
+#line 3680 "parse.y"
{ yyval.ttype = grokoptypename (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 870:
-#line 3679 "parse.y"
+#line 3682 "parse.y"
{ yyval.ttype = ansi_opname[ERROR_MARK]; ;
break;}
}
@@ -7977,7 +7980,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 3682 "parse.y"
+#line 3685 "parse.y"
#ifdef SPEW_DEBUG
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 5bc8cb0..31fb885 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -489,7 +489,8 @@ extern_lang_string:
{ push_lang_context ($1); }
| extern_lang_string EXTERN_LANG_STRING
{ if (current_lang_name != $2)
- cp_error ("use of linkage spec `%D' is different from previous spec `%D'", $2, current_lang_name);
+ cp_error
+ (ec_use_of_linkage_spec_is_different_from_previous_spec, $2, current_lang_name);
pop_lang_context (); push_lang_context ($2); }
;
@@ -552,7 +553,7 @@ template_parm:
&& TREE_CODE ($3) != TEMPLATE_TEMPLATE_PARM
&& TREE_CODE ($3) != TYPE_DECL)
{
- error ("invalid default template argument");
+ cp_error (ec_invalid_default_template_argument);
$3 = error_mark_node;
}
$$ = build_tree_list ($3, $1);
@@ -601,7 +602,7 @@ datadef:
| typed_declspecs initdecls ';'
{ note_list_got_semicolon ($1.t); }
| declmods ';'
- { pedwarn ("empty declaration"); }
+ { cp_pedwarn (ec_empty_declaration); }
| explicit_instantiation ';'
| typed_declspecs ';'
{
@@ -757,7 +758,7 @@ base_init:
':' .set_base_init member_init_list
{
if ($3 == 0)
- error ("no base initializers given following ':'");
+ cp_error (ec_no_base_initializers_given_following);
setup_vtbl_ptr ();
/* Always keep the BLOCK node associated with the outermost
pair of curley braces of a function. These are needed
@@ -780,9 +781,9 @@ base_init:
expand_start_bindings (0);
}
else if (current_class_type == NULL_TREE)
- error ("base initializers not allowed for non-member functions");
+ cp_error (ec_base_initializers_not_allowed_for_nonmember_functions);
else if (! DECL_CONSTRUCTOR_P (current_function_decl))
- error ("only constructors take base initializers");
+ cp_error (ec_only_constructors_take_base_initializers);
}
;
@@ -799,13 +800,13 @@ member_init:
'(' nonnull_exprlist ')'
{
if (current_class_name)
- pedwarn ("anachronistic old style base class initializer");
+ cp_pedwarn (ec_anachronistic_old_style_base_class_initializer);
expand_member_init (current_class_ref, NULL_TREE, $2);
}
| LEFT_RIGHT
{
if (current_class_name)
- pedwarn ("anachronistic old style base class initializer");
+ cp_pedwarn (ec_anachronistic_old_style_base_class_initializer);
expand_member_init (current_class_ref, NULL_TREE, void_type_node);
}
| notype_identifier '(' nonnull_exprlist ')'
@@ -916,7 +917,7 @@ template_close_bracket:
| RSHIFT
{
/* Handle `Class<Class<Type>>' without space in the `>>' */
- pedwarn ("`>>' should be `> >' in template class name");
+ cp_pedwarn (ec_should_be_in_template_class_name);
yyungetc ('>', 1);
}
;
@@ -963,7 +964,7 @@ expr:
paren_expr_or_null:
LEFT_RIGHT
- { error ("ANSI C++ forbids an empty condition for `%s'",
+ { cp_error (ec_forbids_an_empty_condition_for_s,
cond_stmt_keyword);
$$ = integer_zero_node; }
| '(' expr ')'
@@ -972,7 +973,7 @@ paren_expr_or_null:
paren_cond_or_null:
LEFT_RIGHT
- { error ("ANSI C++ forbids an empty condition for `%s'",
+ { cp_error (ec_forbids_an_empty_condition_for_s,
cond_stmt_keyword);
$$ = integer_zero_node; }
| '(' condition ')'
@@ -995,9 +996,9 @@ condition:
if (TREE_CODE (d) == TYPE_DECL) {
tree s = TREE_TYPE (d);
if (TREE_CODE (s) == RECORD_TYPE)
- cp_error ("definition of class `%T' in condition", s);
+ cp_error (ec_definition_of_class_in_condition, s);
else if (TREE_CODE (s) == ENUMERAL_TYPE)
- cp_error ("definition of enum `%T' in condition", s);
+ cp_error (ec_definition_of_enum_in_condition, s);
}
}
current_declspecs = $1.t;
@@ -1011,7 +1012,7 @@ condition:
resume_momentary ($<itype>5);
$$ = $<ttype>6;
if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE)
- cp_error ("definition of array `%#D' in condition", $$);
+ cp_error (ec_definition_of_array_in_condition, $$);
}
| expr
;
@@ -1069,7 +1070,7 @@ unary_expr:
/* Refer to the address of a label as a pointer. */
| ANDAND identifier
{ if (pedantic)
- pedwarn ("ANSI C++ forbids `&&'");
+ cp_pedwarn (ec_forbids);
$$ = finish_label_address_expr ($2); }
| SIZEOF unary_expr %prec UNARY
{ $$ = expr_sizeof ($2); }
@@ -1154,7 +1155,7 @@ new_placement:
'(' .begin_new_placement nonnull_exprlist ')'
{ $$ = finish_new_placement ($3, $2); }
| '{' .begin_new_placement nonnull_exprlist '}'
- { cp_pedwarn ("old style placement syntax, use () instead");
+ { cp_pedwarn (ec_old_style_placement_syntax_use_instead);
$$ = finish_new_placement ($3, $2); }
;
@@ -1165,7 +1166,7 @@ new_initializer:
{ $$ = NULL_TREE; }
| '(' typespec ')'
{
- cp_error ("`%T' is not a valid expression", $2.t);
+ cp_error (ec_is_not_a_valid_expression, $2.t);
$$ = error_mark_node;
}
/* GNU extension so people can use initializer lists. Note that
@@ -1174,7 +1175,7 @@ new_initializer:
| '=' init
{
if (pedantic)
- pedwarn ("ANSI C++ forbids initialization of new expression with `='");
+ cp_pedwarn (ec_forbids_initialization_of_new_expression_with);
if (TREE_CODE ($2) != TREE_LIST
&& TREE_CODE ($2) != CONSTRUCTOR)
$$ = build_expr_list (NULL_TREE, $2);
@@ -1204,7 +1205,7 @@ cast_expr:
tree init = build_nt (CONSTRUCTOR, NULL_TREE,
nreverse ($3));
if (pedantic)
- pedwarn ("ANSI C++ forbids constructor-expressions");
+ cp_pedwarn (ec_forbids_constructorexpressions);
/* Indicate that this was a GNU C constructor expression. */
TREE_HAS_CONSTRUCTOR (init) = 1;
@@ -1380,11 +1381,11 @@ primary:
{ tree scope = current_scope ();
if (!scope || TREE_CODE (scope) != FUNCTION_DECL)
{
- error ("braced-group within expression allowed only inside a function");
+ cp_error (ec_bracedgroup_within_expression_allowed_only_inside_a_function);
YYERROR;
}
if (pedantic)
- pedwarn ("ANSI C++ forbids braced-groups within expressions");
+ cp_pedwarn (ec_forbids_bracedgroups_within_expressions);
$<ttype>$ = begin_stmt_expr ();
}
compstmt ')'
@@ -1423,7 +1424,7 @@ primary:
#if 0
if ($3 == NULL_TREE)
{
- error ("cannot cast null list to type `%s'",
+ cp_error (ec_cannot_cast_null_list_to_type_s,
IDENTIFIER_POINTER (TYPE_NAME (id)));
$$ = error_mark_node;
break;
@@ -1444,7 +1445,7 @@ primary:
/* should not be able to get here (mrs) */
else if (id == ridpointers[(int) RID_FRIEND])
{
- error ("cannot cast expression to `friend' type");
+ cp_error (ec_cannot_cast_expression_to_friend_type);
$$ = error_mark_node;
break;
}
@@ -1538,13 +1539,13 @@ primary_no_id:
| '('
{ if (current_function_decl == 0)
{
- error ("braced-group within expression allowed only inside a function");
+ cp_error (ec_bracedgroup_within_expression_allowed_only_inside_a_function);
YYERROR;
}
$<ttype>$ = expand_start_stmt_expr (); }
compstmt ')'
{ if (pedantic)
- pedwarn ("ANSI C++ forbids braced-groups within expressions");
+ cp_pedwarn (ec_forbids_bracedgroups_within_expressions);
$$ = expand_end_stmt_expr ($<ttype>2); }
| primary_no_id '(' nonnull_exprlist ')'
{ $$ = build_x_function_call ($$, $3, current_class_ref); }
@@ -1637,7 +1638,7 @@ decl:
note_list_got_semicolon ($1.t);
}
| declmods ';'
- { warning ("empty declaration"); }
+ { cp_warning (ec_empty_declaration); }
| extension decl
{ pedantic = $<itype>1; }
;
@@ -1714,14 +1715,14 @@ typed_declspecs1:
reserved_declspecs:
SCSPEC
{ if (extra_warnings)
- warning ("`%s' is not at beginning of declaration",
+ cp_warning (ec_s_is_not_at_beginning_of_declaration,
IDENTIFIER_POINTER ($$));
$$ = build_decl_list (NULL_TREE, $$); }
| reserved_declspecs typespecqual_reserved
{ $$ = decl_tree_cons (NULL_TREE, $2.t, $$); }
| reserved_declspecs SCSPEC
{ if (extra_warnings)
- warning ("`%s' is not at beginning of declaration",
+ cp_warning (ec_s_is_not_at_beginning_of_declaration,
IDENTIFIER_POINTER ($2));
$$ = decl_tree_cons (NULL_TREE, $2, $$); }
| reserved_declspecs attributes
@@ -1745,7 +1746,7 @@ declmods:
TREE_STATIC ($$) = 1; }
| declmods SCSPEC
{ if (extra_warnings && TREE_STATIC ($$))
- warning ("`%s' is not at beginning of declaration",
+ cp_warning (ec_s_is_not_at_beginning_of_declaration,
IDENTIFIER_POINTER ($2));
$$ = decl_tree_cons (NULL_TREE, $2, $$);
TREE_STATIC ($$) = TREE_STATIC ($1); }
@@ -1810,7 +1811,7 @@ typespec:
}
else
{
- error ("`sigof' applied to non-aggregate expression");
+ cp_error (ec_sigof_applied_to_nonaggregate_expression);
$$.t = error_mark_node;
}
}
@@ -1825,7 +1826,7 @@ typespec:
}
else
{
- error("`sigof' applied to non-aggregate type");
+ cp_error (ec_sigof_applied_to_nonaggregate_type);
$$.t = error_mark_node;
}
}
@@ -2101,7 +2102,7 @@ structsp:
{ $$.t = $2;
$$.new_type_flag = 0;
if (!processing_template_decl)
- cp_pedwarn ("using `typename' outside of template"); }
+ cp_pedwarn (ec_using_typename_outside_of_template); }
/* C++ extensions, merged with C to avoid shift/reduce conflicts */
| class_head left_curly
opt.component_decl_list '}' maybe_attribute
@@ -2125,7 +2126,7 @@ structsp:
$$.new_type_flag = 0;
if (TYPE_BINFO ($1) == NULL_TREE)
{
- cp_error ("%T is not a class type", $1);
+ cp_error (ec_is_not_a_class_type, $1);
$$.t = error_mark_node;
}
else
@@ -2134,7 +2135,7 @@ structsp:
/* struct B: public A; is not accepted by the WP grammar. */
if (TYPE_BINFO_BASETYPES ($$.t) && !TYPE_SIZE ($$.t)
&& ! TYPE_BEING_DEFINED ($$.t))
- cp_error ("base clause without member specification for `%#T'",
+ cp_error (ec_base_clause_without_member_specification_for,
$$.t);
}
}
@@ -2149,19 +2150,19 @@ maybecomma_warn:
/* empty */
| ','
{ if (pedantic && !in_system_header)
- pedwarn ("comma at end of enumerator list"); }
+ cp_pedwarn (ec_comma_at_end_of_enumerator_list); }
;
aggr:
AGGR
| aggr SCSPEC
- { error ("storage class specifier `%s' not allowed after struct or class", IDENTIFIER_POINTER ($2)); }
+ { cp_error (ec_storage_class_specifier_s_not_allowed_after_struct_or_class, IDENTIFIER_POINTER ($2)); }
| aggr TYPESPEC
- { error ("type specifier `%s' not allowed after struct or class", IDENTIFIER_POINTER ($2)); }
+ { cp_error (ec_type_specifier_s_not_allowed_after_struct_or_class, IDENTIFIER_POINTER ($2)); }
| aggr CV_QUALIFIER
- { error ("type qualifier `%s' not allowed after struct or class", IDENTIFIER_POINTER ($2)); }
+ { cp_error (ec_type_qualifier_s_not_allowed_after_struct_or_class, IDENTIFIER_POINTER ($2)); }
| aggr AGGR
- { error ("no body nor ';' separates two class, struct or union declarations"); }
+ { cp_error (ec_no_body_nor_separates_two_class_struct_or_union_declarations); }
| aggr attributes
{ $$ = build_decl_list ($2, $1); }
;
@@ -2222,10 +2223,10 @@ named_class_head:
$$ = TREE_TYPE ($1);
if (TREE_INT_CST_LOW (current_aggr) == union_type
&& TREE_CODE ($$) != UNION_TYPE)
- cp_pedwarn ("`union' tag used in declaring `%#T'", $$);
+ cp_pedwarn (ec_union_tag_used_in_declaring, $$);
else if (TREE_CODE ($$) == UNION_TYPE
&& TREE_INT_CST_LOW (current_aggr) != union_type)
- cp_pedwarn ("non-`union' tag used in declaring `%#T'", $$);
+ cp_pedwarn (ec_nonunion_tag_used_in_declaring, $$);
if ($2)
{
maybe_process_partial_specialization ($$);
@@ -2286,13 +2287,13 @@ base_class.1:
}
else
{
- error ("`sigof' applied to non-aggregate expression");
+ cp_error (ec_sigof_applied_to_nonaggregate_expression);
$$ = error_mark_node;
}
}
else
{
- error ("`sigof' in struct or class declaration");
+ cp_error (ec_sigof_in_struct_or_class_declaration);
$$ = error_mark_node;
}
}
@@ -2307,13 +2308,13 @@ base_class.1:
}
else
{
- error ("`sigof' applied to non-aggregate expression");
+ cp_error (ec_sigof_applied_to_nonaggregate_expression);
$$ = error_mark_node;
}
}
else
{
- error ("`sigof' in struct or class declaration");
+ cp_error (ec_sigof_in_struct_or_class_declaration);
$$ = error_mark_node;
}
}
@@ -2323,12 +2324,12 @@ base_class_access_list:
VISSPEC see_typename
| SCSPEC see_typename
{ if ($1 != ridpointers[(int)RID_VIRTUAL])
- cp_error ("`%D' access", $1);
+ cp_error (ec_access, $1);
$$ = access_default_virtual_node; }
| base_class_access_list VISSPEC see_typename
{
if ($1 != access_default_virtual_node)
- error ("multiple access specifiers");
+ cp_error (ec_multiple_access_specifiers);
else if ($2 == access_public_node)
$$ = access_public_virtual_node;
else if ($2 == access_protected_node)
@@ -2338,7 +2339,7 @@ base_class_access_list:
}
| base_class_access_list SCSPEC see_typename
{ if ($2 != ridpointers[(int)RID_VIRTUAL])
- cp_error ("`%D' access", $2);
+ cp_error (ec_access, $2);
else if ($$ == access_public_node)
$$ = access_public_virtual_node;
else if ($$ == access_protected_node)
@@ -2346,7 +2347,7 @@ base_class_access_list:
else if ($$ == access_private_node)
$$ = access_private_virtual_node;
else
- error ("multiple `virtual' specifiers");
+ cp_error (ec_multiple_virtual_specifiers);
}
;
@@ -2379,7 +2380,7 @@ opt.component_decl_list:
if (current_aggr == signature_type_node)
{
- error ("access specifier not allowed in signature");
+ cp_error (ec_access_specifier_not_allowed_in_signature);
visspec = access_public_node;
}
$$ = chainon ($$, build_tree_list (visspec, $4));
@@ -2387,7 +2388,7 @@ opt.component_decl_list:
| opt.component_decl_list VISSPEC ':'
{
if (current_aggr == signature_type_node)
- error ("access specifier not allowed in signature");
+ cp_error (ec_access_specifier_not_allowed_in_signature);
}
;
@@ -2416,7 +2417,7 @@ component_decl:
component_decl_1 ';'
{ }
| component_decl_1 '}'
- { error ("missing ';' before right brace");
+ { cp_error (ec_missing_before_right_brace);
yyungetc ('}', 0); }
/* C++: handle constructors, destructors and inline functions */
/* note that INLINE is like a TYPESPEC */
@@ -2614,7 +2615,7 @@ new_type_id:
'[' expr ']'
{
if (pedantic)
- pedwarn ("ANSI C++ forbids array dimensions with parenthesized type in new");
+ cp_pedwarn (ec_forbids_array_dimensions_with_parenthesized_type_in_new);
$$.t = build_parse_node (ARRAY_REF, TREE_VALUE ($3.t), $6);
$$.t = build_decl_list (TREE_PURPOSE ($3.t), $$.t);
$$.new_type_flag = $3.new_type_flag;
@@ -2870,7 +2871,7 @@ nested_name_specifier_1:
| IDENTIFIER SCOPE
{
failed_scope:
- cp_error ("`%D' is not an aggregate typedef",
+ cp_error (ec_is_not_an_aggregate_typedef,
lastiddecl ? lastiddecl : $$);
$$ = error_mark_node;
}
@@ -2890,7 +2891,7 @@ typename_sub0:
if (TREE_CODE_CLASS (TREE_CODE ($1)) == 't')
$$ = make_typename_type ($1, $2);
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
- cp_error ("`%T' is not a class or namespace", $2);
+ cp_error (ec_is_not_a_class_or_namespace, $2);
else
{
$$ = $2;
@@ -2910,14 +2911,14 @@ typename_sub1:
typename_sub2
{
if (TREE_CODE ($1) == IDENTIFIER_NODE)
- cp_error ("`%T' is not a class or namespace", $1);
+ cp_error (ec_is_not_a_class_or_namespace, $1);
}
| typename_sub1 typename_sub2
{
if (TREE_CODE_CLASS (TREE_CODE ($1)) == 't')
$$ = make_typename_type ($1, $2);
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
- cp_error ("`%T' is not a class or namespace", $2);
+ cp_error (ec_is_not_a_class_or_namespace, $2);
else
{
$$ = $2;
@@ -2942,7 +2943,7 @@ typename_sub2:
got_scope = $$ = complete_type (IDENTIFIER_TYPE_VALUE ($1));
if ($$ == error_mark_node)
- cp_error ("`%T' is not a class or namespace", $1);
+ cp_error (ec_is_not_a_class_or_namespace, $1);
}
| SELFNAME SCOPE
{
@@ -3100,7 +3101,7 @@ maybe_label_decls:
/* empty */
| label_decls
{ if (pedantic)
- pedwarn ("ANSI C++ forbids label declarations"); }
+ cp_pedwarn (ec_forbids_label_declarations); }
;
label_decls:
@@ -3246,7 +3247,7 @@ simple_stmt:
| GOTO '*' expr ';'
{
if (pedantic)
- pedwarn ("ANSI C++ forbids computed gotos");
+ cp_pedwarn (ec_forbids_computed_gotos);
finish_goto_stmt ($3);
}
| GOTO identifier ';'
@@ -3254,7 +3255,7 @@ simple_stmt:
| label_colon stmt
{ finish_stmt (); }
| label_colon '}'
- { error ("label must be followed by statement");
+ { cp_error (ec_label_must_be_followed_by_statement);
yyungetc ('}', 0);
finish_stmt (); }
| ';'
@@ -3359,7 +3360,7 @@ for.init.statement:
| decl
| '{' compstmtend
{ if (pedantic)
- pedwarn ("ANSI C++ forbids compound statements inside for initializations");
+ cp_pedwarn (ec_forbids_compound_statements_inside_for_initializations);
}
;
@@ -3550,16 +3551,18 @@ see_typename:
bad_parm:
/* empty */ %prec EMPTY
{
- error ("type specifier omitted for parameter");
+ cp_error (ec_type_specifier_omitted_for_parameter);
$$ = build_tree_list (integer_type_node, NULL_TREE);
}
| notype_declarator
{
- error ("type specifier omitted for parameter");
+ cp_error (ec_type_specifier_omitted_for_parameter);
if (TREE_CODE ($$) == SCOPE_REF
&& (TREE_CODE (TREE_OPERAND ($$, 0)) == TEMPLATE_TYPE_PARM
|| TREE_CODE (TREE_OPERAND ($$, 0)) == TEMPLATE_TEMPLATE_PARM))
- cp_error (" perhaps you want `typename %E' to make it a type", $$);
+ cp_error
+ (ec_perhaps_you_want_typename_expr_to_make_it_a_type,
+ $$);
$$ = build_tree_list (integer_type_node, $$);
}
;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 04c9fd6..ca88d1c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -228,7 +228,7 @@ finish_member_template_decl (template_parameters, decl)
return decl;
}
else
- cp_error ("invalid member template declaration `%D'", decl);
+ cp_error (ec_invalid_member_template_declaration, decl);
return error_mark_node;
@@ -594,7 +594,7 @@ check_specialization_scope ()
shall be declared in the namespace of which the class template
is a member. */
if (scope && TREE_CODE (scope) != NAMESPACE_DECL)
- cp_error ("explicit specialization in non-namespace scope `%D'",
+ cp_error (ec_explicit_specialization_in_nonnamespace_scope,
scope);
/* [temp.expl.spec]
@@ -605,7 +605,7 @@ check_specialization_scope ()
explicitly specialize a class member template if its enclosing
class templates are not explicitly specialized as well. */
if (current_template_parms)
- cp_error ("enclosing class templates are not explicit specialized");
+ cp_error (ec_enclosing_class_templates_are_not_explicit_specialized);
}
/* We've just seen template <>. */
@@ -680,7 +680,7 @@ maybe_process_partial_specialization (type)
push_template_decl (TYPE_MAIN_DECL (type));
}
else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type))
- cp_error ("specialization of `%T' after instantiation", type);
+ cp_error (ec_specialization_of_type_after_instantiation, type);
}
}
@@ -797,7 +797,7 @@ register_specialization (spec, tmpl, args)
if (TREE_USED (fn)
|| DECL_EXPLICIT_INSTANTIATION (fn))
{
- cp_error ("specialization of %D after instantiation",
+ cp_error (ec_specialization_of_decl_after_instantiation,
fn);
return spec;
}
@@ -875,7 +875,7 @@ print_candidates (fns)
for (fn = fns; fn != NULL_TREE; fn = TREE_CHAIN (fn))
{
- cp_error_at ("%s %+#D", str, TREE_VALUE (fn));
+ cp_error_at (ec_decl, str, TREE_VALUE (fn));
str = " ";
}
}
@@ -997,7 +997,7 @@ determine_specialization (template_id, decl, targs_out,
no_match:
if (complain)
{
- cp_error_at ("template-id `%D' for `%+D' does not match any template declaration",
+ cp_error_at (ec_templateid_for_does_not_match_any_template_declaration,
template_id, decl);
return error_mark_node;
}
@@ -1008,7 +1008,7 @@ determine_specialization (template_id, decl, targs_out,
ambiguous:
if (complain)
{
- cp_error_at ("ambiguous template specialization `%D' for `%+D'",
+ cp_error_at (ec_ambiguous_template_specialization_for,
template_id, decl);
print_candidates (templates);
return error_mark_node;
@@ -1095,7 +1095,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
lists. There can be at most one parameter list for
every qualifying class, plus one for the function
itself. */
- cp_error ("too many template parameter lists in declaration of `%D'", decl);
+ cp_error (ec_too_many_template_parameter_lists_in_declaration_of, decl);
SET_DECL_TEMPLATE_SPECIALIZATION (decl);
if (ctype)
@@ -1127,17 +1127,17 @@ check_explicit_specialization (declarator, decl, template_count, flags)
void S<int>::T<char>::f();
But, we're missing another template <>. */
- cp_error("too few template parameter lists in declaration of `%D'", decl);
+ cp_error (ec_too_few_template_parameter_lists_in_declaration_of, decl);
return decl;
}
}
else if (processing_explicit_instantiation)
{
if (template_header_count)
- cp_error ("template parameter list used in explicit instantiation");
+ cp_error (ec_template_parameter_list_used_in_explicit_instantiation);
if (have_def)
- cp_error ("definition provided for explicit instantiation");
+ cp_error (ec_definition_provided_for_explicit_instantiation);
explicit_instantiation = 1;
}
@@ -1163,13 +1163,12 @@ check_explicit_specialization (declarator, decl, template_count, flags)
that's bogus. */
if (template_header_count)
{
- cp_error ("template parameters specified in specialization");
+ cp_error (ec_template_parameters_specified_in_specialization);
return decl;
}
if (pedantic)
- cp_pedwarn
- ("explicit specialization not preceded by `template <>'");
+ cp_pedwarn (ec_explicit_specialization_not_preceded_by_template);
specialization = 1;
SET_DECL_TEMPLATE_SPECIALIZATION (decl);
}
@@ -1186,7 +1185,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
/* This case handles bogus declarations like template <>
template <class T> void f<int>(); */
- cp_error ("template-id `%D' in declaration of primary template",
+ cp_error (ec_templateid_in_declaration_of_primary_template,
declarator);
return decl;
}
@@ -1199,8 +1198,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
for (; t; t = TREE_CHAIN (t))
if (TREE_PURPOSE (t))
{
- cp_pedwarn
- ("default argument specified in explicit specialization");
+ cp_pedwarn (ec_default_argument_specified_in_explicit_specialization);
break;
}
}
@@ -1289,7 +1287,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
program is ill-formed.
Similar language is found in [temp.explicit]. */
- cp_error ("specialization of implicitly-declared special member function");
+ cp_error (ec_specialization_of_implicitlydeclared_special_member_function);
return decl;
}
@@ -1301,7 +1299,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
if (fns == NULL_TREE)
{
- cp_error ("no member function `%s' declared in `%T'",
+ cp_error (ec_no_member_function_s_declared_in,
IDENTIFIER_POINTER (name),
ctype);
return decl;
@@ -1425,7 +1423,9 @@ maybe_check_template_type (type)
;
else if (template_header_count > context_depth + 1)
/* There are two many template parameter lists. */
- cp_error ("too many template parameter lists in declaration of `%T'", type);
+ cp_error
+ (ec_too_many_template_parameter_lists_in_declaration_of_type,
+ type);
}
}
@@ -1610,16 +1610,16 @@ process_template_parm (list, next)
&& TREE_CODE (TREE_TYPE (parm)) != TEMPLATE_TYPE_PARM
&& TREE_CODE (TREE_TYPE (parm)) != TYPENAME_TYPE)
{
- cp_error ("`%#T' is not a valid type for a template constant parameter",
+ cp_error (ec_is_not_a_valid_type_for_a_template_constant_parameter,
TREE_TYPE (parm));
if (DECL_NAME (parm) == NULL_TREE)
- error (" a template type parameter must begin with `class' or `typename'");
+ cp_error (ec_a_template_type_parameter_must_begin_with_class_or_typename);
TREE_TYPE (parm) = void_type_node;
}
else if (pedantic
&& (TREE_CODE (TREE_TYPE (parm)) == REAL_TYPE
|| TREE_CODE (TREE_TYPE (parm)) == COMPLEX_TYPE))
- cp_pedwarn ("`%T' is not a valid type for a template constant parameter",
+ cp_pedwarn (ec_is_not_a_valid_type_for_a_template_constant_parameter,
TREE_TYPE (parm));
if (TREE_PERMANENT (parm) == 0)
{
@@ -1872,7 +1872,7 @@ process_partial_specialization (decl)
{
if (!issued_default_arg_message)
{
- cp_error ("default argument in partial specialization `%T'",
+ cp_error (ec_default_argument_in_partial_specialization,
type);
issued_default_arg_message = 1;
}
@@ -1930,11 +1930,11 @@ process_partial_specialization (decl)
specialization. */
if (!did_error_intro)
{
- cp_error ("template parameters not used in partial specialization:");
+ cp_error (ec_template_parameters_not_used_in_partial_specialization);
did_error_intro = 1;
}
- cp_error (" `%D'",
+ cp_error (ec_template_parm,
TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
}
@@ -1945,7 +1945,7 @@ process_partial_specialization (decl)
if (comp_template_args (inner_args,
innermost_args (CLASSTYPE_TI_ARGS (TREE_TYPE
(maintmpl)))))
- cp_error ("partial specialization `%T' does not specialize any template arguments", type);
+ cp_error (ec_partial_specialization_does_not_specialize_any_template_arguments, type);
/* [temp.class.spec]
@@ -1970,7 +1970,7 @@ process_partial_specialization (decl)
&& TREE_CODE (arg) != TEMPLATE_PARM_INDEX)
{
if (tpd.arg_uses_template_parms[i])
- cp_error ("template argument `%E' involves template parameter(s)", arg);
+ cp_error (ec_template_argument_involves_template_parameters, arg);
else
{
/* Look at the corresponding template parameter,
@@ -2010,7 +2010,7 @@ process_partial_specialization (decl)
if (tpd2.parms[j] != 0
&& tpd.arg_uses_template_parms [j])
{
- cp_error ("type `%T' of template argument `%E' depends on template paramter(s)",
+ cp_error (ec_type_of_template_argument_depends_on_template_paramters,
type,
arg);
break;
@@ -2090,12 +2090,12 @@ push_template_decl_real (decl, is_friend)
if (primary)
{
if (current_lang_name == lang_name_c)
- cp_error ("template with C linkage");
+ cp_error (ec_template_with_linkage);
if (TREE_CODE (decl) == TYPE_DECL && ANON_AGGRNAME_P (DECL_NAME (decl)))
- cp_error ("template class without a name");
+ cp_error (ec_template_class_without_a_name);
if (TREE_CODE (decl) == TYPE_DECL
&& TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE)
- cp_error ("template declaration of `%#T'", TREE_TYPE (decl));
+ cp_error (ec_template_declaration_of_type, TREE_TYPE (decl));
}
/* Partial specialization. */
@@ -2136,7 +2136,7 @@ push_template_decl_real (decl, is_friend)
tree a;
if (CLASSTYPE_TEMPLATE_INSTANTIATION (ctx))
- cp_error ("must specialize `%#T' before defining member `%#D'",
+ cp_error (ec_must_specialize_before_defining_member,
ctx, decl);
if (TREE_CODE (decl) == TYPE_DECL)
{
@@ -2147,13 +2147,13 @@ push_template_decl_real (decl, is_friend)
tmpl = TYPE_TI_TEMPLATE (TREE_TYPE (decl));
else
{
- cp_error ("`%D' does not declare a template type", decl);
+ cp_error (ec_does_not_declare_a_template_type, decl);
return decl;
}
}
else if (! DECL_TEMPLATE_INFO (decl))
{
- cp_error ("template definition of non-template `%#D'", decl);
+ cp_error (ec_template_definition_of_nontemplate, decl);
return decl;
}
else
@@ -2191,9 +2191,9 @@ push_template_decl_real (decl, is_friend)
t = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
if (TREE_VEC_LENGTH (t) != TREE_VEC_LENGTH (a))
{
- cp_error ("got %d template parameters for `%#D'",
+ cp_error (ec_got_d_template_parameters_for,
TREE_VEC_LENGTH (a), decl);
- cp_error (" but %d required", TREE_VEC_LENGTH (t));
+ cp_error (ec_but_d_required, TREE_VEC_LENGTH (t));
}
if (TMPL_ARGS_DEPTH (args) > 1)
/* Get the template parameters for the enclosing template
@@ -2224,9 +2224,9 @@ push_template_decl_real (decl, is_friend)
if (t != NULL_TREE
&& TREE_VEC_LENGTH (t) != TREE_VEC_LENGTH (a))
{
- cp_error ("got %d template parameters for `%#D'",
+ cp_error (ec_got_d_template_parameters_for,
TREE_VEC_LENGTH (a), decl);
- cp_error (" but `%#T' has %d", ctx, TREE_VEC_LENGTH (t));
+ cp_error (ec_but_has_d, ctx, TREE_VEC_LENGTH (t));
}
}
@@ -2254,7 +2254,7 @@ push_template_decl_real (decl, is_friend)
DECL_NAME (decl) = classtype_mangled_name (TREE_TYPE (decl));
}
else if (! DECL_LANG_SPECIFIC (decl))
- cp_error ("template declaration of `%#D'", decl);
+ cp_error (ec_template_declaration_of, decl);
else
DECL_TEMPLATE_INFO (decl) = info;
@@ -2294,8 +2294,8 @@ redeclare_class_template (type, parms)
if (TREE_VEC_LENGTH (parms) != TREE_VEC_LENGTH (tmpl_parms))
{
- cp_error_at ("previous declaration `%D'", tmpl);
- cp_error ("used %d template parameter%s instead of %d",
+ cp_error_at (ec_previous_declaration, tmpl);
+ cp_error (ec_used_d_template_parameters_instead_of_d,
TREE_VEC_LENGTH (tmpl_parms),
TREE_VEC_LENGTH (tmpl_parms) == 1 ? "" : "s",
TREE_VEC_LENGTH (parms));
@@ -2311,8 +2311,8 @@ redeclare_class_template (type, parms)
if (TREE_CODE (tmpl_parm) != TREE_CODE (parm))
{
- cp_error_at ("template parameter `%#D'", tmpl_parm);
- cp_error ("redeclared here as `%#D'", parm);
+ cp_error_at (ec_template_parameter, tmpl_parm);
+ cp_error (ec_redeclared_here_as, parm);
return;
}
@@ -2322,8 +2322,8 @@ redeclare_class_template (type, parms)
A template-parameter may not be given default arguments
by two different declarations in the same scope. */
- cp_error ("redefinition of default argument for `%#D'", parm);
- cp_error_at (" original definition appeared here", tmpl_parm);
+ cp_error (ec_redefinition_of_default_argument_for, parm);
+ cp_error_at (ec_original_definition_appeared_here, tmpl_parm);
return;
}
@@ -2392,7 +2392,7 @@ convert_nontype_argument (type, expr)
if (! TREE_CONSTANT (expr))
{
non_constant:
- cp_error ("non-constant `%E' cannot be used as template argument",
+ cp_error (ec_nonconstant_cannot_be_used_as_template_argument,
expr);
return NULL_TREE;
}
@@ -2409,8 +2409,8 @@ convert_nontype_argument (type, expr)
if (TREE_CODE (e) != ADDR_EXPR)
{
bad_argument:
- cp_error ("`%E' is not a valid template argument", expr);
- error ("it must be %s%s with external linkage",
+ cp_error (ec_is_not_a_valid_template_argument, expr);
+ cp_error (ec_it_must_be_ss_with_external_linkage,
TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE
? "a pointer to " : "",
TREE_CODE (TREE_TYPE (TREE_TYPE (expr))) == FUNCTION_TYPE
@@ -2423,9 +2423,9 @@ convert_nontype_argument (type, expr)
if (TREE_CODE (referent) == STRING_CST)
{
- cp_error ("string literal %E is not a valid template argument",
+ cp_error (ec_string_literal_is_not_a_valid_template_argument,
referent);
- error ("because it is the address of an object with static linkage");
+ cp_error (ec_because_it_is_the_address_of_an_object_with_static_linkage);
return NULL_TREE;
}
@@ -2436,7 +2436,7 @@ convert_nontype_argument (type, expr)
goto bad_argument;
else if (!TREE_PUBLIC (referent))
{
- cp_error ("address of non-extern `%E' cannot be used as template argument", referent);
+ cp_error (ec_address_of_nonextern_cannot_be_used_as_template_argument, referent);
return error_mark_node;
}
}
@@ -2447,7 +2447,7 @@ convert_nontype_argument (type, expr)
}
else
{
- cp_error ("object `%E' cannot be used as template argument", expr);
+ cp_error (ec_object_cannot_be_used_as_template_argument, expr);
return NULL_TREE;
}
@@ -2816,8 +2816,8 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
if (requires_type && ! is_type && TREE_CODE (arg) == SCOPE_REF
&& TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM)
{
- cp_pedwarn ("to refer to a type member of a template parameter,");
- cp_pedwarn (" use `typename %E'", arg);
+ cp_pedwarn (ec_to_refer_to_a_type_member_of_a_template_parameter);
+ cp_pedwarn (ec_use_typename, arg);
arg = make_typename_type (TREE_OPERAND (arg, 0),
TREE_OPERAND (arg, 1));
@@ -2829,14 +2829,14 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
{
if (complain)
{
- cp_error ("type/value mismatch at argument %d in template parameter list for `%D'",
+ cp_error (ec_typevalue_mismatch_at_argument_d_in_template_parameter_list_for,
i + 1, in_decl);
if (is_type)
- cp_error (" expected a constant of type `%T', got `%T'",
+ cp_error (ec_expected_a_constant_of_type_got,
TREE_TYPE (parm),
(is_tmpl_type ? DECL_NAME (arg) : arg));
else
- cp_error (" expected a type, got `%E'", arg);
+ cp_error (ec_expected_a_type_got_expr, arg);
}
}
return error_mark_node;
@@ -2845,12 +2845,12 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
{
if (in_decl && complain)
{
- cp_error ("type/value mismatch at argument %d in template parameter list for `%D'",
+ cp_error (ec_typevalue_mismatch_at_argument_d_in_template_parameter_list_for,
i + 1, in_decl);
if (is_tmpl_type)
- cp_error (" expected a type, got `%T'", DECL_NAME (arg));
+ cp_error (ec_expected_a_type_got_type, DECL_NAME (arg));
else
- cp_error (" expected a class template, got `%T'", arg);
+ cp_error (ec_expected_a_class_template_got, arg);
}
return error_mark_node;
}
@@ -2877,9 +2877,9 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
{
if (in_decl && complain)
{
- cp_error ("type/value mismatch at argument %d in template parameter list for `%D'",
+ cp_error (ec_typevalue_mismatch_at_argument_d_in_template_parameter_list_for,
i + 1, in_decl);
- cp_error (" expected a template of type `%D', got `%D'", parm, arg);
+ cp_error (ec_expected_a_template_of_type_got, parm, arg);
}
val = error_mark_node;
@@ -2899,11 +2899,9 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
if (t)
{
if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
- cp_pedwarn
- ("template-argument `%T' uses anonymous type", val);
+ cp_pedwarn (ec_templateargument_uses_anonymous_type, val);
else
- cp_error
- ("template-argument `%T' uses local type `%T'",
+ cp_error (ec_templateargument_uses_local_type,
val, t);
return error_mark_node;
}
@@ -2935,7 +2933,7 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
if (val == NULL_TREE)
val = error_mark_node;
else if (val == error_mark_node && complain)
- cp_error ("could not convert template argument `%E' to `%T'",
+ cp_error (ec_could_not_convert_template_argument_to,
arg, t);
}
@@ -2982,11 +2980,11 @@ coerce_template_parms (parms, args, in_decl,
{
if (complain)
{
- cp_error ("wrong number of template arguments (%d, should be %d)",
+ cp_error (ec_wrong_number_of_template_arguments_d_should_be_d,
nargs, nparms);
if (in_decl)
- cp_error_at ("provided for `%D'", in_decl);
+ cp_error_at (ec_provided_for, in_decl);
}
return error_mark_node;
@@ -3032,7 +3030,7 @@ coerce_template_parms (parms, args, in_decl,
}
else if (arg == error_mark_node)
{
- cp_error ("template argument %d is invalid", i + 1);
+ cp_error (ec_template_argument_d_is_invalid, i + 1);
arg = error_mark_node;
}
else
@@ -3237,7 +3235,7 @@ lookup_template_function (fns, arglist)
if (fns == NULL_TREE)
{
- cp_error ("non-template used as template");
+ cp_error (ec_nontemplate_used_as_template);
return error_mark_node;
}
@@ -3356,9 +3354,9 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
if (TREE_CODE (template) != TEMPLATE_DECL)
{
- cp_error ("non-template type `%T' used as a template", d1);
+ cp_error (ec_nontemplate_type_used_as_a_template, d1);
if (in_decl)
- cp_error_at ("for template declaration `%D'", in_decl);
+ cp_error_at (ec_for_template_declaration, in_decl);
return error_mark_node;
}
@@ -3433,7 +3431,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
We should catch this error sooner (at the opening curly
for `S', but it is better to be safe than sorry here. */
{
- cp_error ("invalid use of `%D'", template);
+ cp_error (ec_invalid_use_of, template);
return error_mark_node;
}
@@ -3956,10 +3954,10 @@ push_tinst_level (d)
return 0;
last_template_error_tick = tinst_level_tick;
- error ("template instantiation depth exceeds maximum of %d",
+ cp_error (ec_template_instantiation_depth_exceeds_maximum_of_d,
max_tinst_depth);
- error (" (use -ftemplate-depth-NN to increase the maximum)");
- cp_error (" instantiating `%D'", d);
+ cp_error (ec_use_ftemplatedepth_to_increase_the_maximum);
+ cp_error (ec_instantiating, d);
print_template_context (0);
@@ -4276,13 +4274,13 @@ instantiate_class_template (type)
if (t == error_mark_node)
{
char *str = "candidates are:";
- cp_error ("ambiguous class template instantiation for `%#T'", type);
+ cp_error (ec_ambiguous_class_template_instantiation_for, type);
for (t = DECL_TEMPLATE_SPECIALIZATIONS (template); t; t = TREE_CHAIN (t))
{
if (get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
args))
{
- cp_error_at ("%s %+#T", str, TREE_TYPE (t));
+ cp_error_at (ec_type, str, TREE_TYPE (t));
str = " ";
}
}
@@ -4433,11 +4431,10 @@ instantiate_class_template (type)
basetype = TREE_TYPE (elt);
if (! IS_AGGR_TYPE (basetype))
- cp_error
- ("base type `%T' of `%T' fails to be a struct or class type",
+ cp_error (ec_base_type_of_fails_to_be_a_struct_or_class_type,
basetype, type);
else if (TYPE_SIZE (complete_type (basetype)) == NULL_TREE)
- cp_error ("base class `%T' of `%T' has incomplete type",
+ cp_error (ec_base_class_of_has_incomplete_type,
basetype, type);
/* These are set up in xref_basetypes for normal classes, so
@@ -5257,7 +5254,7 @@ tsubst_decl (t, args, type, in_decl)
DECL_INITIAL (r) = tsubst_expr (DECL_INITIAL (t), args, in_decl);
TREE_CHAIN (r) = NULL_TREE;
if (TREE_CODE (type) == VOID_TYPE)
- cp_error_at ("instantiation of `%D' as type void", r);
+ cp_error_at (ec_instantiation_of_as_type_void, r);
}
break;
@@ -5316,7 +5313,7 @@ tsubst_decl (t, args, type, in_decl)
TREE_CHAIN (r) = NULL_TREE;
if (TREE_CODE (type) == VOID_TYPE)
- cp_error_at ("instantiation of `%D' as type void", r);
+ cp_error_at (ec_instantiation_of_as_type_void, r);
}
break;
@@ -5647,7 +5644,7 @@ tsubst (t, args, in_decl)
if (last_line != lineno ||
last_file != input_filename)
{
- cp_error ("cannot form type %s to reference type %T during template instantiation",
+ cp_error (ec_cannot_form_type_s_to_reference_type_during_template_instantiation,
(code == POINTER_TYPE) ? "pointer" : "reference",
type);
last_line = lineno;
@@ -6428,8 +6425,8 @@ instantiate_template (tmpl, targ_ptr)
tree nt = target_type (t);
if (IS_AGGR_TYPE (nt) && decl_function_context (TYPE_MAIN_DECL (nt)))
{
- cp_error ("type `%T' composed from a local class is not a valid template-argument", t);
- cp_error (" trying to instantiate `%D'", gen_tmpl);
+ cp_error (ec_type_composed_from_a_local_class_is_not_a_valid_templateargument, t);
+ cp_error (ec_trying_to_instantiate, gen_tmpl);
fndecl = error_mark_node;
goto out;
}
@@ -6832,7 +6829,7 @@ type_unification_real (tparms, targs, parms, args, subr,
if (TREE_VEC_ELT (targs, i) == NULL_TREE)
{
if (!allow_incomplete)
- error ("incomplete type unification");
+ cp_error (ec_incomplete_type_unification);
return 2;
}
return 0;
@@ -7664,7 +7661,7 @@ do_decl_instantiation (declspecs, declarator, storage)
if (! DECL_LANG_SPECIFIC (decl))
{
- cp_error ("explicit instantiation of non-template `%#D'", decl);
+ cp_error (ec_explicit_instantiation_of_nontemplate, decl);
return;
}
else if (TREE_CODE (decl) == VAR_DECL)
@@ -7680,13 +7677,13 @@ do_decl_instantiation (declspecs, declarator, storage)
result = lookup_field (DECL_CONTEXT (decl), DECL_NAME (decl), 0, 0);
if (result && TREE_CODE (result) != VAR_DECL)
{
- cp_error ("no matching template for `%D' found", result);
+ cp_error (ec_no_matching_template_for_found, result);
return;
}
}
else if (TREE_CODE (decl) != FUNCTION_DECL)
{
- cp_error ("explicit instantiation of `%#D'", decl);
+ cp_error (ec_explicit_instantiation_of, decl);
return;
}
else
@@ -7703,8 +7700,8 @@ do_decl_instantiation (declspecs, declarator, storage)
No program shall both explicitly instantiate and explicitly
specialize a template. */
- cp_error ("explicit instantiation of `%#D' after", result);
- cp_error_at ("explicit specialization here", result);
+ cp_error (ec_explicit_instantiation_of_after, result);
+ cp_error_at (ec_explicit_specialization_here, result);
return;
}
else if (DECL_EXPLICIT_INSTANTIATION (result))
@@ -7718,7 +7715,7 @@ do_decl_instantiation (declspecs, declarator, storage)
first instantiation was `extern' and the second is not, and
EXTERN_P for the opposite case. */
if (DECL_INTERFACE_KNOWN (result) && !extern_p)
- cp_error ("duplicate explicit instantiation of `%#D'", result);
+ cp_error (ec_duplicate_explicit_instantiation_of, result);
/* If we've already instantiated the template, just return now. */
if (DECL_INTERFACE_KNOWN (result))
@@ -7726,12 +7723,12 @@ do_decl_instantiation (declspecs, declarator, storage)
}
else if (!DECL_IMPLICIT_INSTANTIATION (result))
{
- cp_error ("no matching template for `%D' found", result);
+ cp_error (ec_no_matching_template_for_found, result);
return;
}
else if (!DECL_TEMPLATE_INFO (result))
{
- cp_pedwarn ("explicit instantiation of non-template `%#D'", result);
+ cp_pedwarn (ec_explicit_instantiation_of_nontemplate, result);
return;
}
@@ -7743,11 +7740,11 @@ do_decl_instantiation (declspecs, declarator, storage)
else if (storage == ridpointers[(int) RID_EXTERN])
{
if (pedantic)
- cp_pedwarn ("ANSI C++ forbids the use of `extern' on explicit instantiations");
+ cp_pedwarn (ec_forbids_the_use_of_extern_on_explicit_instantiations);
extern_p = 1;
}
else
- cp_error ("storage class `%D' applied to template instantiation",
+ cp_error (ec_storage_class_applied_to_template_instantiation,
storage);
SET_DECL_EXPLICIT_INSTANTIATION (result);
@@ -7787,7 +7784,7 @@ do_type_instantiation (t, storage)
if (! IS_AGGR_TYPE (t) || ! CLASSTYPE_TEMPLATE_INFO (t))
{
- cp_error ("explicit instantiation of non-template type `%T'", t);
+ cp_error (ec_explicit_instantiation_of_nontemplate_type, t);
return;
}
@@ -7800,7 +7797,7 @@ do_type_instantiation (t, storage)
if (TYPE_SIZE (t) == NULL_TREE)
{
- cp_error ("explicit instantiation of `%#T' before definition of template",
+ cp_error (ec_explicit_instantiation_of_before_definition_of_template,
t);
return;
}
@@ -7808,8 +7805,8 @@ do_type_instantiation (t, storage)
if (storage != NULL_TREE)
{
if (pedantic)
- cp_pedwarn("ANSI C++ forbids the use of `%s' on explicit instantiations",
- IDENTIFIER_POINTER (storage));
+ cp_pedwarn (ec_forbids_the_use_of_s_on_explicit_instantiations,
+ IDENTIFIER_POINTER (storage));
if (storage == ridpointers[(int) RID_INLINE])
nomem_p = 1;
@@ -7819,7 +7816,7 @@ do_type_instantiation (t, storage)
static_p = 1;
else
{
- cp_error ("storage class `%D' applied to template instantiation",
+ cp_error (ec_storage_class_applied_to_template_instantiation,
storage);
extern_p = 0;
}
@@ -7831,8 +7828,8 @@ do_type_instantiation (t, storage)
No program shall both explicitly instantiate and explicitly
specialize a template. */
- cp_error ("explicit instantiation of `%#T' after", t);
- cp_error_at ("explicit specialization here", t);
+ cp_error (ec_explicit_instantiation_of_type_after, t);
+ cp_error_at (ec_explicit_specialization_here, t);
return;
}
else if (CLASSTYPE_EXPLICIT_INSTANTIATION (t))
@@ -7846,7 +7843,7 @@ do_type_instantiation (t, storage)
instantiation was `extern', and if EXTERN_P then the second
is. Both cases are OK. */
if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p)
- cp_error ("duplicate explicit instantiation of `%#T'", t);
+ cp_error (ec_duplicate_explicit_instantiation_of_type, t);
/* If we've already instantiated the template, just return now. */
if (!CLASSTYPE_INTERFACE_ONLY (t))
@@ -7942,11 +7939,11 @@ regenerate_decl_from_template (decl, tmpl)
args = DECL_TI_ARGS (decl);
code_pattern = DECL_TEMPLATE_RESULT (tmpl);
- /* Unregister the specialization so that when we tsubst we will not
- just return DECL. We don't have to unregister DECL from TMPL
- because if would only be registered there if it were a partial
- instantiation of a specialization, which it isn't: it's a full
- instantiation. */
+ /* Unregister the specialization so that when we call tsubst we will
+ not just return DECL. We don't have to unregister DECL from TMPL
+ (as opposed to GEN_TMPL) because if would only be registered
+ there if it were a partial instantiation of a specialization,
+ which it isn't: it's a full instantiation. */
gen_tmpl = most_general_template (tmpl);
unregistered = unregister_specialization (decl, gen_tmpl);
@@ -8158,7 +8155,7 @@ instantiate_decl (d)
member function or static data member of a class template
shall be present in every translation unit in which it is
explicitly instantiated. */
- cp_error ("explicit instantiation of `%D' but no definition available",
+ cp_error (ec_explicit_instantiation_of_but_no_definition_available,
d);
add_pending_template (d);
@@ -8314,7 +8311,7 @@ add_maybe_template (d, fns)
return;
if (t == error_mark_node)
{
- cp_error ("ambiguous template instantiation for `%D'", d);
+ cp_error (ec_ambiguous_template_instantiation_for, d);
return;
}
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index 742250d..6927fcf 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -254,7 +254,7 @@ get_base_filename (filename)
if (p && ! compiling)
{
- warning ("-frepo must be used with -c");
+ cp_warning (ec_frepo_must_be_used_with_c);
flag_use_repository = 0;
return NULL;
}
@@ -344,7 +344,7 @@ init_repo (filename)
}
break;
default:
- error ("mysterious repository information in %s", repo_name);
+ cp_error (ec_mysterious_repository_information_in_s, repo_name);
}
obstack_free (&temporary_obstack, buf);
}
@@ -359,7 +359,7 @@ reopen_repo_file_for_write ()
if (repo_file == 0)
{
- error ("can't create repository information file `%s'", repo_name);
+ cp_error (ec_cant_create_repository_information_file_s, repo_name);
flag_use_repository = 0;
}
}
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 01c4a86..c2af5f6 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -101,7 +101,7 @@ build_headof (exp)
if (TREE_CODE (type) != POINTER_TYPE)
{
- error ("`headof' applied to non-pointer type");
+ cp_error (ec_headof_applied_to_nonpointer_type);
return error_mark_node;
}
type = TREE_TYPE (type);
@@ -190,7 +190,7 @@ get_tinfo_fn_dynamic (exp)
if (type_unknown_p (exp))
{
- error ("typeid of overloaded function");
+ cp_error (ec_typeid_of_overloaded_function);
return error_mark_node;
}
@@ -211,7 +211,7 @@ get_tinfo_fn_dynamic (exp)
if (! flag_rtti)
{
- warning ("taking dynamic typeid of object without -frtti");
+ cp_warning (ec_taking_dynamic_typeid_of_object_without_frtti);
push_obstacks (&permanent_obstack, &permanent_obstack);
init_rtti_processing ();
pop_obstacks ();
@@ -401,7 +401,7 @@ get_typeid (type)
if (! flag_rtti)
{
- warning ("requesting typeid of object without -frtti");
+ cp_warning (ec_requesting_typeid_of_object_without_frtti);
push_obstacks (&permanent_obstack, &permanent_obstack);
init_rtti_processing ();
pop_obstacks ();
@@ -554,7 +554,7 @@ build_dynamic_cast_1 (type, expr)
if (TREE_CODE (expr) == VAR_DECL
&& TREE_CODE (TREE_TYPE (expr)) == RECORD_TYPE)
{
- cp_warning ("dynamic_cast of `%#D' to `%#T' can never succeed",
+ cp_warning (ec_dynamic_cast_of_to_can_never_succeed,
expr, type);
return throw_bad_cast ();
}
@@ -566,7 +566,7 @@ build_dynamic_cast_1 (type, expr)
if (TREE_CODE (op) == VAR_DECL
&& TREE_CODE (TREE_TYPE (op)) == RECORD_TYPE)
{
- cp_warning ("dynamic_cast of `%#D' to `%#T' can never succeed",
+ cp_warning (ec_dynamic_cast_of_to_can_never_succeed,
expr, type);
retval = build_int_2 (0, 0);
TREE_TYPE (retval) = type;
@@ -650,7 +650,7 @@ build_dynamic_cast_1 (type, expr)
}
fail:
- cp_error ("cannot dynamic_cast `%E' (of type `%#T') to type `%#T'",
+ cp_error (ec_cannot_dynamic_cast_of_type_to_type,
expr, exprtype, type);
return error_mark_node;
}
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index c472bf0..f53c988 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -278,13 +278,13 @@ get_binfo (parent, binfo, protect)
if (dist == -3)
{
- cp_error ("fields of `%T' are inaccessible in `%T' due to private inheritance",
+ cp_error (ec_fields_of_are_inaccessible_in_due_to_private_inheritance,
parent, type);
return error_mark_node;
}
else if (dist == -2 && protect)
{
- cp_error ("type `%T' is ambiguous base class for type `%T'", parent,
+ cp_error (ec_type_is_ambiguous_base_class_for_type, parent,
type);
return error_mark_node;
}
@@ -884,7 +884,7 @@ lookup_field (xbasetype, name, protect, want_type)
we know that binfo of a virtual base class will always == itself when
found along any line. (mrs) */
- char *errstr = 0;
+ error_code ec = ec_last_error_code;
#if 0
/* We cannot search for constructor/destructor names like this. */
@@ -952,20 +952,10 @@ lookup_field (xbasetype, name, protect, want_type)
{
if (TREE_PRIVATE (rval) | TREE_PROTECTED (rval))
this_v = compute_access (basetype_path, rval);
- if (TREE_CODE (rval) == CONST_DECL)
- {
- if (this_v == access_private_node)
- errstr = "enum `%D' is a private value of class `%T'";
- else if (this_v == access_protected_node)
- errstr = "enum `%D' is a protected value of class `%T'";
- }
- else
- {
- if (this_v == access_private_node)
- errstr = "member `%D' is a private member of class `%T'";
- else if (this_v == access_protected_node)
- errstr = "member `%D' is a protected member of class `%T'";
- }
+ if (this_v == access_private_node)
+ ec = ec_private_in_class;
+ else if (this_v == access_protected_node)
+ ec = ec_protected_in_class;
}
rval_binfo = basetype_path;
@@ -1074,7 +1064,7 @@ lookup_field (xbasetype, name, protect, want_type)
else
{
/* This is ambiguous. */
- errstr = "request for member `%D' is ambiguous";
+ ec = ec_ambiguous_member;
protect += 2;
break;
}
@@ -1109,10 +1099,10 @@ lookup_field (xbasetype, name, protect, want_type)
}
if (rval == NULL_TREE)
- errstr = 0;
+ ec = ec_last_error_code;
/* If this FIELD_DECL defines its own access level, deal with that. */
- if (rval && errstr == 0
+ if (rval && ec == ec_last_error_code
&& (protect & 1)
&& DECL_LANG_SPECIFIC (rval)
&& DECL_ACCESS (rval))
@@ -1128,7 +1118,7 @@ lookup_field (xbasetype, name, protect, want_type)
new_v = compute_access (TREE_VALUE (TREE_CHAIN (*tp)), rval);
if (this_v != access_default_node && new_v != this_v)
{
- errstr = "conflicting access to member `%D'";
+ ec = ec_conflicting_access;
this_v = access_default_node;
}
own_access = new_v;
@@ -1147,20 +1137,18 @@ lookup_field (xbasetype, name, protect, want_type)
}
search_stack = pop_search_level (search_stack);
- if (errstr == 0)
+ if (ec == ec_last_error_code)
{
if (own_access == access_private_node)
- errstr = "member `%D' declared private";
+ ec = ec_member_private;
else if (own_access == access_protected_node)
- errstr = "member `%D' declared protected";
+ ec = ec_member_protected;
else if (this_v == access_private_node)
- errstr = TREE_PRIVATE (rval)
- ? "member `%D' is private"
- : "member `%D' is from private base class";
+ ec = TREE_PRIVATE (rval)
+ ? ec_member_private : ec_member_in_private_base;
else if (this_v == access_protected_node)
- errstr = TREE_PROTECTED (rval)
- ? "member `%D' is protected"
- : "member `%D' is from protected base class";
+ ec = TREE_PROTECTED (rval)
+ ? ec_member_protected : ec_member_in_protected_base;
}
out:
@@ -1172,9 +1160,9 @@ lookup_field (xbasetype, name, protect, want_type)
protect = 0;
}
- if (errstr && protect)
+ if (ec != ec_last_error_code && protect)
{
- cp_error (errstr, name, type);
+ cp_error (ec, name, type);
rval = error_mark_node;
}
@@ -1243,7 +1231,7 @@ lookup_nested_field (name, complain)
enums in nested classes) when we do need to call
this fn at parse time. So, in those cases, we pass
complain as a 0 and just return a NULL_TREE. */
- cp_error ("assignment to non-static member `%D' of enclosing class `%T'",
+ cp_error (ec_assignment_to_nonstatic_member_of_enclosing_class,
id, DECL_CONTEXT (t));
/* Mark this for do_identifier(). It would otherwise
claim that the variable was undeclared. */
@@ -1367,7 +1355,7 @@ lookup_fnfields (basetype_path, name, complain)
/* For now, don't try this. */
int protect = complain;
- char *errstr = 0;
+ error_code ec = ec_last_error_code;
if (complain == -1)
{
@@ -1524,7 +1512,7 @@ lookup_fnfields (basetype_path, name, complain)
else
{
/* This is ambiguous. */
- errstr = "request for method `%D' is ambiguous";
+ ec = ec_ambiguous_member;
rvals = error_mark_node;
break;
}
@@ -1542,9 +1530,9 @@ lookup_fnfields (basetype_path, name, complain)
}
search_stack = pop_search_level (search_stack);
- if (errstr && protect)
+ if (ec != ec_last_error_code && protect)
{
- cp_error (errstr, name);
+ cp_error (ec, name);
rvals = error_mark_node;
}
@@ -1854,21 +1842,21 @@ get_matching_virtual (binfo, fndecl, dtorp)
if (pedantic && i == -1)
{
- cp_pedwarn_at ("invalid covariant return type for `%#D' (must be pointer or reference to class)", fndecl);
- cp_pedwarn_at (" overriding `%#D'", tmp);
+ cp_pedwarn_at (ec_invalid_covariant_return_type_for_must_be_pointer_or_reference_to_class, fndecl);
+ cp_pedwarn_at (ec_overriding, tmp);
}
}
else if (IS_AGGR_TYPE_2 (brettype, drettype)
&& comptypes (brettype, drettype, 0))
{
- error ("invalid covariant return type (must use pointer or reference)");
- cp_error_at (" overriding `%#D'", tmp);
- cp_error_at (" with `%#D'", fndecl);
+ cp_error (ec_invalid_covariant_return_type_must_use_pointer_or_reference);
+ cp_error_at (ec_overriding, tmp);
+ cp_error_at (ec_with, fndecl);
}
else if (IDENTIFIER_ERROR_LOCUS (name) == NULL_TREE)
{
- cp_error_at ("conflicting return type specified for virtual function `%#D'", fndecl);
- cp_error_at (" overriding definition as `%#D'", tmp);
+ cp_error_at (ec_conflicting_return_type_specified_for_virtual_function, fndecl);
+ cp_error_at (ec_overriding_definition_as, tmp);
SET_IDENTIFIER_ERROR_LOCUS (name, basetype);
}
break;
@@ -2446,7 +2434,7 @@ virtual_context (fndecl, t, vbase)
}
}
/* This shouldn't happen, I don't want errors! */
- warning ("recoverable compiler error, fixups for virtual function");
+ cp_warning (ec_recoverable_compiler_error_fixups_for_virtual_function);
return vbase;
}
while (path)
@@ -2709,7 +2697,7 @@ expand_indirect_vtbls_init (binfo, true_exp, decl_ptr)
tree in_charge_node = lookup_name (in_charge_identifier, 0);
if (! in_charge_node)
{
- warning ("recoverable internal compiler error, nobody's in charge!");
+ cp_warning (ec_recoverable_internal_compiler_error_nobodys_in_charge);
in_charge_node = integer_zero_node;
}
in_charge_node = build_binary_op (EQ_EXPR, in_charge_node, integer_zero_node, 1);
@@ -2837,9 +2825,9 @@ envelope_add_decl (type, decl, values)
|| ! TREE_PRIVATE (value)))
/* Should figure out access control more accurately. */
{
- cp_warning_at ("member `%#D' is shadowed", value);
- cp_warning_at ("by member function `%#D'", decl);
- warning ("in this context");
+ cp_warning_at (ec_member_is_shadowed, value);
+ cp_warning_at (ec_by_member_function, decl);
+ cp_warning (ec_in_this_context);
}
context = DECL_REAL_CONTEXT (value);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index eee6616..f2fbe64 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -453,7 +453,7 @@ finish_break_stmt ()
if (processing_template_decl)
add_tree (build_min_nt (BREAK_STMT));
else if ( ! expand_exit_something ())
- cp_error ("break statement not within loop or switch");
+ cp_error (ec_break_statement_not_within_loop_or_switch);
}
/* Finish a continue-statement. */
@@ -465,7 +465,7 @@ finish_continue_stmt ()
if (processing_template_decl)
add_tree (build_min_nt (CONTINUE_STMT));
else if (! expand_continue_loop (0))
- cp_error ("continue statement not within a loop");
+ cp_error (ec_continue_statement_not_within_a_loop);
}
/* Begin a switch-statement. */
@@ -735,7 +735,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
{
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
- cp_warning ("%s qualifier ignored on asm",
+ cp_warning (ec_qualifier_ignored_on_asm,
IDENTIFIER_POINTER (cv_qualifier));
c_expand_asm_operands (string, output_operands,
@@ -748,7 +748,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
else
{
if (cv_qualifier != NULL_TREE)
- cp_warning ("%s qualifier ignored on asm",
+ cp_warning (ec_qualifier_ignored_on_asm,
IDENTIFIER_POINTER (cv_qualifier));
expand_asm (string);
}
@@ -895,15 +895,15 @@ finish_this_expr ()
else if (current_function_decl
&& DECL_STATIC_FUNCTION_P (current_function_decl))
{
- error ("`this' is unavailable for static member functions");
+ cp_error (ec_this_is_unavailable_for_static_member_functions);
result = error_mark_node;
}
else
{
if (current_function_decl)
- error ("invalid use of `this' in non-member function");
+ cp_error (ec_invalid_use_of_this_in_nonmember_function);
else
- error ("invalid use of `this' at top level");
+ cp_error (ec_invalid_use_of_this_at_top_level);
result = error_mark_node;
}
@@ -941,7 +941,7 @@ finish_object_call_expr (fn, object, args)
fn = DECL_NAME (fn);
else
{
- cp_error ("calling type `%T' like a method", fn);
+ cp_error (ec_calling_type_like_a_method, fn);
return error_mark_node;
}
}
@@ -961,7 +961,7 @@ finish_qualified_object_call_expr (fn, object, args)
{
if (IS_SIGNATURE (TREE_OPERAND (fn, 0)))
{
- warning ("signature name in scope resolution ignored");
+ cp_warning (ec_signature_name_in_scope_resolution_ignored);
return finish_object_call_expr (TREE_OPERAND (fn, 1), object, args);
}
else
@@ -980,13 +980,13 @@ finish_pseudo_destructor_call_expr (object, scope, destructor)
tree destructor;
{
if (scope && scope != destructor)
- cp_error ("destructor specifier `%T::~%T()' must have matching names",
+ cp_error (ec_destructor_specifier_must_have_matching_names,
scope, destructor);
if ((scope == NULL_TREE || IDENTIFIER_GLOBAL_VALUE (destructor))
&& (TREE_CODE (TREE_TYPE (object)) !=
TREE_CODE (TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (destructor)))))
- cp_error ("`%E' is not of type `%T'", object, destructor);
+ cp_error (ec_is_not_of_type, object, destructor);
return cp_convert (void_type_node, object);
}
@@ -1159,7 +1159,7 @@ finish_template_type_parm (aggr, identifier)
sorry ("signature as template type parameter");
else if (aggr != class_type_node)
{
- pedwarn ("template type parameters must use the keyword `class' or `typename'");
+ cp_pedwarn (ec_template_type_parameters_must_use_the_keyword_class_or_typename);
aggr = class_type_node;
}
@@ -1459,19 +1459,19 @@ finish_base_specifier (access_specifier, base_class,
if (base_class == NULL_TREE)
{
- error ("invalid base class");
+ cp_error (ec_invalid_base_class);
type = error_mark_node;
}
else
type = TREE_TYPE (base_class);
if (current_aggr_is_signature && access_specifier)
- error ("access and source specifiers not allowed in signature");
+ cp_error (ec_access_and_source_specifiers_not_allowed_in_signature);
if (! is_aggr_type (type, 1))
result = NULL_TREE;
else if (current_aggr_is_signature
&& (! type) && (! IS_SIGNATURE (type)))
{
- error ("class name not allowed as base signature");
+ cp_error (ec_class_name_not_allowed_as_base_signature);
result = NULL_TREE;
}
else if (current_aggr_is_signature)
@@ -1482,7 +1482,7 @@ finish_base_specifier (access_specifier, base_class,
}
else if (type && IS_SIGNATURE (type))
{
- error ("signature name not allowed as base class");
+ cp_error (ec_signature_name_not_allowed_as_base_class);
result = NULL_TREE;
}
else
diff --git a/gcc/cp/sig.c b/gcc/cp/sig.c
index 65350db..e4ba4b7 100644
--- a/gcc/cp/sig.c
+++ b/gcc/cp/sig.c
@@ -492,7 +492,7 @@ build_signature_table_constructor (sig_ty, rhs)
if (oty_type == NULL_TREE || oty_type == error_mark_node)
{
- cp_error ("class `%T' does not contain type `%T'",
+ cp_error (ec_class_does_not_contain_type,
rhstype, oty_type);
undo_casts (sig_ty);
return error_mark_node;
@@ -518,7 +518,7 @@ build_signature_table_constructor (sig_ty, rhs)
{
if (! IS_DEFAULT_IMPLEMENTATION (sig_method))
{
- cp_error ("class `%T' does not contain method `%D'",
+ cp_error (ec_class_does_not_contain_method,
rhstype, sig_mname);
undo_casts (sig_ty);
return error_mark_node;
@@ -549,7 +549,7 @@ build_signature_table_constructor (sig_ty, rhs)
|| (compute_access (basetypes, rhs_method)
!= access_public_node))
{
- error ("class `%s' does not contain a method conforming to `%s'",
+ cp_error (ec_class_s_does_not_contain_a_method_conforming_to_s,
TYPE_NAME_STRING (rhstype),
fndecl_as_string (sig_method, 1));
undo_casts (sig_ty);
@@ -735,7 +735,7 @@ build_sigtable (sig_type, rhs_type, init_from)
if (SIGNATURE_HAS_OPAQUE_TYPEDECLS (sig_type)
&& SIGTABLE_HAS_BEEN_GENERATED (sig_type))
{
- error ("signature with opaque type implemented by multiple classes");
+ cp_error (ec_signature_with_opaque_type_implemented_by_multiple_classes);
return error_mark_node;
}
SIGTABLE_HAS_BEEN_GENERATED (sig_type) = 1;
@@ -806,13 +806,13 @@ build_signature_pointer_constructor (lhs, rhs)
&& (IS_SIGNATURE_POINTER (rhstype)
|| IS_SIGNATURE_REFERENCE (rhstype)))))
{
- error ("invalid assignment to signature pointer or reference");
+ cp_error (ec_invalid_assignment_to_signature_pointer_or_reference);
return error_mark_node;
}
if (TYPE_SIZE (sig_ty) == NULL_TREE)
{
- cp_error ("undefined signature `%T' used in signature %s declaration",
+ cp_error (ec_undefined_signature_used_in_signature_s_declaration,
sig_ty,
IS_SIGNATURE_POINTER (lhstype) ? "pointer" : "reference");
return error_mark_node;
@@ -1018,7 +1018,7 @@ build_signature_method_call (function, parms)
|| (IS_DEFAULT_IMPLEMENTATION (function)
&& (!deflt_call || deflt_call == error_mark_node)))
{
- compiler_error ("cannot build call of signature member function `%s'",
+ cp_compiler_error (ec_cannot_build_call_of_signature_member_function_s,
fndecl_as_string (function, 1));
return error_mark_node;
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 41475b5..b498068 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -221,7 +221,7 @@ lvalue_or_else (ref, string)
{
int win = lvalue_p (ref);
if (! win)
- error ("non-lvalue in %s", string);
+ cp_error (ec_nonlvalue_in_s, string);
return win;
}
@@ -755,7 +755,7 @@ layout_basetypes (rec, max)
my_friendly_assert (TREE_TYPE (field) == basetype, 23897);
if (get_base_distance (basetype, rec, 0, (tree*)0) == -2)
- cp_warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
+ cp_warning (ec_direct_base_inaccessible_in_due_to_ambiguity,
basetype, rec);
BINFO_OFFSET (base_binfo)
@@ -776,7 +776,7 @@ layout_basetypes (rec, max)
{
tree basetype = BINFO_TYPE (vbase_types);
if (get_base_distance (basetype, rec, 0, (tree*)0) == -2)
- cp_warning ("virtual base `%T' inaccessible in `%T' due to ambiguity",
+ cp_warning (ec_virtual_base_inaccessible_in_due_to_ambiguity,
basetype, rec);
}
}
@@ -1240,7 +1240,7 @@ binfo_value (elem, type)
tree type;
{
if (get_base_distance (elem, type, 0, (tree *)0) == -2)
- compiler_error ("base class `%s' ambiguous in binfo_value",
+ cp_compiler_error (ec_base_class_s_ambiguous_in_binfo_value,
TYPE_NAME_STRING (elem));
if (elem == type)
return TYPE_BINFO (type);
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 50ab3e6..dce89d8 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -216,7 +216,7 @@ require_instantiated_type (type, exp, errval)
{
if (TREE_TYPE (exp) == NULL_TREE)
{
- error ("argument list may not have an initializer list");
+ cp_error (ec_argument_list_may_not_have_an_initializer_list);
return errval;
}
@@ -590,7 +590,7 @@ common_type (t1, t2)
return build_type_attribute_variant (t2, attributes);
else
{
- compiler_error ("common_type called with uncommon aggregate types");
+ cp_compiler_error (ec_common_type_called_with_uncommon_aggregate_types);
return error_mark_node;
}
@@ -611,7 +611,7 @@ common_type (t1, t2)
else
{
if (binfo_or_else (b2, b1) == NULL_TREE)
- compiler_error ("common_type called with uncommon method types");
+ cp_compiler_error (ec_common_type_called_with_uncommon_method_types);
basetype = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t1)));
}
@@ -630,7 +630,7 @@ common_type (t1, t2)
t1 = build_exception_variant (t3, raises);
}
else
- compiler_error ("common_type called with uncommon method types");
+ cp_compiler_error (ec_common_type_called_with_uncommon_method_types);
return build_type_attribute_variant (t1, attributes);
@@ -646,7 +646,7 @@ common_type (t1, t2)
else if (binfo_or_else (b2, b1))
return build_type_attribute_variant (t1, attributes);
}
- compiler_error ("common_type called with uncommon member types");
+ cp_compiler_error (ec_common_type_called_with_uncommon_member_types);
default:
return build_type_attribute_variant (t1, attributes);
@@ -1269,7 +1269,7 @@ comp_target_parms (parms1, parms2, strict)
if (t1 == 0 && t2 != 0)
{
- cp_pedwarn ("ANSI C++ prohibits conversion from `(%#T)' to `(...)'",
+ cp_pedwarn (ec_prohibits_conversion_from_to,
parms2);
return self_promoting_args_p (t2);
}
@@ -1470,19 +1470,19 @@ c_sizeof (type)
if (code == FUNCTION_TYPE)
{
if (pedantic || warn_pointer_arith)
- pedwarn ("ANSI C++ forbids taking the sizeof a function type");
+ cp_pedwarn (ec_forbids_taking_the_sizeof_a_function_type);
return size_int (1);
}
if (code == METHOD_TYPE)
{
if (pedantic || warn_pointer_arith)
- pedwarn ("ANSI C++ forbids taking the sizeof a method type");
+ cp_pedwarn (ec_forbids_taking_the_sizeof_a_method_type);
return size_int (1);
}
if (code == VOID_TYPE)
{
if (pedantic || warn_pointer_arith)
- pedwarn ("ANSI C++ forbids taking the sizeof a void type");
+ cp_pedwarn (ec_forbids_taking_the_sizeof_a_void_type);
return size_int (1);
}
if (code == ERROR_MARK)
@@ -1507,13 +1507,13 @@ c_sizeof (type)
In that case we should be able to do better. */
if (IS_SIGNATURE (type))
{
- error ("`sizeof' applied to a signature type");
+ cp_error (ec_sizeof_applied_to_a_signature_type);
return size_int (0);
}
if (TYPE_SIZE (complete_type (type)) == 0)
{
- cp_error ("`sizeof' applied to incomplete type `%T'", type);
+ cp_error (ec_sizeof_applied_to_incomplete_type, type);
return size_int (0);
}
@@ -1536,7 +1536,7 @@ expr_sizeof (e)
if (TREE_CODE (e) == COMPONENT_REF
&& DECL_BIT_FIELD (TREE_OPERAND (e, 1)))
- error ("sizeof applied to a bit-field");
+ cp_error (ec_sizeof_applied_to_a_bitfield);
/* ANSI says arrays and functions are converted inside comma.
But we can't really convert them in build_compound_expr
because that would break commas in lvalues.
@@ -1552,7 +1552,7 @@ expr_sizeof (e)
&& ((TREE_TYPE (t)
&& TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
|| is_overloaded_fn (t)))
- pedwarn ("ANSI C++ forbids taking the sizeof a function type");
+ cp_pedwarn (ec_forbids_taking_the_sizeof_a_function_type);
}
return c_sizeof (TREE_TYPE (e));
}
@@ -1610,7 +1610,7 @@ c_alignof (type)
In that case we should be able to do better. */
if (IS_SIGNATURE (type))
{
- error ("`__alignof' applied to a signature type");
+ cp_error (ec_alignof_applied_to_a_signature_type);
return size_int (1);
}
@@ -1643,7 +1643,7 @@ decay_conversion (exp)
if (type == unknown_type_node)
{
- cp_pedwarn ("assuming & on overloaded member function");
+ cp_pedwarn (ec_assuming_on_overloaded_member_function);
return build_unary_op (ADDR_EXPR, exp, 0);
}
}
@@ -1670,7 +1670,7 @@ decay_conversion (exp)
if (code == VOID_TYPE)
{
- error ("void value not ignored as it ought to be");
+ cp_error (ec_void_value_not_ignored_as_it_ought_to_be);
return error_mark_node;
}
if (code == FUNCTION_TYPE)
@@ -1679,7 +1679,7 @@ decay_conversion (exp)
}
if (code == METHOD_TYPE)
{
- cp_pedwarn ("assuming & on `%E'", exp);
+ cp_pedwarn (ec_assuming_on, exp);
return build_unary_op (ADDR_EXPR, exp, 0);
}
if (code == ARRAY_TYPE)
@@ -1715,7 +1715,7 @@ decay_conversion (exp)
if (!lvalue_p (exp)
&& ! (TREE_CODE (exp) == CONSTRUCTOR && TREE_STATIC (exp)))
{
- error ("invalid use of non-lvalue array");
+ cp_error (ec_invalid_use_of_nonlvalue_array);
return error_mark_node;
}
@@ -1826,7 +1826,7 @@ string_conv_p (totype, exp, warn)
/* This warning is not very useful, as it complains about printf. */
if (warn && warn_write_strings)
- cp_warning ("deprecated conversion from string constant to `char *'");
+ cp_warning (ec_deprecated_conversion_from_string_constant_to_char);
return 1;
}
@@ -1844,13 +1844,13 @@ build_object_ref (datum, basetype, field)
dtype = TREE_TYPE (dtype);
if (! IS_AGGR_TYPE_CODE (TREE_CODE (dtype)))
{
- cp_error ("request for member `%T::%D' in expression of non-aggregate type `%T'",
+ cp_error (ec_request_for_member_in_expression_of_nonaggregate_type,
basetype, field, dtype);
return error_mark_node;
}
else if (IS_SIGNATURE (basetype))
{
- warning ("signature name in scope resolution ignored");
+ cp_warning (ec_signature_name_in_scope_resolution_ignored);
return build_component_ref (datum, field, NULL_TREE, 1);
}
else if (is_aggr_type (basetype, 1))
@@ -1983,7 +1983,7 @@ build_component_ref (datum, component, basetype_path, protect)
basetype_path, protect));
case TEMPLATE_DECL:
- cp_error ("invalid use of %D", datum);
+ cp_error (ec_invalid_use_of, datum);
datum = error_mark_node;
break;
@@ -2021,7 +2021,7 @@ build_component_ref (datum, component, basetype_path, protect)
if (! IS_AGGR_TYPE_CODE (code))
{
if (code != ERROR_MARK)
- cp_error ("request for member `%D' in `%E', which is of non-aggregate type `%T'",
+ cp_error (ec_request_for_member_in_which_is_of_nonaggregate_type,
component, datum, basetype);
return error_mark_node;
}
@@ -2033,13 +2033,13 @@ build_component_ref (datum, component, basetype_path, protect)
{
if (TYPE_IDENTIFIER (basetype) != TREE_OPERAND (component, 0))
{
- cp_error ("destructor specifier `%T::~%T' must have matching names",
+ cp_error (ec_destructor_specifier_must_have_matching_names,
basetype, TREE_OPERAND (component, 0));
return error_mark_node;
}
if (! TYPE_HAS_DESTRUCTOR (basetype))
{
- cp_error ("type `%T' has no destructor", basetype);
+ cp_error (ec_type_has_no_destructor, basetype);
return error_mark_node;
}
return TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (basetype), 1);
@@ -2056,7 +2056,7 @@ build_component_ref (datum, component, basetype_path, protect)
field = component;
else if (TREE_CODE (component) == TYPE_DECL)
{
- cp_pedwarn ("invalid use of type decl `%#D' as expression", component);
+ cp_pedwarn (ec_invalid_use_of_type_decl_as_expression, component);
return component;
}
else
@@ -2117,9 +2117,9 @@ build_component_ref (datum, component, basetype_path, protect)
datum, fndecl);
}
if (access == access_protected_node)
- cp_error ("member function `%D' is protected", fndecl);
+ cp_error (ec_member_function_is_protected, fndecl);
else
- cp_error ("member function `%D' is private", fndecl);
+ cp_error (ec_member_function_is_private, fndecl);
return error_mark_node;
}
else
@@ -2135,7 +2135,7 @@ build_component_ref (datum, component, basetype_path, protect)
}
}
- cp_error ("`%#T' has no member named `%D'", basetype, name);
+ cp_error (ec_has_no_member_named, basetype, name);
return error_mark_node;
}
else if (TREE_TYPE (field) == error_mark_node)
@@ -2144,7 +2144,7 @@ build_component_ref (datum, component, basetype_path, protect)
if (TREE_CODE (field) != FIELD_DECL)
{
if (TREE_CODE (field) == TYPE_DECL)
- cp_pedwarn ("invalid use of type decl `%#D' as expression", field);
+ cp_pedwarn (ec_invalid_use_of_type_decl_as_expression, field);
else if (DECL_RTL (field) != 0)
mark_used (field);
else
@@ -2171,7 +2171,7 @@ build_component_ref (datum, component, basetype_path, protect)
tree addr = build_unary_op (ADDR_EXPR, datum, 0);
if (integer_zerop (addr))
{
- error ("invalid reference to NULL ptr, use ptr-to-member instead");
+ cp_error (ec_invalid_reference_to_ptr_use_ptrtomember_instead);
return error_mark_node;
}
if (VBASE_NAME_P (DECL_NAME (field)))
@@ -2300,16 +2300,16 @@ build_indirect_ref (ptr, errorstring)
/* `pointer' won't be an error_mark_node if we were given a
pointer to member, so it's cool to check for this here. */
else if (TYPE_PTRMEMFUNC_P (type))
- error ("invalid use of `%s' on pointer to member function", errorstring);
+ cp_error (ec_invalid_use_of_s_on_pointer_to_member_function, errorstring);
else if (TREE_CODE (type) == RECORD_TYPE
&& (IS_SIGNATURE_POINTER (type) || IS_SIGNATURE_REFERENCE (type)))
- error ("cannot dereference signature pointer/reference");
+ cp_error (ec_cannot_dereference_signature_pointerreference);
else if (pointer != error_mark_node)
{
if (errorstring)
- error ("invalid type argument of `%s'", errorstring);
+ cp_error (ec_invalid_type_argument_of_s, errorstring);
else
- error ("invalid type argument");
+ cp_error (ec_invalid_type_argument);
}
return error_mark_node;
}
@@ -2333,7 +2333,7 @@ build_array_ref (array, idx)
{
if (idx == 0)
{
- error ("subscript missing in array reference");
+ cp_error (ec_subscript_missing_in_array_reference);
return error_mark_node;
}
@@ -2354,14 +2354,14 @@ build_array_ref (array, idx)
must have done so deliberately. */
if (warn_char_subscripts
&& TYPE_MAIN_VARIANT (TREE_TYPE (idx)) == char_type_node)
- warning ("array subscript has type `char'");
+ cp_warning (ec_array_subscript_has_type_char);
/* Apply default promotions *after* noticing character types. */
idx = default_conversion (idx);
if (TREE_CODE (TREE_TYPE (idx)) != INTEGER_TYPE)
{
- error ("array subscript is not an integer");
+ cp_error (ec_array_subscript_is_not_an_integer);
return error_mark_node;
}
@@ -2390,7 +2390,7 @@ build_array_ref (array, idx)
}
if (pedantic && !lvalue_p (array))
- pedwarn ("ANSI C++ forbids subscripting non-lvalue array");
+ cp_pedwarn (ec_forbids_subscripting_nonlvalue_array);
/* Note in C++ it is valid to subscript a `register' array, since
it is valid to take the address of something with that
@@ -2401,7 +2401,7 @@ build_array_ref (array, idx)
while (TREE_CODE (foo) == COMPONENT_REF)
foo = TREE_OPERAND (foo, 0);
if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo))
- warning ("subscripting array declared `register'");
+ cp_warning (ec_subscripting_array_declared_register);
}
type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array)));
@@ -2441,12 +2441,12 @@ build_array_ref (array, idx)
if (TREE_CODE (TREE_TYPE (ar)) != POINTER_TYPE)
{
- error ("subscripted value is neither array nor pointer");
+ cp_error (ec_subscripted_value_is_neither_array_nor_pointer);
return error_mark_node;
}
if (TREE_CODE (TREE_TYPE (ind)) != INTEGER_TYPE)
{
- error ("array subscript is not an integer");
+ cp_error (ec_array_subscript_is_not_an_integer);
return error_mark_node;
}
@@ -2573,7 +2573,7 @@ build_x_function_call (function, params, decl)
/* Call via a pointer to member function. */
if (decl == NULL_TREE)
{
- error ("pointer to member function called, but not in class scope");
+ cp_error (ec_pointer_to_member_function_called_but_not_in_class_scope);
return error_mark_node;
}
/* What other type of POINTER_TYPE could this be? */
@@ -2597,7 +2597,7 @@ build_x_function_call (function, params, decl)
{
if (current_class_type == NULL_TREE)
{
- error ("object missing in call to method `%s'",
+ cp_error (ec_object_missing_in_call_to_method_s,
IDENTIFIER_POINTER (function));
return error_mark_node;
}
@@ -2629,7 +2629,7 @@ build_x_function_call (function, params, decl)
{
if (OVL_FUNCTION (function) == NULL_TREE)
{
- cp_error ("function `%D' declared overloaded, but no definitions appear with which to resolve it?!?",
+ cp_error (ec_function_declared_overloaded_but_no_definitions_appear_with_which_to_resolve_it,
TREE_PURPOSE (function));
return error_mark_node;
}
@@ -2709,9 +2709,9 @@ build_x_function_call (function, params, decl)
{
if (current_function_decl
&& DECL_STATIC_FUNCTION_P (current_function_decl))
- error ("invalid call to member function needing `this' in static member function scope");
+ cp_error (ec_invalid_call_to_member_function_needing_this_in_static_member_function_scope);
else
- error ("pointer to member function called, but not in class scope");
+ cp_error (ec_pointer_to_member_function_called_but_not_in_class_scope);
return error_mark_node;
}
if (TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE
@@ -2829,7 +2829,7 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
if (instance_ptr == error_mark_node
&& TREE_CODE (e1) != ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (e1, 0)) != FUNCTION_DECL)
- cp_error ("object missing in `%E'", function);
+ cp_error (ec_object_missing_in, function);
function = e1;
}
@@ -2867,7 +2867,7 @@ build_function_call_real (function, params, require_complete, flags)
/* Convert anything with function type to a pointer-to-function. */
if (pedantic && DECL_MAIN_P (function))
- pedwarn ("ANSI C++ forbids calling `main' from within program");
+ cp_pedwarn (ec_forbids_calling_main_from_within_program);
/* Differs from default_conversion by not setting TREE_ADDRESSABLE
(because calling an inline function does not mean the function
@@ -2892,7 +2892,7 @@ build_function_call_real (function, params, require_complete, flags)
if (TYPE_PTRMEMFUNC_P (fntype))
{
- cp_error ("must use .* or ->* to call pointer-to-member function in `%E (...)'",
+ cp_error (ec_must_use_or_to_call_pointertomember_function_in,
function);
return error_mark_node;
}
@@ -2905,7 +2905,7 @@ build_function_call_real (function, params, require_complete, flags)
|| is_method
|| TREE_CODE (function) == TEMPLATE_ID_EXPR))
{
- cp_error ("`%E' cannot be used as a function", function);
+ cp_error (ec_cannot_be_used_as_a_function, function);
return error_mark_node;
}
@@ -3038,12 +3038,12 @@ convert_arguments (typelist, values, fndecl, flags)
{
if (fndecl)
{
- cp_error_at ("too many arguments to %s `%+D'", called_thing,
+ cp_error_at (ec_too_many_arguments_to_s, called_thing,
fndecl);
- error ("at this point in file");
+ cp_error (ec_at_this_point_in_file);
}
else
- error ("too many arguments to function");
+ cp_error (ec_too_many_arguments_to_function);
/* In case anybody wants to know if this argument
list is valid. */
if (result)
@@ -3063,10 +3063,10 @@ convert_arguments (typelist, values, fndecl, flags)
if (TREE_CODE (val) == ADDR_EXPR)
val = TREE_OPERAND (val, 0);
if (really_overloaded_fn (val))
- cp_error ("insufficient type information to resolve address of overloaded function `%D'",
+ cp_error (ec_insufficient_type_information_to_resolve_address_of_overloaded_function,
DECL_NAME (get_first_fn (val)));
else
- error ("insufficient type information in parameter list");
+ cp_error (ec_insufficient_type_information_in_parameter_list);
val = integer_zero_node;
}
else if (TREE_CODE (val) == OFFSET_REF
@@ -3105,7 +3105,7 @@ convert_arguments (typelist, values, fndecl, flags)
if (TYPE_SIZE (complete_type (type)) == 0)
{
- error ("parameter type of called function is incomplete");
+ cp_error (ec_parameter_type_of_called_function_is_incomplete);
parmval = val;
}
else
@@ -3166,13 +3166,13 @@ convert_arguments (typelist, values, fndecl, flags)
{
if (fndecl)
{
- char *buf = (char *)alloca (32 + strlen (called_thing));
- sprintf (buf, "too few arguments to %s `%%#D'", called_thing);
- cp_error_at (buf, fndecl);
- error ("at this point in file");
+ cp_error_at (ec_too_few_arguments,
+ called_thing,
+ fndecl);
+ cp_error (ec_at_this_point_in_file);
}
else
- error ("too few arguments to function");
+ cp_error (ec_too_few_arguments_to_function);
return error_mark_list;
}
}
@@ -3245,7 +3245,7 @@ build_binary_op (code, arg1, arg2, convert_p)
are done in the narrower type when that gives the same result).
Constant folding is also done before the result is returned.
- ERROR_CODE is the code that determines what to say in error messages.
+ ERR_CODE is the code that determines what to say in error messages.
It is usually, but not always, the same as CODE.
Note that the operands will never have enumeral types
@@ -3257,10 +3257,10 @@ build_binary_op (code, arg1, arg2, convert_p)
multiple inheritance, and deal with pointer to member functions. */
tree
-build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
+build_binary_op_nodefault (code, orig_op0, orig_op1, err_code)
enum tree_code code;
tree orig_op0, orig_op1;
- enum tree_code error_code;
+ enum tree_code err_code;
{
tree op0, op1;
register enum tree_code code0, code1;
@@ -3380,9 +3380,9 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
|| code1 == COMPLEX_TYPE))
{
if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1))
- cp_warning ("division by zero in `%E / 0'", op0);
+ cp_warning (ec_division_by_zero_in_div, op0);
else if (TREE_CODE (op1) == REAL_CST && real_zerop (op1))
- cp_warning ("division by zero in `%E / 0.'", op0);
+ cp_warning (ec_division_by_zero_in_div, op0);
if (!(code0 == INTEGER_TYPE && code1 == INTEGER_TYPE))
resultcode = RDIV_EXPR;
@@ -3437,9 +3437,9 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
if (code1 == INTEGER_TYPE && integer_zerop (op1))
- cp_warning ("division by zero in `%E %% 0'", op0);
+ cp_warning (ec_division_by_zero_in_mod, op0);
else if (code1 == REAL_TYPE && real_zerop (op1))
- cp_warning ("division by zero in `%E %% 0.'", op0);
+ cp_warning (ec_division_by_zero_in_mod, op0);
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
@@ -3474,7 +3474,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
if (TREE_CODE (op1) == INTEGER_CST)
{
if (tree_int_cst_lt (op1, integer_zero_node))
- warning ("right shift count is negative");
+ cp_warning (ec_right_shift_count_is_negative);
else
{
if (TREE_INT_CST_LOW (op1) | TREE_INT_CST_HIGH (op1))
@@ -3482,7 +3482,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
if (TREE_INT_CST_HIGH (op1) != 0
|| ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1)
>= TYPE_PRECISION (type0)))
- warning ("right shift count >= width of type");
+ cp_warning (ec_right_shift_count_width_of_type);
}
}
/* Convert the shift-count to an integer, regardless of
@@ -3501,11 +3501,11 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
if (TREE_CODE (op1) == INTEGER_CST)
{
if (tree_int_cst_lt (op1, integer_zero_node))
- warning ("left shift count is negative");
+ cp_warning (ec_left_shift_count_is_negative);
else if (TREE_INT_CST_HIGH (op1) != 0
|| ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1)
>= TYPE_PRECISION (type0)))
- warning ("left shift count >= width of type");
+ cp_warning (ec_left_shift_count_width_of_type);
}
/* Convert the shift-count to an integer, regardless of
size of value being shifted. */
@@ -3524,12 +3524,12 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
if (TREE_CODE (op1) == INTEGER_CST)
{
if (tree_int_cst_lt (op1, integer_zero_node))
- warning ("%s rotate count is negative",
+ cp_warning (ec_s_rotate_count_is_negative,
(code == LROTATE_EXPR) ? "left" : "right");
else if (TREE_INT_CST_HIGH (op1) != 0
|| ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1)
>= TYPE_PRECISION (type0)))
- warning ("%s rotate count >= width of type",
+ cp_warning (ec_s_rotate_count_width_of_type,
(code == LROTATE_EXPR) ? "left" : "right");
}
/* Convert the shift-count to an integer, regardless of
@@ -3558,18 +3558,18 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
{
if (pedantic && TREE_CODE (tt1) == FUNCTION_TYPE
&& tree_int_cst_lt (TYPE_SIZE (type0), TYPE_SIZE (type1)))
- pedwarn ("ANSI C++ forbids comparison of `void *' with function pointer");
+ cp_pedwarn (ec_forbids_comparison_of_void_with_function_pointer);
else if (TREE_CODE (tt1) == OFFSET_TYPE)
- pedwarn ("ANSI C++ forbids conversion of a pointer to member to `void *'");
+ cp_pedwarn (ec_forbids_conversion_of_a_pointer_to_member_to_void);
}
else if (tt1 == void_type_node)
{
if (pedantic && TREE_CODE (tt0) == FUNCTION_TYPE
&& tree_int_cst_lt (TYPE_SIZE (type1), TYPE_SIZE (type0)))
- pedwarn ("ANSI C++ forbids comparison of `void *' with function pointer");
+ cp_pedwarn (ec_forbids_comparison_of_void_with_function_pointer);
}
else
- cp_pedwarn ("comparison of distinct pointer types `%T' and `%T' lacks a cast",
+ cp_pedwarn (ec_comparison_of_distinct_pointer_types_and_lacks_a_cast,
type0, type1);
if (result_type == NULL_TREE)
@@ -3584,12 +3584,12 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
result_type = type0;
- error ("ANSI C++ forbids comparison between pointer and integer");
+ cp_error (ec_forbids_comparison_between_pointer_and_integer);
}
else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
{
result_type = type1;
- error ("ANSI C++ forbids comparison between pointer and integer");
+ cp_error (ec_forbids_comparison_between_pointer_and_integer);
}
else if (TYPE_PTRMEMFUNC_P (type0) && TREE_CODE (op1) == INTEGER_CST
&& integer_zerop (op1))
@@ -3705,7 +3705,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
result_type = common_type (type0, type1);
else
{
- cp_pedwarn ("comparison of distinct pointer types `%T' and `%T' lacks a cast",
+ cp_pedwarn (ec_comparison_of_distinct_pointer_types_and_lacks_a_cast,
type0, type1);
result_type = ptr_type_node;
}
@@ -3726,7 +3726,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
result_type = common_type (type0, type1);
else
{
- cp_pedwarn ("comparison of distinct pointer types `%T' and `%T' lacks a cast",
+ cp_pedwarn (ec_comparison_of_distinct_pointer_types_and_lacks_a_cast,
type0, type1);
result_type = ptr_type_node;
}
@@ -3740,12 +3740,12 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
result_type = type0;
- pedwarn ("ANSI C++ forbids comparison between pointer and integer");
+ cp_pedwarn (ec_forbids_comparison_between_pointer_and_integer);
}
else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
{
result_type = type1;
- pedwarn ("ANSI C++ forbids comparison between pointer and integer");
+ cp_pedwarn (ec_forbids_comparison_between_pointer_and_integer);
}
break;
@@ -3909,7 +3909,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
&& TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0))
!= TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1)))
{
- cp_warning ("comparison between `%#T' and `%#T'",
+ cp_warning (ec_comparison_between_and,
TREE_TYPE (orig_op0), TREE_TYPE (orig_op1));
}
@@ -3946,7 +3946,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
signed_type (result_type)))))
/* OK */;
else
- warning ("comparison between signed and unsigned");
+ cp_warning (ec_comparison_between_signed_and_unsigned);
/* Warn if two unsigned values are being compared in a size
larger than their original size, and one (and only one) is the
@@ -3991,7 +3991,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
{
mask = (~ (HOST_WIDE_INT) 0) << bits;
if ((mask & constant) != mask)
- warning ("comparison of promoted ~unsigned with constant");
+ cp_warning (ec_comparison_of_promoted_unsigned_with_constant);
}
}
else if (unsignedp0 && unsignedp1
@@ -3999,7 +3999,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
< TYPE_PRECISION (result_type))
&& (TYPE_PRECISION (TREE_TYPE (primop1))
< TYPE_PRECISION (result_type)))
- warning ("comparison of promoted ~unsigned with unsigned");
+ cp_warning (ec_comparison_of_promoted_unsigned_with_unsigned);
}
}
}
@@ -4012,8 +4012,8 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
if (!result_type)
{
- cp_error ("invalid operands `%T' and `%T' to binary `%O'",
- TREE_TYPE (orig_op0), TREE_TYPE (orig_op1), error_code);
+ cp_error (ec_invalid_operands_and_to_binary,
+ TREE_TYPE (orig_op0), TREE_TYPE (orig_op1), err_code);
return error_mark_node;
}
@@ -4034,7 +4034,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
performed. Note that pointer-difference and pointer-addition
have already been handled above, and so we don't end up here in
that case. */
- cp_warning ("NULL used in arithmetic");
+ cp_warning (ec_used_in_arithmetic);
if (! converted)
{
@@ -4083,25 +4083,25 @@ pointer_int_sum (resultcode, ptrop, intop)
if (TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
if (pedantic || warn_pointer_arith)
- pedwarn ("ANSI C++ forbids using pointer of type `void *' in arithmetic");
+ cp_pedwarn (ec_forbids_using_pointer_of_type_void_in_arithmetic);
size_exp = integer_one_node;
}
else if (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE)
{
if (pedantic || warn_pointer_arith)
- pedwarn ("ANSI C++ forbids using pointer to a function in arithmetic");
+ cp_pedwarn (ec_forbids_using_pointer_to_a_function_in_arithmetic);
size_exp = integer_one_node;
}
else if (TREE_CODE (TREE_TYPE (result_type)) == METHOD_TYPE)
{
if (pedantic || warn_pointer_arith)
- pedwarn ("ANSI C++ forbids using pointer to a method in arithmetic");
+ cp_pedwarn (ec_forbids_using_pointer_to_a_method_in_arithmetic);
size_exp = integer_one_node;
}
else if (TREE_CODE (TREE_TYPE (result_type)) == OFFSET_TYPE)
{
if (pedantic || warn_pointer_arith)
- pedwarn ("ANSI C++ forbids using pointer to a member in arithmetic");
+ cp_pedwarn (ec_forbids_using_pointer_to_a_member_in_arithmetic);
size_exp = integer_one_node;
}
else
@@ -4175,13 +4175,13 @@ pointer_diff (op0, op1, ptrtype)
if (pedantic || warn_pointer_arith)
{
if (TREE_CODE (target_type) == VOID_TYPE)
- pedwarn ("ANSI C++ forbids using pointer of type `void *' in subtraction");
+ cp_pedwarn (ec_forbids_using_pointer_of_type_void_in_subtraction);
if (TREE_CODE (target_type) == FUNCTION_TYPE)
- pedwarn ("ANSI C++ forbids using pointer to a function in subtraction");
+ cp_pedwarn (ec_forbids_using_pointer_to_a_function_in_subtraction);
if (TREE_CODE (target_type) == METHOD_TYPE)
- pedwarn ("ANSI C++ forbids using pointer to a method in subtraction");
+ cp_pedwarn (ec_forbids_using_pointer_to_a_method_in_subtraction);
if (TREE_CODE (target_type) == OFFSET_TYPE)
- pedwarn ("ANSI C++ forbids using pointer to a member in subtraction");
+ cp_pedwarn (ec_forbids_using_pointer_to_a_member_in_subtraction);
}
/* First do the subtraction as integers;
@@ -4192,7 +4192,7 @@ pointer_diff (op0, op1, ptrtype)
/* This generates an error if op1 is a pointer to an incomplete type. */
if (TYPE_SIZE (TREE_TYPE (TREE_TYPE (op1))) == 0)
- error ("arithmetic on pointer to an incomplete type");
+ cp_error (ec_arithmetic_on_pointer_to_an_incomplete_type);
op1 = ((TREE_CODE (target_type) == VOID_TYPE
|| TREE_CODE (target_type) == FUNCTION_TYPE
@@ -4294,7 +4294,7 @@ build_x_unary_op (code, xarg)
if (code == ADDR_EXPR)
{
if (TREE_CODE (xarg) == TARGET_EXPR)
- warning ("taking address of temporary");
+ cp_warning (ec_taking_address_of_temporary);
}
return build_unary_op (code, xarg, 0);
@@ -4477,7 +4477,7 @@ build_unary_op (code, xarg, noconvert)
/* ARM $5.2.5 last annotation says this should be forbidden. */
if (TREE_CODE (argtype) == ENUMERAL_TYPE)
- pedwarn ("ANSI C++ forbids %sing an enum",
+ cp_pedwarn (ec_forbids_sing_an_enum,
(code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
? "increment" : "decrement");
@@ -4487,14 +4487,14 @@ build_unary_op (code, xarg, noconvert)
{
enum tree_code tmp = TREE_CODE (TREE_TYPE (argtype));
if (TYPE_SIZE (complete_type (TREE_TYPE (argtype))) == 0)
- cp_error ("cannot %s a pointer to incomplete type `%T'",
+ cp_error (ec_cannot_s_a_pointer_to_incomplete_type,
((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? "increment" : "decrement"), TREE_TYPE (argtype));
else if ((pedantic || warn_pointer_arith)
&& (tmp == FUNCTION_TYPE || tmp == METHOD_TYPE
|| tmp == VOID_TYPE || tmp == OFFSET_TYPE))
- cp_pedwarn ("ANSI C++ forbids %sing a pointer of type `%T'",
+ cp_pedwarn (ec_forbids_sing_a_pointer_of_type,
((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? "increment" : "decrement"), argtype);
@@ -4519,7 +4519,7 @@ build_unary_op (code, xarg, noconvert)
{
tree incremented, modify, value, compound;
if (! lvalue_p (arg) && pedantic)
- pedwarn ("cast to non-reference type used as lvalue");
+ cp_pedwarn (ec_cast_to_nonreference_type_used_as_lvalue);
arg = stabilize_reference (arg);
if (code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR)
value = arg;
@@ -4554,7 +4554,7 @@ build_unary_op (code, xarg, noconvert)
{
if (code == POSTDECREMENT_EXPR || code == PREDECREMENT_EXPR)
{
- cp_error ("invalid use of `--' on bool variable `%D'", arg);
+ cp_error (ec_invalid_use_of_on_bool_variable, arg);
return error_mark_node;
}
#if 0
@@ -4599,7 +4599,7 @@ build_unary_op (code, xarg, noconvert)
}
else if (pedantic && DECL_MAIN_P (arg))
/* ARM $3.4 */
- pedwarn ("taking address of function `main'");
+ cp_pedwarn (ec_taking_address_of_function_main);
/* Let &* cancel out to simplify resulting code. */
if (TREE_CODE (arg) == INDIRECT_REF)
@@ -4702,7 +4702,7 @@ build_unary_op (code, xarg, noconvert)
case FIX_ROUND_EXPR:
case FIX_CEIL_EXPR:
if (! lvalue_p (arg) && pedantic)
- pedwarn ("taking the address of a cast to non-reference type");
+ cp_pedwarn (ec_taking_the_address_of_a_cast_to_nonreference_type);
break;
default:
@@ -4859,7 +4859,7 @@ unary_complex_lvalue (code, arg)
if (TREE_CODE (t) == FUNCTION_DECL)
{
if (DECL_DESTRUCTOR_P (t))
- cp_error ("taking address of destructor");
+ cp_error (ec_taking_address_of_destructor);
return build_unary_op (ADDR_EXPR, t, 0);
}
if (TREE_CODE (t) == VAR_DECL)
@@ -4956,7 +4956,7 @@ mark_addressable (exp)
if (x == current_class_ptr)
{
if (! flag_this_is_variable)
- error ("address of `this' not available");
+ cp_error (ec_address_of_this_not_available);
TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
put_var_into_stack (x);
return 1;
@@ -4992,7 +4992,7 @@ mark_addressable (exp)
case RESULT_DECL:
if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
&& !DECL_ARTIFICIAL (x) && extra_warnings)
- cp_warning ("address requested for `%D', which is declared `register'",
+ cp_warning (ec_address_requested_for_which_is_declared_register,
x);
put_var_into_stack (x);
TREE_ADDRESSABLE (x) = 1;
@@ -5054,7 +5054,7 @@ build_conditional_expr (ifexp, op1, op2)
if (op1 == 0)
{
if (pedantic)
- pedwarn ("ANSI C++ forbids omitting the middle term of a ?: expression");
+ cp_pedwarn (ec_forbids_omitting_the_middle_term_of_a_expression);
ifexp = op1 = save_expr (ifexp);
}
@@ -5141,18 +5141,18 @@ build_conditional_expr (ifexp, op1, op2)
{
if (code2 == ENUMERAL_TYPE)
{
- cp_error ("enumeral mismatch in conditional expression: `%T' vs `%T'",
+ cp_error (ec_enumeral_mismatch_in_conditional_expression_vs,
type1, type2);
return error_mark_node;
}
else if (extra_warnings && ! IS_AGGR_TYPE_CODE (code2)
&& type2 != type_promotes_to (type1))
- warning ("enumeral and non-enumeral type in conditional expression");
+ cp_warning (ec_enumeral_and_nonenumeral_type_in_conditional_expression);
}
else if (extra_warnings
&& code2 == ENUMERAL_TYPE && ! IS_AGGR_TYPE_CODE (code1)
&& type1 != type_promotes_to (type2))
- warning ("enumeral and non-enumeral type in conditional expression");
+ cp_warning (ec_enumeral_and_nonenumeral_type_in_conditional_expression);
if (code1 != VOID_TYPE)
{
@@ -5203,7 +5203,7 @@ build_conditional_expr (ifexp, op1, op2)
else if (code1 == VOID_TYPE || code2 == VOID_TYPE)
{
if (pedantic && (code1 != VOID_TYPE || code2 != VOID_TYPE))
- pedwarn ("ANSI C++ forbids conditional expr with only one void side");
+ cp_pedwarn (ec_forbids_conditional_expr_with_only_one_void_side);
result_type = void_type_node;
}
else if (code1 == POINTER_TYPE && null_ptr_cst_p (op2))
@@ -5217,13 +5217,13 @@ build_conditional_expr (ifexp, op1, op2)
else if (TYPE_MAIN_VARIANT (TREE_TYPE (type1)) == void_type_node)
{
if (pedantic && TREE_CODE (type2) == FUNCTION_TYPE)
- pedwarn ("ANSI C++ forbids conditional expr between `void *' and function pointer");
+ cp_pedwarn (ec_forbids_conditional_expr_between_void_and_function_pointer);
result_type = qualify_type (type1, type2);
}
else if (TYPE_MAIN_VARIANT (TREE_TYPE (type2)) == void_type_node)
{
if (pedantic && TREE_CODE (type1) == FUNCTION_TYPE)
- pedwarn ("ANSI C++ forbids conditional expr between `void *' and function pointer");
+ cp_pedwarn (ec_forbids_conditional_expr_between_void_and_function_pointer);
result_type = qualify_type (type2, type1);
}
/* C++ */
@@ -5236,7 +5236,7 @@ build_conditional_expr (ifexp, op1, op2)
{
if (result_type == error_mark_node)
{
- cp_error ("common base type of types `%T' and `%T' is ambiguous",
+ cp_error (ec_common_base_type_of_types_and_is_ambiguous,
TREE_TYPE (type1), TREE_TYPE (type2));
result_type = ptr_type_node;
}
@@ -5245,7 +5245,7 @@ build_conditional_expr (ifexp, op1, op2)
if (pedantic
&& result_type != TREE_TYPE (type1)
&& result_type != TREE_TYPE (type2))
- cp_pedwarn ("`%T' and `%T' converted to `%T *' in conditional expression",
+ cp_pedwarn (ec_and_converted_to_in_conditional_expression,
type1, type2, result_type);
result_type = build_pointer_type (result_type);
@@ -5253,18 +5253,18 @@ build_conditional_expr (ifexp, op1, op2)
}
else
{
- pedwarn ("pointer type mismatch in conditional expression");
+ cp_pedwarn (ec_pointer_type_mismatch_in_conditional_expression);
result_type = ptr_type_node;
}
}
else if (code1 == POINTER_TYPE && code2 == INTEGER_TYPE)
{
- pedwarn ("pointer/integer type mismatch in conditional expression");
+ cp_pedwarn (ec_pointerinteger_type_mismatch_in_conditional_expression);
result_type = type1;
}
else if (code2 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
- pedwarn ("pointer/integer type mismatch in conditional expression");
+ cp_pedwarn (ec_pointerinteger_type_mismatch_in_conditional_expression);
result_type = type2;
}
@@ -5274,7 +5274,7 @@ build_conditional_expr (ifexp, op1, op2)
an aggregate value, try converting to a scalar type. */
if (code1 == RECORD_TYPE && code2 == RECORD_TYPE)
{
- cp_error ("aggregate mismatch in conditional expression: `%T' vs `%T'",
+ cp_error (ec_aggregate_mismatch_in_conditional_expression_vs,
type1, type2);
return error_mark_node;
}
@@ -5292,12 +5292,12 @@ build_conditional_expr (ifexp, op1, op2)
tmp = build_type_conversion (CONVERT_EXPR, tmp, op1, 0);
if (tmp == NULL_TREE)
{
- cp_error ("incompatible types `%T' and `%T' in `?:'",
+ cp_error (ec_incompatible_types_and_in,
type1, type2);
return error_mark_node;
}
if (tmp == error_mark_node)
- error ("ambiguous pointer conversion");
+ cp_error (ec_ambiguous_pointer_conversion);
else
STRIP_NOPS (tmp);
result_type = common_type (type2, TREE_TYPE (tmp));
@@ -5315,12 +5315,12 @@ build_conditional_expr (ifexp, op1, op2)
tmp = build_type_conversion (CONVERT_EXPR, tmp, op2, 0);
if (tmp == NULL_TREE)
{
- cp_error ("incompatible types `%T' and `%T' in `?:'",
+ cp_error (ec_incompatible_types_and_in,
type1, type2);
return error_mark_node;
}
if (tmp == error_mark_node)
- error ("ambiguous pointer conversion");
+ cp_error (ec_ambiguous_pointer_conversion);
else
STRIP_NOPS (tmp);
result_type = common_type (type1, TREE_TYPE (tmp));
@@ -5330,7 +5330,7 @@ build_conditional_expr (ifexp, op1, op2)
result_type = void_type_node;
else
{
- error ("type mismatch in conditional expression");
+ cp_error (ec_type_mismatch_in_conditional_expression);
return error_mark_node;
}
}
@@ -5383,7 +5383,7 @@ build_x_compound_expr (list)
if ((extra_warnings || warn_unused)
&& !(TREE_CODE (TREE_VALUE(list)) == CONVERT_EXPR
&& TREE_TYPE (TREE_VALUE(list)) == void_type_node))
- warning("left-hand operand of comma expression has no effect");
+ cp_warning (ec_lefthand_operand_of_comma_expression_has_no_effect);
}
#if 0 /* this requires a gcc backend patch to export warn_if_unused_value */
else if (warn_unused)
@@ -5523,7 +5523,7 @@ build_static_cast (type, expr)
if (ok)
return build_c_cast (type, expr);
- cp_error ("static_cast from `%T' to `%T'", intype, type);
+ cp_error (ec_static_cast_from_to, intype, type);
return error_mark_node;
}
@@ -5570,7 +5570,7 @@ build_reinterpret_cast (type, expr)
{
if (! real_lvalue_p (expr))
{
- cp_error ("reinterpret_cast from `%T' rvalue to `%T'", intype, type);
+ cp_error (ec_reinterpret_cast_from_rvalue_to, intype, type);
return error_mark_node;
}
expr = build_unary_op (ADDR_EXPR, expr, 0);
@@ -5590,7 +5590,7 @@ build_reinterpret_cast (type, expr)
else if (TREE_CODE (type) == INTEGER_TYPE && TYPE_PTR_P (intype))
{
if (TYPE_PRECISION (type) < TYPE_PRECISION (intype))
- cp_pedwarn ("reinterpret_cast from `%T' to `%T' loses precision",
+ cp_pedwarn (ec_reinterpret_cast_from_to_loses_precision,
intype, type);
}
else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype))
@@ -5604,7 +5604,7 @@ build_reinterpret_cast (type, expr)
|| (TYPE_PTROBV_P (type) && TYPE_PTROBV_P (intype)))
{
if (! comp_ptr_ttypes_reinterpret (TREE_TYPE (type), TREE_TYPE (intype)))
- cp_pedwarn ("reinterpret_cast from `%T' to `%T' casts away const (or volatile)",
+ cp_pedwarn (ec_reinterpret_cast_from_to_casts_away_const_or_volatile,
intype, type);
if (TREE_READONLY_DECL_P (expr))
@@ -5614,14 +5614,14 @@ build_reinterpret_cast (type, expr)
else if ((TYPE_PTRFN_P (type) && TYPE_PTROBV_P (intype))
|| (TYPE_PTRFN_P (type) && TYPE_PTROBV_P (intype)))
{
- pedwarn ("ANSI C++ forbids casting between pointers to functions and objects");
+ cp_pedwarn (ec_forbids_casting_between_pointers_to_functions_and_objects);
if (TREE_READONLY_DECL_P (expr))
expr = decl_constant_value (expr);
return fold (build1 (NOP_EXPR, type, expr));
}
else
{
- cp_error ("reinterpret_cast from `%T' to `%T'", intype, type);
+ cp_error (ec_reinterpret_cast_from_to, intype, type);
return error_mark_node;
}
@@ -5673,7 +5673,7 @@ build_const_cast (type, expr)
{
if (! real_lvalue_p (expr))
{
- cp_error ("const_cast from `%T' rvalue to `%T'", intype, type);
+ cp_error (ec_const_cast_from_rvalue_to, intype, type);
return error_mark_node;
}
@@ -5689,7 +5689,7 @@ build_const_cast (type, expr)
&& comp_ptr_ttypes_const (TREE_TYPE (type), TREE_TYPE (intype)))
return cp_convert (type, expr);
- cp_error ("const_cast from `%T' to `%T'", intype, type);
+ cp_error (ec_const_cast_from_to, intype, type);
return error_mark_node;
}
@@ -5727,12 +5727,12 @@ build_c_cast (type, expr)
if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
{
if (pedantic)
- pedwarn ("ANSI C++ forbids casting to an array type");
+ cp_pedwarn (ec_forbids_casting_to_an_array_type);
type = build_pointer_type (TREE_TYPE (type));
}
else
{
- error ("ANSI C++ forbids casting to an array type");
+ cp_error (ec_forbids_casting_to_an_array_type);
return error_mark_node;
}
}
@@ -5740,13 +5740,13 @@ build_c_cast (type, expr)
if (TREE_CODE (type) == FUNCTION_TYPE
|| TREE_CODE (type) == METHOD_TYPE)
{
- cp_error ("casting to function type `%T'", type);
+ cp_error (ec_casting_to_function_type, type);
return error_mark_node;
}
if (IS_SIGNATURE (type))
{
- error ("cast specifies signature type");
+ cp_error (ec_cast_specifies_signature_type);
return error_mark_node;
}
@@ -5815,10 +5815,10 @@ build_c_cast (type, expr)
softening them into pedwarns. */
if (TYPE_VOLATILE (TREE_TYPE (otype))
&& ! TYPE_VOLATILE (TREE_TYPE (type)))
- warning ("cast discards `volatile' from pointer target type");
+ cp_warning (ec_cast_discards_volatile_from_pointer_target_type);
if (TYPE_READONLY (TREE_TYPE (otype))
&& ! TYPE_READONLY (TREE_TYPE (type)))
- warning ("cast discards `const' from pointer target type");
+ cp_warning (ec_cast_discards_const_from_pointer_target_type);
}
/* Warn about possible alignment problems. */
@@ -5828,7 +5828,7 @@ build_c_cast (type, expr)
&& TREE_CODE (TREE_TYPE (otype)) != VOID_TYPE
&& TREE_CODE (TREE_TYPE (otype)) != FUNCTION_TYPE
&& TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (otype)))
- warning ("cast increases required alignment of target type");
+ cp_warning (ec_cast_increases_required_alignment_of_target_type);
#if 0
/* We should see about re-enabling these, they seem useful to
@@ -5836,7 +5836,7 @@ build_c_cast (type, expr)
if (TREE_CODE (type) == INTEGER_TYPE
&& TREE_CODE (otype) == POINTER_TYPE
&& TYPE_PRECISION (type) != TYPE_PRECISION (otype))
- warning ("cast from pointer to integer of different size");
+ cp_warning (ec_cast_from_pointer_to_integer_of_different_size);
if (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (otype) == INTEGER_TYPE
@@ -5844,7 +5844,7 @@ build_c_cast (type, expr)
/* Don't warn about converting 0 to pointer,
provided the 0 was explicit--not cast or made by folding. */
&& !(TREE_CODE (value) == INTEGER_CST && integer_zerop (value)))
- warning ("cast to pointer from integer of different size");
+ cp_warning (ec_cast_to_pointer_from_integer_of_different_size);
#endif
if (TREE_CODE (type) == REFERENCE_TYPE)
@@ -5983,7 +5983,7 @@ build_modify_expr (lhs, modifycode, rhs)
lhs = member;
else
{
- compiler_error ("invalid static class member");
+ cp_compiler_error (ec_invalid_static_class_member);
return error_mark_node;
}
}
@@ -6042,7 +6042,7 @@ build_modify_expr (lhs, modifycode, rhs)
newrhs = build_binary_op (modifycode, lhs, rhs, 1);
if (newrhs == error_mark_node)
{
- cp_error (" in evaluation of `%Q(%#T, %#T)'", modifycode,
+ cp_error (ec_in_evaluation_of, modifycode,
TREE_TYPE (lhs), TREE_TYPE (rhs));
return error_mark_node;
}
@@ -6076,7 +6076,7 @@ build_modify_expr (lhs, modifycode, rhs)
/* WP 5.4.1: The result is an lvalue if T is a reference type,
otherwise the result is an rvalue. */
if (! lvalue_p (lhs))
- pedwarn ("ANSI C++ forbids cast to non-reference type used as lvalue");
+ cp_pedwarn (ec_forbids_cast_to_nonreference_type_used_as_lvalue);
result = build_modify_expr (inner_lhs, NOP_EXPR,
cp_convert (TREE_TYPE (inner_lhs),
@@ -6143,7 +6143,7 @@ build_modify_expr (lhs, modifycode, rhs)
&& DECL_NAME (current_function_decl) != NULL_TREE
&& (DECL_NAME (current_function_decl)
!= constructor_name (current_class_type)))
- warning ("assignment to `this' not in constructor or destructor");
+ cp_warning (ec_assignment_to_this_not_in_constructor_or_destructor);
current_function_just_assigned_this = 1;
}
@@ -6197,14 +6197,14 @@ build_modify_expr (lhs, modifycode, rhs)
if (! comptypes (lhstype, TREE_TYPE (rhs), 0))
{
- cp_error ("incompatible types in assignment of `%T' to `%T'",
+ cp_error (ec_incompatible_types_in_assignment_of_to,
TREE_TYPE (rhs), lhstype);
return error_mark_node;
}
/* Allow array assignment in compiler-generated code. */
if (pedantic && ! DECL_ARTIFICIAL (current_function_decl))
- pedwarn ("ANSI C++ forbids assignment of arrays");
+ cp_pedwarn (ec_forbids_assignment_of_arrays);
/* Have to wrap this in RTL_EXPR for two cases:
in base or member initialization and if we
@@ -6241,7 +6241,7 @@ build_modify_expr (lhs, modifycode, rhs)
if (lhs == DECL_RESULT (current_function_decl))
{
if (DECL_INITIAL (lhs))
- warning ("return value from function receives multiple initializations");
+ cp_warning (ec_return_value_from_function_receives_multiple_initializations);
DECL_INITIAL (lhs) = newrhs;
}
}
@@ -6388,7 +6388,7 @@ get_delta_difference (from, to, force)
binfo = get_binfo (from, to, 1);
if (binfo == error_mark_node)
{
- error (" in pointer to member function conversion");
+ cp_error (ec_in_pointer_to_member_function_conversion);
return delta;
}
if (binfo == 0)
@@ -6396,7 +6396,7 @@ get_delta_difference (from, to, force)
if (!force)
{
error_not_base_type (from, to);
- error (" in pointer to member conversion");
+ cp_error (ec_in_pointer_to_member_conversion);
return delta;
}
binfo = get_binfo (to, from, 1);
@@ -6406,9 +6406,9 @@ get_delta_difference (from, to, force)
{
binfo = binfo_member (BINFO_TYPE (binfo),
CLASSTYPE_VBASECLASSES (from));
- cp_warning ("pointer to member cast to virtual base `%T'",
+ cp_warning (ec_pointer_to_member_cast_to_virtual_base,
BINFO_TYPE (binfo));
- warning (" will only work if you are very careful");
+ cp_warning (ec_will_only_work_if_you_are_very_careful);
}
delta = BINFO_OFFSET (binfo);
delta = cp_convert (ptrdiff_type_node, delta);
@@ -6422,12 +6422,12 @@ get_delta_difference (from, to, force)
{
if (force)
{
- cp_warning ("pointer to member cast from virtual base `%T'",
+ cp_warning (ec_pointer_to_member_cast_from_virtual_base,
BINFO_TYPE (binfo));
- warning (" will only work if you are very careful");
+ cp_warning (ec_will_only_work_if_you_are_very_careful);
}
else
- cp_error ("pointer to member conversion from virtual base `%T'",
+ cp_error (ec_pointer_to_member_conversion_from_virtual_base,
BINFO_TYPE (binfo));
}
@@ -6543,7 +6543,7 @@ build_ptrmemfunc (type, pfn, force)
pfn_type = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (pfn));
if (!force
&& comp_target_types (type, pfn_type, 1) != 1)
- cp_error ("conversion to `%T' from `%T'", type, pfn_type);
+ cp_error (ec_conversion_to_from, type, pfn_type);
ndelta = cp_convert (ptrdiff_type_node, build_component_ref (pfn, delta_identifier, NULL_TREE, 0));
ndelta2 = cp_convert (ptrdiff_type_node, DELTA2_FROM_PTRMEMFUNC (pfn));
@@ -6585,7 +6585,7 @@ build_ptrmemfunc (type, pfn, force)
if (!force
&& comp_target_types (type, TREE_TYPE (pfn), 0) != 1)
- cp_error ("conversion to `%T' from `%T'", type, TREE_TYPE (pfn));
+ cp_error (ec_conversion_to_from, type, TREE_TYPE (pfn));
/* Allow pointer to member conversions here. */
delta = get_delta_difference (TYPE_METHOD_BASETYPE (TREE_TYPE (TREE_TYPE (pfn))),
@@ -6594,7 +6594,7 @@ build_ptrmemfunc (type, pfn, force)
delta2 = build_binary_op (PLUS_EXPR, delta2, delta, 1);
if (TREE_CODE (TREE_OPERAND (pfn, 0)) != FUNCTION_DECL)
- warning ("assuming pointer to member function is non-virtual");
+ cp_warning (ec_assuming_pointer_to_member_function_is_nonvirtual);
if (TREE_CODE (TREE_OPERAND (pfn, 0)) == FUNCTION_DECL
&& DECL_VINDEX (TREE_OPERAND (pfn, 0)))
@@ -6655,7 +6655,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
/* Issue warnings about peculiar, but legal, uses of NULL. */
if (ARITHMETIC_TYPE_P (type) && rhs == null_node)
- cp_warning ("converting NULL to non-pointer type");
+ cp_warning (ec_converting_null_to_nonpointer_type);
if (coder == UNKNOWN_TYPE)
rhs = instantiate_type (type, rhs, 1);
@@ -6712,7 +6712,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (coder == VOID_TYPE)
{
- error ("void value not ignored as it ought to be");
+ cp_error (ec_void_value_not_ignored_as_it_ought_to_be);
return error_mark_node;
}
/* Arithmetic types all interconvert. */
@@ -6725,10 +6725,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (coder == REAL_TYPE && codel == INTEGER_TYPE)
{
if (fndecl)
- cp_warning ("`%T' used for argument %P of `%D'",
+ cp_warning (ec_used_for_argument_of,
rhstype, parmnum, fndecl);
else
- cp_warning ("%s to `%T' from `%T'", errtype, type, rhstype);
+ cp_warning (ec_s_to_from, errtype, type, rhstype);
}
/* And we should warn if assigning a negative value to
an unsigned variable. */
@@ -6738,10 +6738,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
&& TREE_NEGATED_INT (rhs))
{
if (fndecl)
- cp_warning ("negative value `%E' passed as argument %P of `%D'",
+ cp_warning (ec_negative_value_passed_as_argument_of,
rhs, parmnum, fndecl);
else
- cp_warning ("%s of negative value `%E' to `%T'",
+ cp_warning (ec_s_of_negative_value_to,
errtype, rhs, type);
}
overflow_warning (rhs);
@@ -6799,19 +6799,19 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (! TYPE_READONLY (ttl) && TYPE_READONLY (ttr))
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards const",
+ cp_pedwarn (ec_passing_as_argument_of_discards_const,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards const",
+ cp_pedwarn (ec_s_to_from_discards_const,
errtype, type, rhstype);
}
if (! TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards volatile",
+ cp_pedwarn (ec_passing_as_argument_of_discards_volatile,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards volatile",
+ cp_pedwarn (ec_s_to_from_discards_volatile,
errtype, type, rhstype);
}
}
@@ -6829,12 +6829,12 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (TYPE_MAIN_VARIANT (ttl) == void_type_node
&& TREE_CODE (ttr) == OFFSET_TYPE)
{
- cp_error ("no standard conversion from `%T' to `void *'", ttr);
+ cp_error (ec_no_standard_conversion_from_to_void, ttr);
return error_mark_node;
}
if (ctt < 0 && TYPE_MAIN_VARIANT (ttl) != TYPE_MAIN_VARIANT (ttr))
- cp_pedwarn ("converting `%T' to `%T' is a contravariance violation",
+ cp_pedwarn (ec_converting_to_is_a_contravariance_violation,
rhstype, type);
if (TYPE_MAIN_VARIANT (ttl) != void_type_node
@@ -6842,10 +6842,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
&& ! null_ptr_cst_p (rhs))
{
if (coder == RECORD_TYPE)
- cp_pedwarn ("implicit conversion of signature pointer to type `%T'",
+ cp_pedwarn (ec_implicit_conversion_of_signature_pointer_to_type,
type);
else
- pedwarn ("ANSI C++ forbids implicit conversion from `void *' in %s",
+ cp_pedwarn (ec_forbids_implicit_conversion_from_void_in_s,
errtype);
}
/* Const and volatile mean something different for function types,
@@ -6857,7 +6857,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
&& binfo_member (TYPE_OFFSET_BASETYPE (ttr),
CLASSTYPE_VBASECLASSES (TYPE_OFFSET_BASETYPE (ttl))))
{
- error ("%s between pointer to members converting across virtual baseclasses", errtype);
+ cp_error (ec_s_between_pointer_to_members_converting_across_virtual_baseclasses, errtype);
return error_mark_node;
}
else if (! TYPE_READONLY (ttl) && TYPE_READONLY (ttr))
@@ -6865,29 +6865,29 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (string_conv_p (type, rhs, 1))
/* converting from string constant to char *, OK. */;
else if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards const",
+ cp_pedwarn (ec_passing_as_argument_of_discards_const,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards const",
+ cp_pedwarn (ec_s_to_from_discards_const,
errtype, type, rhstype);
}
else if (! TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards volatile",
+ cp_pedwarn (ec_passing_as_argument_of_discards_volatile,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards volatile",
+ cp_pedwarn (ec_s_to_from_discards_volatile,
errtype, type, rhstype);
}
else if (TREE_CODE (ttl) == TREE_CODE (ttr)
&& ! comp_target_types (type, rhstype, 1))
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' changes signedness",
+ cp_pedwarn (ec_passing_as_argument_of_changes_signedness,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' changes signedness",
+ cp_pedwarn (ec_s_to_from_changes_signedness,
errtype, type, rhstype);
}
}
@@ -6930,46 +6930,46 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (add_quals)
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' adds cv-quals without intervening `const'",
+ cp_pedwarn (ec_passing_as_argument_of_adds_cvquals_without_intervening_const,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' adds cv-quals without intervening `const'",
+ cp_pedwarn (ec_s_to_from_adds_cvquals_without_intervening_const,
errtype, type, rhstype);
}
if (const_parity)
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards const",
+ cp_pedwarn (ec_passing_as_argument_of_discards_const,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards const",
+ cp_pedwarn (ec_s_to_from_discards_const,
errtype, type, rhstype);
}
if (volatile_parity)
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards volatile",
+ cp_pedwarn (ec_passing_as_argument_of_discards_volatile,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards volatile",
+ cp_pedwarn (ec_s_to_from_discards_volatile,
errtype, type, rhstype);
}
if (unsigned_parity > 0)
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' changes signed to unsigned",
+ cp_pedwarn (ec_passing_as_argument_of_changes_signed_to_unsigned,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' changes signed to unsigned",
+ cp_pedwarn (ec_s_to_from_changes_signed_to_unsigned,
errtype, type, rhstype);
}
else if (unsigned_parity < 0)
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' changes unsigned to signed",
+ cp_pedwarn (ec_passing_as_argument_of_changes_unsigned_to_signed,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' changes unsigned to signed",
+ cp_pedwarn (ec_s_to_from_changes_unsigned_to_signed,
errtype, type, rhstype);
}
@@ -6979,17 +6979,17 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
|| TREE_CODE (ttl) == METHOD_TYPE)
if (! comptypes (ttl, ttr, 0))
{
- warning ("conflicting function types in %s:", errtype);
- cp_warning ("\t`%T' != `%T'", type, rhstype);
+ cp_warning (ec_conflicting_function_types_in_s, errtype);
+ cp_warning (ec_t, type, rhstype);
}
}
else
{
if (fndecl)
- cp_error ("passing `%T' as argument %P of `%D'",
+ cp_error (ec_passing_as_argument_of,
rhstype, parmnum, fndecl);
else
- cp_error ("%s to `%T' from `%T'", errtype, type, rhstype);
+ cp_error (ec_s_to_from, errtype, type, rhstype);
return error_mark_node;
}
}
@@ -7002,10 +7002,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (! (TREE_CODE (rhs) == INTEGER_CST && integer_zerop (rhs)))
{
if (fndecl)
- cp_pedwarn ("passing `%T' to argument %P of `%D' lacks a cast",
+ cp_pedwarn (ec_passing_to_argument_of_lacks_a_cast,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' lacks a cast",
+ cp_pedwarn (ec_s_to_from_lacks_a_cast,
errtype, type, rhstype);
}
return cp_convert (type, rhs);
@@ -7018,10 +7018,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
|| IS_SIGNATURE_REFERENCE (rhstype)))))
{
if (fndecl)
- cp_pedwarn ("passing `%T' to argument %P of `%D' lacks a cast",
+ cp_pedwarn (ec_passing_to_argument_of_lacks_a_cast,
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' lacks a cast",
+ cp_pedwarn (ec_s_to_from_lacks_a_cast,
errtype, type, rhstype);
return cp_convert (type, rhs);
}
@@ -7048,10 +7048,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
: comp_target_types (ttl, ttr, 1));
if (ctt < 0)
- cp_pedwarn ("converting `%T' to `%T' is a contravariance violation",
+ cp_pedwarn (ec_converting_to_is_a_contravariance_violation,
ttr, ttl);
else if (ctt == 0)
- cp_error ("%s to `%T' from `%T'", errtype, ttl, ttr);
+ cp_error (ec_s_to_from, errtype, ttl, ttr);
/* compatible pointer to member functions. */
return build_ptrmemfunc (ttl, rhs, 0);
@@ -7080,7 +7080,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
&& TYPE_PTRMEMFUNC_P (TREE_TYPE (rhs)))
return cp_convert (type, rhs);
- cp_error ("%s to `%T' from `%T'", errtype, type, rhstype);
+ cp_error (ec_s_to_from, errtype, type, rhstype);
return error_mark_node;
}
@@ -7170,9 +7170,9 @@ convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
if (fndecl)
{
if (warningcount > savew)
- cp_warning_at ("in passing argument %P of `%+D'", parmnum, fndecl);
+ cp_warning_at (ec_in_passing_argument_of, parmnum, fndecl);
else if (errorcount > savee)
- cp_error_at ("in passing argument %P of `%+D'", parmnum, fndecl);
+ cp_error_at (ec_in_passing_argument_of, parmnum, fndecl);
}
return rhs;
}
@@ -7204,7 +7204,7 @@ convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
avoid duplicate warnings on code like `const int I = NULL;
f(I);'. */
if (ARITHMETIC_TYPE_P (type) && rhs == null_node)
- cp_warning ("converting NULL to non-pointer type");
+ cp_warning (ec_converting_null_to_nonpointer_type);
if (TREE_READONLY_DECL_P (rhs))
rhs = decl_constant_value (rhs);
@@ -7293,7 +7293,7 @@ c_expand_return (retval)
tree valtype = TREE_TYPE (result);
if (TREE_THIS_VOLATILE (current_function_decl))
- warning ("function declared `noreturn' has a `return' statement");
+ cp_warning (ec_function_declared_noreturn_has_a_return_statement);
if (retval == error_mark_node)
{
@@ -7310,7 +7310,7 @@ c_expand_return (retval)
if (dtor_label)
{
if (retval)
- error ("returning a value from a destructor");
+ cp_error (ec_returning_a_value_from_a_destructor);
/* Can't just return from a destructor. */
expand_goto (dtor_label);
@@ -7334,7 +7334,7 @@ c_expand_return (retval)
{
if (DECL_NAME (DECL_RESULT (current_function_decl)) == NULL_TREE)
{
- pedwarn ("`return' with no value, in function returning non-void");
+ cp_pedwarn (ec_return_with_no_value_in_function_returning_nonvoid);
/* Clear this, so finish_function won't say that we
reach the end of a non-void function (which we don't,
we gave a return!). */
@@ -7349,9 +7349,9 @@ c_expand_return (retval)
else if (DECL_CONSTRUCTOR_P (current_function_decl))
{
if (flag_this_is_variable)
- error ("return from a constructor: use `this = ...' instead");
+ cp_error (ec_return_from_a_constructor_use_this_instead);
else
- error ("returning a value from a constructor");
+ cp_error (ec_returning_a_value_from_a_constructor);
retval = current_class_ptr;
}
@@ -7359,13 +7359,13 @@ c_expand_return (retval)
if (warn_ecpp
&& DECL_NAME (current_function_decl) == ansi_opname[(int) MODIFY_EXPR]
&& retval != current_class_ref)
- cp_warning ("`operator=' should return a reference to `*this'");
+ cp_warning (ec_operator_should_return_a_reference_to_this);
if (valtype == NULL_TREE || TREE_CODE (valtype) == VOID_TYPE)
{
current_function_returns_null = 1;
if (TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
- pedwarn ("`return' with a value, in function returning void");
+ cp_pedwarn (ec_return_with_a_value_in_function_returning_void);
expand_return (retval);
return;
}
@@ -7383,7 +7383,7 @@ c_expand_return (retval)
/* It's already done for us. */;
else if (TREE_TYPE (retval) == void_type_node)
{
- pedwarn ("return of void value in function returning non-void");
+ cp_pedwarn (ec_return_of_void_value_in_function_returning_nonvoid);
expand_expr_stmt (retval);
retval = 0;
}
@@ -7440,19 +7440,19 @@ c_expand_return (retval)
{
/* Get the target. */
whats_returned = TREE_OPERAND (whats_returned, 0);
- warning ("returning reference to temporary");
+ cp_warning (ec_returning_reference_to_temporary);
}
}
if (TREE_CODE (whats_returned) == VAR_DECL && DECL_NAME (whats_returned))
{
if (TEMP_NAME_P (DECL_NAME (whats_returned)))
- warning ("reference to non-lvalue returned");
+ cp_warning (ec_reference_to_nonlvalue_returned);
else if (TREE_CODE (TREE_TYPE (whats_returned)) != REFERENCE_TYPE
&& ! TREE_STATIC (whats_returned)
&& IDENTIFIER_LOCAL_VALUE (DECL_NAME (whats_returned))
&& !TREE_PUBLIC (whats_returned))
- cp_warning_at ("reference to local variable `%D' returned", whats_returned);
+ cp_warning_at (ec_reference_to_local_variable_returned, whats_returned);
}
}
else if (TREE_CODE (retval) == ADDR_EXPR)
@@ -7464,7 +7464,7 @@ c_expand_return (retval)
&& IDENTIFIER_LOCAL_VALUE (DECL_NAME (whats_returned))
&& !TREE_STATIC (whats_returned)
&& !TREE_PUBLIC (whats_returned))
- cp_warning_at ("address of local variable `%D' returned", whats_returned);
+ cp_warning_at (ec_address_of_local_variable_returned, whats_returned);
}
}
@@ -7514,7 +7514,7 @@ c_expand_start_case (exp)
if (exp == NULL_TREE)
{
- error ("switch quantity not an integer");
+ cp_error (ec_switch_quantity_not_an_integer);
exp = error_mark_node;
}
type = TREE_TYPE (exp);
@@ -7522,7 +7522,7 @@ c_expand_start_case (exp)
if (code != INTEGER_TYPE && code != ENUMERAL_TYPE && code != ERROR_MARK)
{
- error ("switch quantity not an integer");
+ cp_error (ec_switch_quantity_not_an_integer);
exp = error_mark_node;
}
else
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 265b387..52f791e 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -51,7 +51,7 @@ error_not_base_type (basetype, type)
{
if (TREE_CODE (basetype) == FUNCTION_DECL)
basetype = DECL_CLASS_CONTEXT (basetype);
- cp_error ("type `%T' is not a base type for type `%T'", basetype, type);
+ cp_error (ec_type_is_not_a_base_type_for_type, basetype, type);
return error_mark_node;
}
@@ -83,7 +83,7 @@ readonly_error (arg, string, soft)
char *string;
int soft;
{
- char *fmt;
+ error_code ec;
void (*fn)();
if (soft)
@@ -94,32 +94,32 @@ readonly_error (arg, string, soft)
if (TREE_CODE (arg) == COMPONENT_REF)
{
if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
- fmt = "%s of member `%D' in read-only structure";
+ ec = ec_member_in_readonly_structure;
else
- fmt = "%s of read-only member `%D'";
- (*fn) (fmt, string, TREE_OPERAND (arg, 1));
+ ec = ec_readonly_member;
+ (*fn) (ec, string, TREE_OPERAND (arg, 1));
}
else if (TREE_CODE (arg) == VAR_DECL)
{
if (DECL_LANG_SPECIFIC (arg)
&& DECL_IN_AGGR_P (arg)
&& !TREE_STATIC (arg))
- fmt = "%s of constant field `%D'";
+ ec = ec_constant_field;
else
- fmt = "%s of read-only variable `%D'";
- (*fn) (fmt, string, arg);
+ ec = ec_readonly_variable;
+ (*fn) (ec, string, arg);
}
else if (TREE_CODE (arg) == PARM_DECL)
- (*fn) ("%s of read-only parameter `%D'", string, arg);
+ (*fn) (ec_readonly_parameter, string, arg);
else if (TREE_CODE (arg) == INDIRECT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (arg, 0))) == REFERENCE_TYPE
&& (TREE_CODE (TREE_OPERAND (arg, 0)) == VAR_DECL
|| TREE_CODE (TREE_OPERAND (arg, 0)) == PARM_DECL))
- (*fn) ("%s of read-only reference `%D'", string, TREE_OPERAND (arg, 0));
+ (*fn) (ec_readonly_reference, string, TREE_OPERAND (arg, 0));
else if (TREE_CODE (arg) == RESULT_DECL)
- (*fn) ("%s of read-only named return value `%D'", string, arg);
+ (*fn) (ec_readonly_named_return_val, string, arg);
else
- (*fn) ("%s of read-only location", string);
+ (*fn) (ec_readonly_location, string);
}
/* Print an error message for invalid use of a type which declares
@@ -161,22 +161,22 @@ abstract_virtuals_error (decl, type)
return;
if (TREE_CODE (decl) == VAR_DECL)
- cp_error ("cannot declare variable `%D' to be of type `%T'",
+ cp_error (ec_cannot_declare_variable_to_be_of_type,
decl, type);
else if (TREE_CODE (decl) == PARM_DECL)
- cp_error ("cannot declare parameter `%D' to be of type `%T'",
+ cp_error (ec_cannot_declare_parameter_to_be_of_type,
decl, type);
else if (TREE_CODE (decl) == FIELD_DECL)
- cp_error ("cannot declare field `%D' to be of type `%T'",
+ cp_error (ec_cannot_declare_field_to_be_of_type,
decl, type);
else if (TREE_CODE (decl) == FUNCTION_DECL
&& TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
- cp_error ("invalid return type for method `%#D'", decl);
+ cp_error (ec_invalid_return_type_for_method, decl);
else if (TREE_CODE (decl) == FUNCTION_DECL)
- cp_error ("invalid return type for function `%#D'", decl);
+ cp_error (ec_invalid_return_type_for_function, decl);
}
else
- cp_error ("cannot allocate an object of type `%T'", type);
+ cp_error (ec_cannot_allocate_an_object_of_type, type);
/* Only go through this once. */
if (TREE_PURPOSE (u) == NULL_TREE)
@@ -184,28 +184,28 @@ abstract_virtuals_error (decl, type)
TREE_PURPOSE (u) = error_mark_node;
if (has_abstract_virtuals)
- error (" since the following virtual functions are abstract:");
+ cp_error (ec_since_the_following_virtual_functions_are_abstract);
tu = u;
while (tu)
{
if (DECL_ABSTRACT_VIRTUAL_P (TREE_VALUE (tu))
&& ! DECL_NEEDS_FINAL_OVERRIDER_P (TREE_VALUE (tu)))
- cp_error ("\t%#D", TREE_VALUE (tu));
+ cp_error (ec_virtual, TREE_VALUE (tu));
tu = TREE_CHAIN (tu);
}
if (needs_final_overriders)
{
if (has_abstract_virtuals)
- error (" and the following virtual functions need a final overrider:");
+ cp_error (ec_and_the_following_virtual_functions_need_a_final_overrider);
else
- error (" since the following virtual functions need a final overrider:");
+ cp_error (ec_since_the_following_virtual_functions_need_a_final_overrider);
}
tu = u;
while (tu)
{
if (DECL_NEEDS_FINAL_OVERRIDER_P (TREE_VALUE (tu)))
- cp_error ("\t%#D", TREE_VALUE (tu));
+ cp_error (ec_virtual, TREE_VALUE (tu));
tu = TREE_CHAIN (tu);
}
}
@@ -214,12 +214,12 @@ abstract_virtuals_error (decl, type)
if (has_abstract_virtuals)
{
if (needs_final_overriders)
- cp_error (" since type `%T' has abstract virtual functions and must override virtual functions", type);
+ cp_error (ec_since_type_has_abstract_virtual_functions_and_must_override_virtual_functions, type);
else
- cp_error (" since type `%T' has abstract virtual functions", type);
+ cp_error (ec_since_type_has_abstract_virtual_functions, type);
}
else
- cp_error (" since type `%T' must override virtual functions", type);
+ cp_error (ec_since_type_must_override_virtual_functions, type);
}
}
@@ -238,22 +238,22 @@ signature_error (decl, type)
return;
if (TREE_CODE (decl) == VAR_DECL)
- cp_error ("cannot declare variable `%D' to be of signature type `%T'",
+ cp_error (ec_cannot_declare_variable_to_be_of_signature_type,
decl, type);
else if (TREE_CODE (decl) == PARM_DECL)
- cp_error ("cannot declare parameter `%D' to be of signature type `%T'",
+ cp_error (ec_cannot_declare_parameter_to_be_of_signature_type,
decl, type);
else if (TREE_CODE (decl) == FIELD_DECL)
- cp_error ("cannot declare field `%D' to be of signature type `%T'",
+ cp_error (ec_cannot_declare_field_to_be_of_signature_type,
decl, type);
else if (TREE_CODE (decl) == FUNCTION_DECL
&& TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
- cp_error ("invalid return type for method `%#D'", decl);
+ cp_error (ec_invalid_return_type_for_method, decl);
else if (TREE_CODE (decl) == FUNCTION_DECL)
- cp_error ("invalid return type for function `%#D'", decl);
+ cp_error (ec_invalid_return_type_for_function, decl);
}
else
- cp_error ("cannot allocate an object of signature type `%T'", type);
+ cp_error (ec_cannot_allocate_an_object_of_signature_type, type);
}
/* Print an error message for invalid use of an incomplete type.
@@ -265,15 +265,13 @@ incomplete_type_error (value, type)
tree value;
tree type;
{
- char *errmsg = 0;
-
/* Avoid duplicate error message. */
if (TREE_CODE (type) == ERROR_MARK)
return;
if (value != 0 && (TREE_CODE (value) == VAR_DECL
|| TREE_CODE (value) == PARM_DECL))
- cp_error ("`%D' has incomplete type", value);
+ cp_error (ec_has_incomplete_type, value);
else
{
retry:
@@ -284,11 +282,11 @@ incomplete_type_error (value, type)
case RECORD_TYPE:
case UNION_TYPE:
case ENUMERAL_TYPE:
- errmsg = "invalid use of undefined type `%#T'";
- break;
+ cp_error (ec_invalid_use_of_undefined_type, type);
+ return;
case VOID_TYPE:
- error ("invalid use of void expression");
+ cp_error (ec_invalid_use_of_void_expression);
return;
case ARRAY_TYPE:
@@ -297,22 +295,20 @@ incomplete_type_error (value, type)
type = TREE_TYPE (type);
goto retry;
}
- error ("invalid use of array with unspecified bounds");
+ cp_error (ec_invalid_use_of_array_with_unspecified_bounds);
return;
case OFFSET_TYPE:
- error ("invalid use of member type (did you forget the `&' ?)");
+ cp_error (ec_invalid_use_of_member_type_did_you_forget_the);
return;
case TEMPLATE_TYPE_PARM:
- error ("invalid use of template type parameter");
+ cp_error (ec_invalid_use_of_template_type_parameter);
return;
default:
my_friendly_abort (108);
}
-
- cp_error (errmsg, type);
}
}
@@ -386,16 +382,16 @@ my_friendly_abort (i)
ack ("Please submit a full bug report to `egcs-bugs@cygnus.com'.");
}
else
- error ("confused by earlier errors, bailing out");
+ cp_error (ec_confused_by_earlier_errors_bailing_out);
exit (34);
}
++abortcount;
if (i == 0)
- error ("Internal compiler error.");
+ cp_error (ec_nternal_compiler_error);
else
- error ("Internal compiler error %d.", i);
+ cp_error (ec_nternal_compiler_error_d, i);
fatal ("Please submit a full bug report to `egcs-bugs@cygnus.com'.");
}
@@ -596,13 +592,13 @@ store_init_value (decl, init)
if (TREE_CODE (init) == TREE_LIST
&& IS_SIGNATURE (type))
{
- cp_error ("constructor syntax cannot be used with signature type `%T'",
+ cp_error (ec_constructor_syntax_cannot_be_used_with_signature_type,
type);
init = error_mark_node;
}
else if (TREE_CODE (init) == TREE_LIST)
{
- cp_error ("constructor syntax used, but no constructor declared for type `%T'", type);
+ cp_error (ec_constructor_syntax_used_but_no_constructor_declared_for_type, type);
init = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (init));
}
#if 0
@@ -612,25 +608,25 @@ store_init_value (decl, init)
/* Check that we're really an aggregate as ARM 8.4.1 defines it. */
if (CLASSTYPE_N_BASECLASSES (type))
- cp_error_at ("initializer list construction invalid for derived class object `%D'", decl);
+ cp_error_at (ec_initializer_list_construction_invalid_for_derived_class_object, decl);
if (CLASSTYPE_VTBL_PTR (type))
- cp_error_at ("initializer list construction invalid for polymorphic class object `%D'", decl);
+ cp_error_at (ec_initializer_list_construction_invalid_for_polymorphic_class_object, decl);
if (TYPE_NEEDS_CONSTRUCTING (type))
{
- cp_error_at ("initializer list construction invalid for `%D'", decl);
- error ("due to the presence of a constructor");
+ cp_error_at (ec_initializer_list_construction_invalid_for, decl);
+ cp_error (ec_due_to_the_presence_of_a_constructor);
}
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
if (TREE_PRIVATE (field) || TREE_PROTECTED (field))
{
- cp_error_at ("initializer list construction invalid for `%D'", decl);
- cp_error_at ("due to non-public access of member `%D'", field);
+ cp_error_at (ec_initializer_list_construction_invalid_for, decl);
+ cp_error_at (ec_due_to_nonpublic_access_of_member, field);
}
for (field = TYPE_METHODS (type); field; field = TREE_CHAIN (field))
if (TREE_PRIVATE (field) || TREE_PROTECTED (field))
{
- cp_error_at ("initializer list construction invalid for `%D'", decl);
- cp_error_at ("due to non-public access of member `%D'", field);
+ cp_error_at (ec_initializer_list_construction_invalid_for, decl);
+ cp_error_at (ec_due_to_nonpublic_access_of_member, field);
}
}
#endif
@@ -642,7 +638,7 @@ store_init_value (decl, init)
{
if (TREE_CHAIN (init))
{
- warning ("comma expression used to initialize return value");
+ cp_warning (ec_comma_expression_used_to_initialize_return_value);
init = build_compound_expr (init);
}
else
@@ -658,7 +654,7 @@ store_init_value (decl, init)
else if (TREE_CODE (init) == TREE_LIST
&& TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
{
- error ("cannot initialize arrays using this syntax");
+ cp_error (ec_cannot_initialize_arrays_using_this_syntax);
return NULL_TREE;
}
else
@@ -667,7 +663,7 @@ store_init_value (decl, init)
if (TREE_CHAIN (init) != NULL_TREE)
{
- pedwarn ("initializer list being treated as compound expression");
+ cp_pedwarn (ec_initializer_list_being_treated_as_compound_expression);
init = build_compound_expr (init);
}
else
@@ -720,7 +716,7 @@ store_init_value (decl, init)
|| IS_SIGNATURE_REFERENCE (type))))
{
if (! TREE_CONSTANT (value) || ! TREE_STATIC (value))
- pedwarn ("ANSI C++ forbids non-constant aggregate initializer expressions");
+ cp_pedwarn (ec_forbids_nonconstant_aggregate_initializer_expressions);
}
}
#endif
@@ -788,7 +784,7 @@ digest_init (type, init, tail)
if (TREE_CODE (init) == TREE_LIST)
{
- error ("initializing array with parameter list");
+ cp_error (ec_initializing_array_with_parameter_list);
return error_mark_node;
}
@@ -807,14 +803,14 @@ digest_init (type, init, tail)
!= char_type_node)
&& TYPE_PRECISION (typ1) == BITS_PER_UNIT)
{
- error ("char-array initialized from wide string");
+ cp_error (ec_chararray_initialized_from_wide_string);
return error_mark_node;
}
if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (string)))
== char_type_node)
&& TYPE_PRECISION (typ1) != BITS_PER_UNIT)
{
- error ("int-array initialized from non-wide string");
+ cp_error (ec_intarray_initialized_from_nonwide_string);
return error_mark_node;
}
@@ -830,7 +826,7 @@ digest_init (type, init, tail)
counted in the length of the constant, but in C++ this would
be invalid. */
if (size < TREE_STRING_LENGTH (string))
- pedwarn ("initializer-string for array of chars is too long");
+ cp_pedwarn (ec_initializerstring_for_array_of_chars_is_too_long);
}
return string;
}
@@ -850,17 +846,17 @@ digest_init (type, init, tail)
{
if (element == 0)
{
- error ("initializer for scalar variable requires one element");
+ cp_error (ec_initializer_for_scalar_variable_requires_one_element);
return error_mark_node;
}
init = element;
}
while (TREE_CODE (init) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (init))
{
- cp_pedwarn ("braces around scalar initializer for `%T'", type);
+ cp_pedwarn (ec_braces_around_scalar_initializer_for, type);
init = CONSTRUCTOR_ELTS (init);
if (TREE_CHAIN (init))
- cp_pedwarn ("ignoring extra initializers for `%T'", type);
+ cp_pedwarn (ec_ignoring_extra_initializers_for, type);
init = TREE_VALUE (init);
}
@@ -872,7 +868,7 @@ digest_init (type, init, tail)
if (TYPE_SIZE (type) && ! TREE_CONSTANT (TYPE_SIZE (type)))
{
- cp_error ("variable-sized object of type `%T' may not be initialized",
+ cp_error (ec_variablesized_object_of_type_may_not_be_initialized,
type);
return error_mark_node;
}
@@ -881,7 +877,7 @@ digest_init (type, init, tail)
{
if (raw_constructor && TYPE_NON_AGGREGATE_CLASS (type))
{
- cp_error ("subobject of type `%T' must be initialized by constructor, not by `%E'",
+ cp_error (ec_subobject_of_type_must_be_initialized_by_constructor_not_by,
type, init);
return error_mark_node;
}
@@ -908,7 +904,7 @@ digest_init (type, init, tail)
}
}
- error ("invalid initializer");
+ cp_error (ec_invalid_initializer);
return error_mark_node;
}
@@ -946,7 +942,7 @@ process_init_constructor (type, init, elts)
if (elts)
{
if (warn_missing_braces)
- warning ("aggregate has a partly bracketed initializer");
+ cp_warning (ec_aggregate_has_a_partly_bracketed_initializer);
tail = *elts;
}
else
@@ -994,7 +990,7 @@ process_init_constructor (type, init, elts)
|| TREE_CODE (tail1) == TREE_LIST, 319);
if (tail == tail1 && len < 0)
{
- error ("non-empty initializer for array of empty elements");
+ cp_error (ec_nonempty_initializer_for_array_of_empty_elements);
/* Just ignore what we were supposed to use. */
tail1 = NULL_TREE;
}
@@ -1101,19 +1097,19 @@ process_init_constructor (type, init, elts)
members = expr_tree_cons (field, next1, members);
}
else if (TREE_READONLY (field))
- error ("uninitialized const member `%s'",
+ cp_error (ec_uninitialized_const_member_s,
IDENTIFIER_POINTER (DECL_NAME (field)));
else if (TYPE_LANG_SPECIFIC (TREE_TYPE (field))
&& CLASSTYPE_READONLY_FIELDS_NEED_INIT (TREE_TYPE (field)))
- error ("member `%s' with uninitialized const fields",
+ cp_error (ec_member_s_with_uninitialized_const_fields,
IDENTIFIER_POINTER (DECL_NAME (field)));
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE)
- error ("member `%s' is uninitialized reference",
+ cp_error (ec_member_s_is_uninitialized_reference,
IDENTIFIER_POINTER (DECL_NAME (field)));
/* Warn when some struct elements are implicitly initialized
to zero. */
else if (extra_warnings)
- warning ("missing initializer for member `%s'",
+ cp_warning (ec_missing_initializer_for_member_s,
IDENTIFIER_POINTER (DECL_NAME (field)));
}
}
@@ -1138,7 +1134,7 @@ process_init_constructor (type, init, elts)
/* Handle the case of a call by build_c_cast. */
field = TREE_PURPOSE (tail), win = 1;
else if (TREE_CODE (TREE_PURPOSE (tail)) != IDENTIFIER_NODE)
- error ("index value instead of field name in union initializer");
+ cp_error (ec_index_value_instead_of_field_name_in_union_initializer);
else
{
tree temp;
@@ -1150,7 +1146,7 @@ process_init_constructor (type, init, elts)
if (temp)
field = temp, win = 1;
else
- error ("no field `%s' in union being initialized",
+ cp_error (ec_no_field_s_in_union_being_initialized,
IDENTIFIER_POINTER (TREE_PURPOSE (tail)));
}
if (!win)
@@ -1158,7 +1154,7 @@ process_init_constructor (type, init, elts)
}
else if (field == 0)
{
- cp_error ("union `%T' with no named members cannot be initialized",
+ cp_error (ec_union_with_no_named_members_cannot_be_initialized,
type);
TREE_VALUE (tail) = error_mark_node;
}
@@ -1194,7 +1190,7 @@ process_init_constructor (type, init, elts)
/* If arguments were specified as a constructor,
complain unless we used all the elements of the constructor. */
else if (tail)
- pedwarn ("excess elements in aggregate initializer");
+ cp_pedwarn (ec_excess_elements_in_aggregate_initializer);
if (erroneous)
return error_mark_node;
@@ -1321,7 +1317,7 @@ build_x_arrow (datum)
if (value_member (TREE_TYPE (rval), types_memoized))
{
- error ("circular pointer delegation detected");
+ cp_error (ec_circular_pointer_delegation_detected);
return error_mark_node;
}
else
@@ -1334,7 +1330,7 @@ build_x_arrow (datum)
if (last_rval == NULL_TREE)
{
- cp_error ("base operand of `->' has non-pointer type `%T'", type);
+ cp_error (ec_base_operand_of_has_nonpointer_type, type);
return error_mark_node;
}
@@ -1353,9 +1349,9 @@ build_x_arrow (datum)
return build_indirect_ref (last_rval, NULL_PTR);
if (types_memoized)
- error ("result of `operator->()' yields non-pointer result");
+ cp_error (ec_result_of_operator_yields_nonpointer_result);
else
- error ("base operand of `->' is not a pointer");
+ cp_error (ec_base_operand_of_is_not_a_pointer);
return error_mark_node;
}
@@ -1400,7 +1396,7 @@ build_m_component_ref (datum, component)
if (TREE_CODE (type) != OFFSET_TYPE && TREE_CODE (type) != METHOD_TYPE)
{
- cp_error ("`%E' cannot be used as a member pointer, since it is of type `%T'", component, type);
+ cp_error (ec_cannot_be_used_as_a_member_pointer_since_it_is_of_type, component, type);
return error_mark_node;
}
@@ -1410,15 +1406,15 @@ build_m_component_ref (datum, component)
if (! IS_AGGR_TYPE (objtype))
{
- cp_error ("cannot apply member pointer `%E' to `%E'", component, datum);
- cp_error ("which is of non-aggregate type `%T'", objtype);
+ cp_error (ec_cannot_apply_member_pointer_to, component, datum);
+ cp_error (ec_which_is_of_nonaggregate_type, objtype);
return error_mark_node;
}
binfo = get_binfo (TYPE_METHOD_BASETYPE (type), objtype, 1);
if (binfo == NULL_TREE)
{
- cp_error ("member type `%T::' incompatible with object type `%T'",
+ cp_error (ec_member_type_incompatible_with_object_type,
TYPE_METHOD_BASETYPE (type), objtype);
return error_mark_node;
}
@@ -1455,7 +1451,7 @@ build_functional_cast (exp, parms)
type = lookup_name (exp, 1);
if (!type || TREE_CODE (type) != TYPE_DECL)
{
- cp_error ("`%T' fails to be a typedef or built-in type", exp);
+ cp_error (ec_fails_to_be_a_typedef_or_builtin_type, exp);
return error_mark_node;
}
type = TREE_TYPE (type);
@@ -1471,7 +1467,7 @@ build_functional_cast (exp, parms)
if (IS_SIGNATURE (type))
{
- error ("signature type not allowed in cast or constructor expression");
+ cp_error (ec_signature_type_not_allowed_in_cast_or_constructor_expression);
return error_mark_node;
}
@@ -1483,7 +1479,7 @@ build_functional_cast (exp, parms)
else
{
if (TREE_CHAIN (parms) != NULL_TREE)
- pedwarn ("initializer list being treated as compound expression");
+ cp_pedwarn (ec_initializer_list_being_treated_as_compound_expression);
parms = build_compound_expr (parms);
}
@@ -1499,7 +1495,7 @@ build_functional_cast (exp, parms)
if (TYPE_SIZE (complete_type (type)) == NULL_TREE)
{
- cp_error ("type `%T' is not yet defined", type);
+ cp_error (ec_type_is_not_yet_defined, type);
return error_mark_node;
}
@@ -1568,15 +1564,15 @@ report_case_error (code, type, new_value, old_value)
if (code == 1)
{
if (new_value)
- error ("case label not within a switch statement");
+ cp_error (ec_case_label_not_within_a_switch_statement);
else
- error ("default label not within a switch statement");
+ cp_error (ec_default_label_not_within_a_switch_statement);
}
else if (code == 2)
{
if (new_value == 0)
{
- error ("multiple default labels in one switch");
+ cp_error (ec_multiple_default_labels_in_one_switch);
return;
}
if (TREE_CODE (new_value) == RANGE_EXPR)
@@ -1630,29 +1626,29 @@ report_case_error (code, type, new_value, old_value)
else
{
if (TREE_CODE (type) == ENUMERAL_TYPE)
- error ("duplicate label `%s' in switch statement",
+ cp_error (ec_duplicate_label_s_in_switch_statement,
enum_name_string (new_value, type));
else
- error ("duplicate label (%d) in switch statement",
+ cp_error (ec_duplicate_label_d_in_switch_statement,
TREE_INT_CST_LOW (new_value));
}
}
else if (code == 3)
{
if (TREE_CODE (type) == ENUMERAL_TYPE)
- warning ("case value out of range for enum %s",
+ cp_warning (ec_case_value_out_of_range_for_enum_s,
TYPE_NAME_STRING (type));
else
- warning ("case value out of range");
+ cp_warning (ec_case_value_out_of_range);
}
else if (code == 4)
{
if (TREE_CODE (type) == ENUMERAL_TYPE)
- error ("range values `%s' and `%s' reversed",
+ cp_error (ec_range_values_s_and_s_reversed,
enum_name_string (new_value, type),
enum_name_string (old_value, type));
else
- error ("range values reversed");
+ cp_error (ec_range_values_reversed);
}
}
#endif
@@ -1663,5 +1659,5 @@ check_for_new_type (string, inptree)
flagged_type_tree inptree;
{
if (pedantic && inptree.new_type_flag)
- pedwarn ("ANSI C++ forbids defining types within %s",string);
+ cp_pedwarn (ec_forbids_defining_types_within_s,string);
}
diff --git a/gcc/cp/xref.c b/gcc/cp/xref.c
index 14915d6..dd4e5ae 100644
--- a/gcc/cp/xref.c
+++ b/gcc/cp/xref.c
@@ -832,7 +832,7 @@ open_xref_file(file)
if (xref_file == NULL)
{
- error("Can't create cross-reference file `%s'", xref_name);
+ cp_error (ec_ant_create_crossreference_file_s, xref_name);
doing_xref = 0;
}
}
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index 6751d87..970cbc9 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -108,7 +108,7 @@ in the following sections.
-fname-mangling-version-@var{n} -fno-default-inline
-fno-gnu-keywords -fnonnull-objects -fguiding-decls
-foperator-names -fno-optional-diags -fstrict-prototype -fthis-is-variable
--ftemplate-depth-@var{n} -nostdinc++ -traditional +e@var{n}
+-ftemplate-depth-@var{n} -fdiag-codes -nostdinc++ -traditional +e@var{n}
@end smallexample
@item Warning Options
@@ -129,7 +129,7 @@ in the following sections.
-Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes
-Wswitch -Wsynth -Wtemplate-debugging -Wtraditional
-Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings
--Wunknown-pragmas
+-Wunknown-pragmas -Wnumber-@var{n}
@end smallexample
@item Debugging Options
@@ -1165,6 +1165,19 @@ A limit on the template instantiation depth is needed to detect
endless recursions during template class instantiation. ANSI/ISO C++
conforming programs must not rely on a maximum depth greater than 17.
+@item -fdiag-codes
+When printing a diagnostic, also print the corresponding diagnostic
+code. The code is printed in square brackets, before the message
+itself. For example, you might see something like:
+
+@smallexample
+test.C:3: warning: [62] all member functions in class `C' are private
+@end smallexample
+
+which indicates that this is warning number 62. Some diagnostics do not
+(yet) have corresponding code numbers. This option is useful in
+conjuction with @samp{-Wnumber-@var{n}}.
+
@item -nostdinc++
Do not search for header files in the standard directories specific to
C++, but do still search the other standard directories. (This option
@@ -1189,6 +1202,7 @@ Do not assume @samp{inline} for functions defined inside a class scope.
@item -Wold-style-cast
@itemx -Woverloaded-virtual
@itemx -Wtemplate-debugging
+@itemx -Wnumber-@var{n}
Warnings that apply only to C++ programs. @xref{Warning
Options,,Options to Request or Suppress Warnings}.
@@ -1697,6 +1711,11 @@ conformant compiler code but disables the helpful warning.
Warn if a function can not be inlined, and either it was declared as inline,
or else the @samp{-finline-functions} option was given.
+@item -Wnumber-@var{n} (C++ only)
+Enable warning number @var{n}. (Or, more often, with
+@samp{-Wno-number-@var{n}}, disable that warning.) To obtain the
+appropriate numbers, use @samp{-fdiag-codes}.
+
@item -Wold-style-cast
Warn if an old-style (C-style) cast is used within a program.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn2.C b/gcc/testsuite/g++.old-deja/g++.other/warn2.C
new file mode 100644
index 0000000..a8dfb1c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn2.C
@@ -0,0 +1,6 @@
+// Build don't link:
+// Special g++ Options: -Wno-number-62
+
+class C {
+ C();
+};