cp-tree.h: Delete #defines for cp_error, cp_warning, cp_pedwarn, and cp_compiler_error.
* cp-tree.h: Delete #defines for cp_error, cp_warning, cp_pedwarn, and cp_compiler_error. * call.c, class.c, cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c, friend.c, init.c, lex.c, method.c, parse.y, pt.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c, typeck2.c: Change calls to the above macros to use their language-independent equivalents: error, warning, pedwarn, and internal_error respectively. From-SVN: r48140
This commit is contained in:
parent
86460bab02
commit
33bd39a26a
|
@ -1,3 +1,14 @@
|
|||
2001-12-17 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
* cp-tree.h: Delete #defines for cp_error, cp_warning,
|
||||
cp_pedwarn, and cp_compiler_error.
|
||||
* call.c, class.c, cp-tree.h, cvt.c, decl.c, decl2.c, error.c,
|
||||
except.c, friend.c, init.c, lex.c, method.c, parse.y, pt.c,
|
||||
rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
|
||||
typeck2.c: Change calls to the above macros to use their
|
||||
language-independent equivalents: error, warning, pedwarn, and
|
||||
internal_error respectively.
|
||||
|
||||
2001-12-16 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* decl2.c (finish_file): Remove back_end_hook.
|
||||
|
@ -50,7 +61,7 @@
|
|||
(ctor_label): Remove.
|
||||
* semantics.c (finish_return_stmt): Lose ctor_label support.
|
||||
* decl.c (finish_constructor_body, mark_lang_function): Likewise.
|
||||
* typeck.c (check_return_expr): Check DECL_DESTRUCTOR_P, not
|
||||
* typeck.c (check_return_expr): Check DECL_DESTRUCTOR_P, not
|
||||
dtor_label.
|
||||
|
||||
* call.c (build_new_method_call): Let resolves_to_fixed_type_p
|
||||
|
@ -125,8 +136,8 @@
|
|||
|
||||
2001-12-08 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* lex.c (rid_to_yy): Add RID_CHOOSE_EXPR and
|
||||
RID_TYPES_COMPATIBLE_P.
|
||||
* lex.c (rid_to_yy): Add RID_CHOOSE_EXPR and
|
||||
RID_TYPES_COMPATIBLE_P.
|
||||
|
||||
2001-12-08 John David Anglin <dave@hiauly1.hia.nrc.ca>
|
||||
|
||||
|
@ -225,7 +236,7 @@ Wed Dec 5 17:00:49 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
|||
|
||||
PR c++/3048
|
||||
* cp-tree.h (ovl_member): Remove.
|
||||
* decl2.c (merge_functions): Handle extern "C" functions
|
||||
* decl2.c (merge_functions): Handle extern "C" functions
|
||||
specially.
|
||||
* tree.c (ovl_member): Remove.
|
||||
|
||||
|
@ -303,7 +314,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
|||
|
||||
* cp/search.c (lookup_base_r): Declare bk in variable declaration
|
||||
space.
|
||||
|
||||
|
||||
2001-11-25 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR g++/3145
|
||||
|
@ -351,9 +362,9 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
|||
|
||||
* cp-tree.h (CP_TYPE_QUALS): Removed.
|
||||
* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree.
|
||||
* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
|
||||
* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
|
||||
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN.
|
||||
* dump.c (cp_dump_tree): Use void* dump_info argument to match
|
||||
* dump.c (cp_dump_tree): Use void* dump_info argument to match
|
||||
lang-hooks prototype.
|
||||
* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c,
|
||||
rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to
|
||||
|
@ -371,7 +382,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
|||
2001-11-20 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* call.c (non_reference): Add documentation.
|
||||
(convert_class_to_reference): Do not strip reference types
|
||||
(convert_class_to_reference): Do not strip reference types
|
||||
from conversion operators.
|
||||
(maybe_handle_ref_bind): Simplify.
|
||||
(compare_ics): Correct handling of references.
|
||||
|
@ -382,7 +393,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
|||
(cp_dump_tree): Dump CLASSTYPE_TEMPLATE_SPECIALIZATION. Use
|
||||
dump_op. Dump DECL_MUTABLE, access and staticness for VAR_DECLs.
|
||||
DECL_PURE_VIRTUAL_P, DECL_VIRTUAL_P,
|
||||
|
||||
|
||||
2001-11-19 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR4629
|
||||
|
@ -494,7 +505,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
|||
(struct lang_hooks): Constify.
|
||||
* lex.c (cxx_init_options): Update.
|
||||
(lang_identify): Remove.
|
||||
* parse.y (language_string): Remove.
|
||||
* parse.y (language_string): Remove.
|
||||
|
||||
2001-11-08 Andreas Franck <afranck@gmx.de>
|
||||
|
||||
|
|
116
gcc/cp/call.c
116
gcc/cp/call.c
|
@ -265,7 +265,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'",
|
||||
error ("qualified type `%T' does not match destructor name `~%T'",
|
||||
basetype, TREE_OPERAND (name, 0));
|
||||
|
||||
/* Destructors can be "called" for simple types; see 5.2.4 and 12.4 Note
|
||||
|
@ -274,7 +274,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')",
|
||||
error ("type of `%E' does not match destructor type `%T' (type was `%T')",
|
||||
exp, basetype, type);
|
||||
|
||||
return cp_convert (void_type_node, exp);
|
||||
|
@ -283,7 +283,7 @@ build_scoped_method_call (exp, basetype, name, parms)
|
|||
|
||||
if (TREE_CODE (basetype) == NAMESPACE_DECL)
|
||||
{
|
||||
cp_error ("`%D' is a namespace", basetype);
|
||||
error ("`%D' is a namespace", basetype);
|
||||
return error_mark_node;
|
||||
}
|
||||
if (! is_aggr_type (basetype, 1))
|
||||
|
@ -291,7 +291,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'",
|
||||
error ("base object `%E' of scoped method call is of non-aggregate type `%T'",
|
||||
exp, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ build_method_call (instance, name, parms, basetype_path, flags)
|
|||
basetype = TREE_TYPE (basetype);
|
||||
|
||||
if (! check_dtor_name (basetype, name))
|
||||
cp_error
|
||||
error
|
||||
("destructor name `~%T' does not match type `%T' of expression",
|
||||
TREE_OPERAND (name, 0), basetype);
|
||||
|
||||
|
@ -2335,20 +2335,20 @@ print_z_candidates (candidates)
|
|||
if (TREE_CODE (candidates->fn) == IDENTIFIER_NODE)
|
||||
{
|
||||
if (TREE_VEC_LENGTH (candidates->convs) == 3)
|
||||
cp_error ("%s %D(%T, %T, %T) <builtin>", str, candidates->fn,
|
||||
error ("%s %D(%T, %T, %T) <builtin>", 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,
|
||||
error ("%s %D(%T, %T) <builtin>", 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,
|
||||
error ("%s %D(%T) <builtin>", str, candidates->fn,
|
||||
TREE_TYPE (TREE_VEC_ELT (candidates->convs, 0)));
|
||||
}
|
||||
else if (TYPE_P (candidates->fn))
|
||||
cp_error ("%s %T <conversion>", str, candidates->fn);
|
||||
error ("%s %T <conversion>", str, candidates->fn);
|
||||
else
|
||||
cp_error_at ("%s %+#D%s", str, candidates->fn,
|
||||
candidates->viable == -1 ? " <near match>" : "");
|
||||
|
@ -2508,7 +2508,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");
|
||||
error ("no viable candidates");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2522,7 +2522,7 @@ build_user_type_conversion_1 (totype, expr, flags)
|
|||
{
|
||||
if (flags & LOOKUP_COMPLAIN)
|
||||
{
|
||||
cp_error ("conversion from `%T' to `%T' is ambiguous",
|
||||
error ("conversion from `%T' to `%T' is ambiguous",
|
||||
fromtype, totype);
|
||||
print_z_candidates (candidates);
|
||||
}
|
||||
|
@ -2639,7 +2639,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)'",
|
||||
error ("no matching function for call to `%D(%A)'",
|
||||
DECL_NAME (OVL_FUNCTION (fn)), args);
|
||||
if (candidates)
|
||||
print_z_candidates (candidates);
|
||||
|
@ -2650,7 +2650,7 @@ build_new_function_call (fn, args)
|
|||
|
||||
if (cand == 0)
|
||||
{
|
||||
cp_error ("call of overloaded `%D(%A)' is ambiguous",
|
||||
error ("call of overloaded `%D(%A)' is ambiguous",
|
||||
DECL_NAME (OVL_FUNCTION (fn)), args);
|
||||
print_z_candidates (candidates);
|
||||
return error_mark_node;
|
||||
|
@ -2677,7 +2677,7 @@ 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 without an object; consider using .* or ->*", obj);
|
||||
error ("pointer-to-member function %E cannot be called without an object; consider using .* or ->*", obj);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -2746,7 +2746,7 @@ build_object_call (obj, args)
|
|||
|
||||
if (! any_viable (candidates))
|
||||
{
|
||||
cp_error ("no match for call to `(%T) (%A)'", TREE_TYPE (obj), args);
|
||||
error ("no match for call to `(%T) (%A)'", TREE_TYPE (obj), args);
|
||||
print_z_candidates (candidates);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -2756,7 +2756,7 @@ build_object_call (obj, args)
|
|||
|
||||
if (cand == 0)
|
||||
{
|
||||
cp_error ("call of `(%T) (%A)' is ambiguous", TREE_TYPE (obj), args);
|
||||
error ("call of `(%T) (%A)' is ambiguous", TREE_TYPE (obj), args);
|
||||
print_z_candidates (candidates);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -2791,23 +2791,23 @@ op_error (code, code2, arg1, arg2, arg3, problem)
|
|||
switch (code)
|
||||
{
|
||||
case COND_EXPR:
|
||||
cp_error ("%s for `%T ? %T : %T' operator", problem,
|
||||
error ("%s for `%T ? %T : %T' operator", problem,
|
||||
error_type (arg1), error_type (arg2), error_type (arg3));
|
||||
break;
|
||||
case POSTINCREMENT_EXPR:
|
||||
case POSTDECREMENT_EXPR:
|
||||
cp_error ("%s for `%T %s' operator", problem, error_type (arg1), opname);
|
||||
error ("%s for `%T %s' operator", problem, error_type (arg1), opname);
|
||||
break;
|
||||
case ARRAY_REF:
|
||||
cp_error ("%s for `%T [%T]' operator", problem,
|
||||
error ("%s for `%T [%T]' operator", problem,
|
||||
error_type (arg1), error_type (arg2));
|
||||
break;
|
||||
default:
|
||||
if (arg2)
|
||||
cp_error ("%s for `%T %s %T' operator", problem,
|
||||
error ("%s for `%T %s %T' operator", problem,
|
||||
error_type (arg1), opname, error_type (arg2));
|
||||
else
|
||||
cp_error ("%s for `%s %T' operator", problem, opname, error_type (arg1));
|
||||
error ("%s for `%s %T' operator", problem, opname, error_type (arg1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2958,7 +2958,7 @@ build_conditional_expr (arg1, arg2, arg3)
|
|||
result_type = void_type_node;
|
||||
else
|
||||
{
|
||||
cp_error ("`%E' has type `void' and is not a throw-expression",
|
||||
error ("`%E' has type `void' and is not a throw-expression",
|
||||
VOID_TYPE_P (arg2_type) ? arg2 : arg3);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -2991,7 +2991,7 @@ build_conditional_expr (arg1, arg2, arg3)
|
|||
|| (conv2 && TREE_CODE (conv2) == AMBIG_CONV)
|
||||
|| (conv3 && TREE_CODE (conv3) == AMBIG_CONV))
|
||||
{
|
||||
cp_error ("operands to ?: have different types");
|
||||
error ("operands to ?: have different types");
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (conv2 && !ICS_BAD_FLAG (conv2))
|
||||
|
@ -3144,14 +3144,14 @@ build_conditional_expr (arg1, arg2, arg3)
|
|||
|
||||
if (TREE_CODE (arg2_type) == ENUMERAL_TYPE
|
||||
&& TREE_CODE (arg3_type) == ENUMERAL_TYPE)
|
||||
cp_warning ("enumeral mismatch in conditional expression: `%T' vs `%T'",
|
||||
warning ("enumeral mismatch in conditional expression: `%T' vs `%T'",
|
||||
arg2_type, arg3_type);
|
||||
else if (extra_warnings
|
||||
&& ((TREE_CODE (arg2_type) == ENUMERAL_TYPE
|
||||
&& !same_type_p (arg3_type, type_promotes_to (arg2_type)))
|
||||
|| (TREE_CODE (arg3_type) == ENUMERAL_TYPE
|
||||
&& !same_type_p (arg2_type, type_promotes_to (arg3_type)))))
|
||||
cp_warning ("enumeral and non-enumeral type in conditional expression");
|
||||
warning ("enumeral and non-enumeral type in conditional expression");
|
||||
|
||||
arg2 = perform_implicit_conversion (result_type, arg2);
|
||||
arg3 = perform_implicit_conversion (result_type, arg3);
|
||||
|
@ -3191,7 +3191,7 @@ build_conditional_expr (arg1, arg2, arg3)
|
|||
|
||||
if (!result_type)
|
||||
{
|
||||
cp_error ("operands to ?: have different types");
|
||||
error ("operands to ?: have different types");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -3232,7 +3232,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);
|
||||
error ("`%D' must be declared before use", arg1);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -3396,7 +3396,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",
|
||||
pedwarn ("no `%D(int)' declared for postfix `%s', trying prefix operator instead",
|
||||
fnname,
|
||||
operator_name_info[code].name);
|
||||
if (code == POSTINCREMENT_EXPR)
|
||||
|
@ -3443,7 +3443,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
|
|||
&& candidates->next
|
||||
&& ! candidates->next->next)
|
||||
{
|
||||
cp_warning ("using synthesized `%#D' for copy assignment",
|
||||
warning ("using synthesized `%#D' for copy assignment",
|
||||
cand->fn);
|
||||
cp_warning_at (" where cfront would use `%#D'",
|
||||
cand == candidates
|
||||
|
@ -3472,7 +3472,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'",
|
||||
warning ("comparison between `%#T' and `%#T'",
|
||||
TREE_TYPE (arg1), TREE_TYPE (arg2));
|
||||
}
|
||||
break;
|
||||
|
@ -3705,7 +3705,7 @@ build_op_delete_call (code, addr, size, flags, placement)
|
|||
if (placement)
|
||||
return NULL_TREE;
|
||||
|
||||
cp_error ("no suitable `operator delete' for `%T'", type);
|
||||
error ("no suitable `operator delete' for `%T'", type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -3729,7 +3729,7 @@ enforce_access (basetype_path, decl)
|
|||
cp_error_at ("`%+#D' is protected", decl);
|
||||
else
|
||||
cp_error_at ("`%+#D' is inaccessible", decl);
|
||||
cp_error ("within this context");
|
||||
error ("within this context");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3771,9 +3771,9 @@ convert_like_real (convs, expr, fn, argnum, inner)
|
|||
else if (TREE_CODE (t) == IDENTITY_CONV)
|
||||
break;
|
||||
}
|
||||
cp_pedwarn ("invalid conversion from `%T' to `%T'", TREE_TYPE (expr), totype);
|
||||
pedwarn ("invalid conversion from `%T' to `%T'", TREE_TYPE (expr), totype);
|
||||
if (fn)
|
||||
cp_pedwarn (" initializing argument %P of `%D'", argnum, fn);
|
||||
pedwarn (" initializing argument %P of `%D'", argnum, fn);
|
||||
return cp_convert (totype, expr);
|
||||
}
|
||||
|
||||
|
@ -3835,21 +3835,21 @@ convert_like_real (convs, expr, fn, argnum, inner)
|
|||
if (fn)
|
||||
{
|
||||
if (warningcount > savew)
|
||||
cp_warning
|
||||
warning
|
||||
(" initializing argument %P of `%D' from result of `%D'",
|
||||
argnum, fn, convfn);
|
||||
else if (errorcount > savee)
|
||||
cp_error
|
||||
error
|
||||
(" initializing argument %P of `%D' from result of `%D'",
|
||||
argnum, fn, convfn);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (warningcount > savew)
|
||||
cp_warning (" initializing temporary from result of `%D'",
|
||||
warning (" initializing temporary from result of `%D'",
|
||||
convfn);
|
||||
else if (errorcount > savee)
|
||||
cp_error (" initializing temporary from result of `%D'",
|
||||
error (" initializing temporary from result of `%D'",
|
||||
convfn);
|
||||
}
|
||||
expr = build_cplus_new (totype, expr);
|
||||
|
@ -3912,9 +3912,9 @@ convert_like_real (convs, expr, fn, argnum, inner)
|
|||
if (fn)
|
||||
{
|
||||
if (warningcount > savew)
|
||||
cp_warning (" initializing argument %P of `%D'", argnum, fn);
|
||||
warning (" initializing argument %P of `%D'", argnum, fn);
|
||||
else if (errorcount > savee)
|
||||
cp_error (" initializing argument %P of `%D'", argnum, fn);
|
||||
error (" initializing argument %P of `%D'", argnum, fn);
|
||||
}
|
||||
return build_cplus_new (totype, expr);
|
||||
|
||||
|
@ -3983,7 +3983,7 @@ convert_arg_to_ellipsis (arg)
|
|||
if (arg != error_mark_node && ! pod_type_p (TREE_TYPE (arg)))
|
||||
{
|
||||
/* Undefined behaviour [expr.call] 5.2.2/7. */
|
||||
cp_warning ("cannot pass objects of non-POD type `%#T' through `...'",
|
||||
warning ("cannot pass objects of non-POD type `%#T' through `...'",
|
||||
TREE_TYPE (arg));
|
||||
}
|
||||
|
||||
|
@ -4008,7 +4008,7 @@ build_x_va_arg (expr, type)
|
|||
if (! pod_type_p (type))
|
||||
{
|
||||
/* Undefined behaviour [expr.call] 5.2.2/7. */
|
||||
cp_warning ("cannot receive objects of non-POD type `%#T' through `...'",
|
||||
warning ("cannot receive objects of non-POD type `%#T' through `...'",
|
||||
type);
|
||||
}
|
||||
|
||||
|
@ -4150,7 +4150,7 @@ build_over_call (cand, args, flags)
|
|||
tree argtype = TREE_TYPE (TREE_VALUE (arg));
|
||||
tree t;
|
||||
if (ICS_BAD_FLAG (TREE_VEC_ELT (convs, i)))
|
||||
cp_pedwarn ("passing `%T' as `this' argument of `%#D' discards qualifiers",
|
||||
pedwarn ("passing `%T' as `this' argument of `%#D' discards qualifiers",
|
||||
TREE_TYPE (argtype), fn);
|
||||
|
||||
/* [class.mfct.nonstatic]: If a nonstatic member function of a class
|
||||
|
@ -4398,7 +4398,7 @@ build_java_interface_fn_ref (fn, instance)
|
|||
if (!iface_ref || TREE_CODE (iface_ref) != VAR_DECL
|
||||
|| DECL_CONTEXT (iface_ref) != iface)
|
||||
{
|
||||
cp_error ("could not find class$ field in java interface type `%T'",
|
||||
error ("could not find class$ field in java interface type `%T'",
|
||||
iface);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -4499,7 +4499,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
|
|||
if (! IS_AGGR_TYPE (basetype))
|
||||
{
|
||||
if ((flags & LOOKUP_COMPLAIN) && basetype != error_mark_node)
|
||||
cp_error ("request for member `%D' in `%E', which is of non-aggregate type `%T'",
|
||||
error ("request for member `%D' in `%E', which is of non-aggregate type `%T'",
|
||||
name, instance, basetype);
|
||||
|
||||
return error_mark_node;
|
||||
|
@ -4625,7 +4625,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
|
|||
if (!COMPLETE_TYPE_P (basetype))
|
||||
incomplete_type_error (instance_ptr, basetype);
|
||||
else
|
||||
cp_error ("no matching function for call to `%T::%D(%A)%V'",
|
||||
error ("no matching function for call to `%T::%D(%A)%V'",
|
||||
basetype, pretty_name, user_args,
|
||||
TREE_TYPE (TREE_TYPE (instance_ptr)));
|
||||
print_z_candidates (candidates);
|
||||
|
@ -4636,7 +4636,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,
|
||||
error ("call of overloaded `%D(%A)' is ambiguous", pretty_name,
|
||||
user_args);
|
||||
print_z_candidates (candidates);
|
||||
return error_mark_node;
|
||||
|
@ -4648,14 +4648,14 @@ build_new_method_call (instance, name, args, basetype_path, flags)
|
|||
|| DECL_DESTRUCTOR_P (current_function_decl))
|
||||
&& ! (flags & LOOKUP_NONVIRTUAL)
|
||||
&& value_member (cand->fn, CLASSTYPE_PURE_VIRTUALS (basetype)))
|
||||
cp_error ((DECL_CONSTRUCTOR_P (current_function_decl) ?
|
||||
error ((DECL_CONSTRUCTOR_P (current_function_decl) ?
|
||||
"abstract virtual `%#D' called from constructor"
|
||||
: "abstract virtual `%#D' called from destructor"),
|
||||
cand->fn);
|
||||
if (TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE
|
||||
&& is_dummy_object (instance_ptr))
|
||||
{
|
||||
cp_error ("cannot call member function `%D' without object", cand->fn);
|
||||
error ("cannot call member function `%D' without object", cand->fn);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -5268,9 +5268,9 @@ joust (cand1, cand2, warn)
|
|||
|
||||
if (warn)
|
||||
{
|
||||
cp_warning ("passing `%T' chooses `%T' over `%T'",
|
||||
warning ("passing `%T' chooses `%T' over `%T'",
|
||||
type, type1, type2);
|
||||
cp_warning (" in call to `%D'", w->fn);
|
||||
warning (" in call to `%D'", w->fn);
|
||||
}
|
||||
else
|
||||
add_warning (w, l);
|
||||
|
@ -5319,10 +5319,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'",
|
||||
warning ("choosing `%D' over `%D'", w->fn, l->fn);
|
||||
warning (" for conversion from `%T' to `%T'",
|
||||
source, TREE_TYPE (w->second_conv));
|
||||
cp_warning (" because conversion sequence for the argument is better");
|
||||
warning (" because conversion sequence for the argument is better");
|
||||
}
|
||||
else
|
||||
add_warning (w, l);
|
||||
|
@ -5444,8 +5444,8 @@ tweak:
|
|||
{
|
||||
if (warn)
|
||||
{
|
||||
cp_pedwarn ("choosing `%D' over `%D'", w->fn, l->fn);
|
||||
cp_pedwarn (
|
||||
pedwarn ("choosing `%D' over `%D'", w->fn, l->fn);
|
||||
pedwarn (
|
||||
" because worst conversion for the former is better than worst conversion for the latter");
|
||||
}
|
||||
else
|
||||
|
@ -5562,7 +5562,7 @@ perform_implicit_conversion (type, expr)
|
|||
LOOKUP_NORMAL);
|
||||
if (!conv)
|
||||
{
|
||||
cp_error ("could not convert `%E' to `%T'", expr, type);
|
||||
error ("could not convert `%E' to `%T'", expr, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -5583,7 +5583,7 @@ initialize_reference (type, expr)
|
|||
conv = reference_binding (type, TREE_TYPE (expr), expr, LOOKUP_NORMAL);
|
||||
if (!conv || ICS_BAD_FLAG (conv))
|
||||
{
|
||||
cp_error ("could not convert `%E' to `%T'", expr, type);
|
||||
error ("could not convert `%E' to `%T'", expr, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ build_base_path (code, expr, binfo, nonnull)
|
|||
|
||||
if (code == MINUS_EXPR && v_binfo)
|
||||
{
|
||||
cp_error ("cannot convert from base `%T' to derived type `%T' via virtual base `%T'",
|
||||
error ("cannot convert from base `%T' to derived type `%T' via virtual base `%T'",
|
||||
BINFO_TYPE (binfo), BINFO_TYPE (t), BINFO_TYPE (v_binfo));
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -991,7 +991,7 @@ add_method (type, method, error_p)
|
|||
/* Defer to the local function. */
|
||||
return;
|
||||
else
|
||||
cp_error ("`%#D' and `%#D' cannot be overloaded",
|
||||
error ("`%#D' and `%#D' cannot be overloaded",
|
||||
fn, method);
|
||||
}
|
||||
}
|
||||
|
@ -1323,7 +1323,7 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
|
|||
dtor is handled in finish_struct_1. */
|
||||
if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype)
|
||||
&& TYPE_HAS_DESTRUCTOR (basetype))
|
||||
cp_warning ("base class `%#T' has a non-virtual destructor",
|
||||
warning ("base class `%#T' has a non-virtual destructor",
|
||||
basetype);
|
||||
|
||||
/* If the base class doesn't have copy constructors or
|
||||
|
@ -1343,7 +1343,7 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
|
|||
{
|
||||
*cant_have_default_ctor_p = 1;
|
||||
if (! TYPE_HAS_CONSTRUCTOR (t))
|
||||
cp_pedwarn ("base `%T' with only non-default constructor in class without a constructor",
|
||||
pedwarn ("base `%T' with only non-default constructor in class without a constructor",
|
||||
basetype);
|
||||
}
|
||||
|
||||
|
@ -1929,7 +1929,7 @@ maybe_warn_about_overly_private_class (t)
|
|||
}
|
||||
if (!has_nonprivate_method)
|
||||
{
|
||||
cp_warning ("all member functions in class `%T' are private", t);
|
||||
warning ("all member functions in class `%T' are private", t);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1943,7 +1943,7 @@ maybe_warn_about_overly_private_class (t)
|
|||
|
||||
if (TREE_PRIVATE (dtor))
|
||||
{
|
||||
cp_warning ("`%#T' only defines a private destructor and has no friends",
|
||||
warning ("`%#T' only defines a private destructor and has no friends",
|
||||
t);
|
||||
return;
|
||||
}
|
||||
|
@ -1986,7 +1986,7 @@ maybe_warn_about_overly_private_class (t)
|
|||
|
||||
if (nonprivate_ctor == 0)
|
||||
{
|
||||
cp_warning ("`%#T' only defines private constructors and has no friends",
|
||||
warning ("`%#T' only defines private constructors and has no friends",
|
||||
t);
|
||||
return;
|
||||
}
|
||||
|
@ -2107,7 +2107,7 @@ void
|
|||
duplicate_tag_error (t)
|
||||
tree t;
|
||||
{
|
||||
cp_error ("redefinition of `%#T'", t);
|
||||
error ("redefinition of `%#T'", t);
|
||||
cp_error_at ("previous definition of `%#T'", t);
|
||||
|
||||
/* Pretend we haven't defined this type. */
|
||||
|
@ -2438,7 +2438,7 @@ find_final_overrider (t, binfo, fn)
|
|||
/* If there was no winner, issue an error message. */
|
||||
if (!ffod.overriding_fn)
|
||||
{
|
||||
cp_error ("no unique final overrider for `%D' in `%T'", fn, t);
|
||||
error ("no unique final overrider for `%D' in `%T'", fn, t);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -3426,16 +3426,16 @@ check_field_decls (t, access_decls, empty_p,
|
|||
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);
|
||||
warning ("`%#T' has pointer data members", t);
|
||||
|
||||
if (! TYPE_HAS_INIT_REF (t))
|
||||
{
|
||||
cp_warning (" but does not override `%T(const %T&)'", t, t);
|
||||
warning (" but does not override `%T(const %T&)'", t, t);
|
||||
if (! TYPE_HAS_ASSIGN_REF (t))
|
||||
cp_warning (" or `operator=(const %T&)'", t);
|
||||
warning (" or `operator=(const %T&)'", t);
|
||||
}
|
||||
else if (! TYPE_HAS_ASSIGN_REF (t))
|
||||
cp_warning (" but does not override `operator=(const %T&)'", t);
|
||||
warning (" but does not override `operator=(const %T&)'", t);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4687,7 +4687,7 @@ layout_virtual_bases (t, offsets)
|
|||
tree basetype = BINFO_TYPE (TREE_VALUE (vbases));
|
||||
|
||||
if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL))
|
||||
cp_warning ("virtual base `%T' inaccessible in `%T' due to ambiguity",
|
||||
warning ("virtual base `%T' inaccessible in `%T' due to ambiguity",
|
||||
basetype, t);
|
||||
}
|
||||
}
|
||||
|
@ -4757,7 +4757,7 @@ warn_about_ambiguous_direct_bases (t)
|
|||
tree basetype = TYPE_BINFO_BASETYPE (t, i);
|
||||
|
||||
if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL))
|
||||
cp_warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
|
||||
warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
|
||||
basetype, t);
|
||||
}
|
||||
}
|
||||
|
@ -5011,7 +5011,7 @@ finish_struct_1 (t)
|
|||
if (COMPLETE_TYPE_P (t))
|
||||
{
|
||||
if (IS_AGGR_TYPE (t))
|
||||
cp_error ("redefinition of `%#T'", t);
|
||||
error ("redefinition of `%#T'", t);
|
||||
else
|
||||
my_friendly_abort (172);
|
||||
popclass ();
|
||||
|
@ -5174,7 +5174,7 @@ finish_struct_1 (t)
|
|||
|
||||
if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && TYPE_HAS_DESTRUCTOR (t)
|
||||
&& DECL_VINDEX (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1)) == NULL_TREE)
|
||||
cp_warning ("`%#T' has virtual functions but non-virtual destructor", t);
|
||||
warning ("`%#T' has virtual functions but non-virtual destructor", t);
|
||||
|
||||
hack_incomplete_structures (t);
|
||||
|
||||
|
@ -5811,7 +5811,7 @@ resolve_address_of_overloaded_function (target_type,
|
|||
else
|
||||
{
|
||||
if (complain)
|
||||
cp_error ("\
|
||||
error ("\
|
||||
cannot resolve overloaded function `%D' based on conversion to type `%T'",
|
||||
DECL_NAME (OVL_FUNCTION (overload)), target_type);
|
||||
return error_mark_node;
|
||||
|
@ -5932,7 +5932,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
|
|||
/* There were *no* matches. */
|
||||
if (complain)
|
||||
{
|
||||
cp_error ("no matches converting function `%D' to type `%#T'",
|
||||
error ("no matches converting function `%D' to type `%#T'",
|
||||
DECL_NAME (OVL_FUNCTION (overload)),
|
||||
target_type);
|
||||
|
||||
|
@ -5955,7 +5955,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
|
|||
{
|
||||
tree match;
|
||||
|
||||
cp_error ("converting overloaded function `%D' to type `%#T' is ambiguous",
|
||||
error ("converting overloaded function `%D' to type `%#T' is ambiguous",
|
||||
DECL_NAME (OVL_FUNCTION (overload)),
|
||||
target_type);
|
||||
|
||||
|
@ -5981,10 +5981,10 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
|
|||
if (!complain)
|
||||
return error_mark_node;
|
||||
|
||||
cp_pedwarn ("assuming pointer to member `%D'", fn);
|
||||
pedwarn ("assuming pointer to member `%D'", fn);
|
||||
if (!explained)
|
||||
{
|
||||
cp_pedwarn ("(a pointer to member can only be formed with `&%E')", fn);
|
||||
pedwarn ("(a pointer to member can only be formed with `&%E')", fn);
|
||||
explained = 1;
|
||||
}
|
||||
}
|
||||
|
@ -6037,7 +6037,7 @@ instantiate_type (lhstype, rhs, flags)
|
|||
if (comptypes (lhstype, TREE_TYPE (rhs), strict))
|
||||
return rhs;
|
||||
if (complain)
|
||||
cp_error ("argument of type `%T' does not match `%T'",
|
||||
error ("argument of type `%T' does not match `%T'",
|
||||
TREE_TYPE (rhs), lhstype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -6431,7 +6431,7 @@ note_name_declared_in_class (name, decl)
|
|||
A name N used in a class S shall refer to the same declaration
|
||||
in its context and when re-evaluated in the completed scope of
|
||||
S. */
|
||||
cp_error ("declaration of `%#D'", decl);
|
||||
error ("declaration of `%#D'", decl);
|
||||
cp_error_at ("changes meaning of `%D' from `%+#D'",
|
||||
DECL_NAME (OVL_CURRENT (decl)),
|
||||
(tree) n->value);
|
||||
|
|
|
@ -3780,14 +3780,6 @@ extern tree set_guard PARAMS ((tree));
|
|||
/* in parse.y */
|
||||
extern void cp_parse_init PARAMS ((void));
|
||||
|
||||
/* Obsolete names, formerly found in errfn.c, which no longer exists.
|
||||
These are all variadic functions and therefore cannot be defined
|
||||
as function-like macros. */
|
||||
#define cp_error error
|
||||
#define cp_warning warning
|
||||
#define cp_pedwarn pedwarn
|
||||
#define cp_compiler_error internal_error
|
||||
|
||||
extern void cp_error_at PARAMS ((const char *msgid, ...));
|
||||
extern void cp_warning_at PARAMS ((const char *msgid, ...));
|
||||
extern void cp_pedwarn_at PARAMS ((const char *msgid, ...));
|
||||
|
@ -3795,8 +3787,8 @@ extern void cp_pedwarn_at PARAMS ((const char *msgid, ...));
|
|||
/* XXX Not i18n clean. */
|
||||
#define cp_deprecated(str) \
|
||||
do { if (warn_deprecated) \
|
||||
cp_warning("%s is deprecated, please see the documentation for details", \
|
||||
str); \
|
||||
warning("%s is deprecated, please see the documentation for details", \
|
||||
str); \
|
||||
} while (0)
|
||||
|
||||
/* in error.c */
|
||||
|
|
50
gcc/cp/cvt.c
50
gcc/cp/cvt.c
|
@ -85,7 +85,7 @@ cp_convert_to_pointer (type, expr, force)
|
|||
intype = complete_type (intype);
|
||||
if (!COMPLETE_TYPE_P (intype))
|
||||
{
|
||||
cp_error ("can't convert from incomplete type `%T' to `%T'",
|
||||
error ("can't convert from incomplete type `%T' to `%T'",
|
||||
intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ cp_convert_to_pointer (type, expr, force)
|
|||
if (rval)
|
||||
{
|
||||
if (rval == error_mark_node)
|
||||
cp_error ("conversion of `%E' from `%T' to `%T' is ambiguous",
|
||||
error ("conversion of `%E' from `%T' to `%T' is ambiguous",
|
||||
expr, intype, type);
|
||||
return rval;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ cp_convert_to_pointer (type, expr, force)
|
|||
{
|
||||
if (TREE_CODE (TREE_TYPE (TREE_TYPE (expr))) == METHOD_TYPE)
|
||||
if (pedantic || warn_pmf2ptr)
|
||||
cp_pedwarn ("converting from `%T' to `%T'", TREE_TYPE (expr),
|
||||
pedwarn ("converting from `%T' to `%T'", TREE_TYPE (expr),
|
||||
type);
|
||||
return build1 (NOP_EXPR, type, expr);
|
||||
}
|
||||
|
@ -195,11 +195,11 @@ cp_convert_to_pointer (type, expr, force)
|
|||
if (bk == bk_via_virtual)
|
||||
{
|
||||
if (force)
|
||||
cp_warning ("pointer to member cast from `%T' to `%T' is via virtual base",
|
||||
warning ("pointer to member cast from `%T' to `%T' is via virtual base",
|
||||
TREE_TYPE (intype), TREE_TYPE (type));
|
||||
else
|
||||
{
|
||||
cp_error ("pointer to member cast from `%T' to `%T' is via virtual base",
|
||||
error ("pointer to member cast from `%T' to `%T' is via virtual base",
|
||||
TREE_TYPE (intype), TREE_TYPE (type));
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ cp_convert_to_pointer (type, expr, force)
|
|||
}
|
||||
else if (TYPE_PTRMEMFUNC_P (type))
|
||||
{
|
||||
cp_error ("cannot convert `%E' from type `%T' to type `%T'",
|
||||
error ("cannot convert `%E' from type `%T' to type `%T'",
|
||||
expr, intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ cp_convert_to_pointer (type, expr, force)
|
|||
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0);
|
||||
else if (TYPE_PTRMEMFUNC_P (intype))
|
||||
{
|
||||
cp_error ("cannot convert `%E' from type `%T' to type `%T'",
|
||||
error ("cannot convert `%E' from type `%T' to type `%T'",
|
||||
expr, intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ cp_convert_to_pointer (type, expr, force)
|
|||
if (type_unknown_p (expr))
|
||||
return instantiate_type (type, expr, itf_complain);
|
||||
|
||||
cp_error ("cannot convert `%E' from type `%T' to type `%T'",
|
||||
error ("cannot convert `%E' from type `%T' to type `%T'",
|
||||
expr, intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -451,7 +451,7 @@ warn_ref_binding (reftype, intype, decl)
|
|||
else
|
||||
msg = "conversion to non-const reference type `%#T' from rvalue of type `%T'";
|
||||
|
||||
cp_pedwarn (msg, reftype, intype);
|
||||
pedwarn (msg, reftype, intype);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
|
|||
|
||||
if (! (convtype & CONV_CONST)
|
||||
&& !at_least_as_qualified_p (ttl, ttr))
|
||||
cp_pedwarn ("conversion from `%T' to `%T' discards qualifiers",
|
||||
pedwarn ("conversion from `%T' to `%T' discards qualifiers",
|
||||
ttr, reftype);
|
||||
}
|
||||
|
||||
|
@ -541,7 +541,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
|
|||
if (TREE_CODE (intype) == POINTER_TYPE
|
||||
&& (comptypes (TREE_TYPE (intype), type,
|
||||
COMPARE_BASE | COMPARE_RELAXED )))
|
||||
cp_warning ("casting `%T' to `%T' does not dereference pointer",
|
||||
warning ("casting `%T' to `%T' does not dereference pointer",
|
||||
intype, reftype);
|
||||
|
||||
rval = build_unary_op (ADDR_EXPR, expr, 0);
|
||||
|
@ -570,7 +570,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);
|
||||
error ("cannot convert type `%T' to type `%T'", intype, reftype);
|
||||
|
||||
if (flags & LOOKUP_SPECULATIVELY)
|
||||
return NULL_TREE;
|
||||
|
@ -687,7 +687,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);
|
||||
pedwarn ("conversion from `%#T' to `%#T'", intype, type);
|
||||
|
||||
if (flag_pedantic_errors)
|
||||
return error_mark_node;
|
||||
|
@ -699,7 +699,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);
|
||||
error ("`%#T' used where a `%T' was expected", intype, type);
|
||||
if (flags & LOOKUP_SPECULATIVELY)
|
||||
return NULL_TREE;
|
||||
return error_mark_node;
|
||||
|
@ -716,7 +716,7 @@ ocp_convert (type, expr, convtype, flags)
|
|||
&& TREE_CODE (TREE_OPERAND (expr, 0)) == FUNCTION_DECL)
|
||||
fn = TREE_OPERAND (expr, 0);
|
||||
if (fn && !DECL_WEAK (fn))
|
||||
cp_warning ("the address of `%D', will always be `true'", fn);
|
||||
warning ("the address of `%D', will always be `true'", fn);
|
||||
return cp_truthvalue_conversion (e);
|
||||
}
|
||||
return fold (convert_to_integer (type, e));
|
||||
|
@ -736,7 +736,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",
|
||||
error ("`%#T' used where a floating point value was expected",
|
||||
TREE_TYPE (e));
|
||||
}
|
||||
if (code == REAL_TYPE)
|
||||
|
@ -791,7 +791,7 @@ ocp_convert (type, expr, convtype, flags)
|
|||
return e;
|
||||
|
||||
if (flags & LOOKUP_COMPLAIN)
|
||||
cp_error ("conversion from `%T' to non-scalar type `%T' requested",
|
||||
error ("conversion from `%T' to non-scalar type `%T' requested",
|
||||
TREE_TYPE (expr), type);
|
||||
if (flags & LOOKUP_SPECULATIVELY)
|
||||
return NULL_TREE;
|
||||
|
@ -876,10 +876,10 @@ convert_to_void (expr, implicit)
|
|||
int is_complete = COMPLETE_TYPE_P (complete_type (type));
|
||||
|
||||
if (is_volatile && !is_complete)
|
||||
cp_warning ("object of incomplete type `%T' will not be accessed in %s",
|
||||
warning ("object of incomplete type `%T' will not be accessed in %s",
|
||||
type, implicit ? implicit : "void context");
|
||||
else if (is_reference && is_volatile)
|
||||
cp_warning ("object of type `%T' will not be accessed in %s",
|
||||
warning ("object of type `%T' will not be accessed in %s",
|
||||
TREE_TYPE (TREE_OPERAND (expr, 0)),
|
||||
implicit ? implicit : "void context");
|
||||
if (is_reference || !is_volatile || !is_complete)
|
||||
|
@ -895,7 +895,7 @@ convert_to_void (expr, implicit)
|
|||
int is_complete = COMPLETE_TYPE_P (complete_type (type));
|
||||
|
||||
if (TYPE_VOLATILE (type) && !is_complete)
|
||||
cp_warning ("object `%E' of incomplete type `%T' will not be accessed in %s",
|
||||
warning ("object `%E' of incomplete type `%T' will not be accessed in %s",
|
||||
expr, type, implicit ? implicit : "void context");
|
||||
break;
|
||||
}
|
||||
|
@ -915,12 +915,12 @@ convert_to_void (expr, implicit)
|
|||
{
|
||||
/* [over.over] enumerates the places where we can take the address
|
||||
of an overloaded function, and this is not one of them. */
|
||||
cp_pedwarn ("%s cannot resolve address of overloaded function",
|
||||
pedwarn ("%s cannot resolve address of overloaded function",
|
||||
implicit ? implicit : "void cast");
|
||||
}
|
||||
else if (implicit && probe == expr && is_overloaded_fn (probe))
|
||||
/* Only warn when there is no &. */
|
||||
cp_warning ("%s is a reference, not call, to function `%E'",
|
||||
warning ("%s is a reference, not call, to function `%E'",
|
||||
implicit, expr);
|
||||
}
|
||||
|
||||
|
@ -1058,7 +1058,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");
|
||||
warning ("converting NULL to non-pointer type");
|
||||
|
||||
if (TREE_CODE (expr) == OFFSET_REF)
|
||||
expr = resolve_offset_ref (expr);
|
||||
|
@ -1134,9 +1134,9 @@ build_expr_type_conversion (desires, expr, complain)
|
|||
{
|
||||
if (complain)
|
||||
{
|
||||
cp_error ("ambiguous default type conversion from `%T'",
|
||||
error ("ambiguous default type conversion from `%T'",
|
||||
basetype);
|
||||
cp_error (" candidate conversions include `%D' and `%D'",
|
||||
error (" candidate conversions include `%D' and `%D'",
|
||||
winner, cand);
|
||||
}
|
||||
return error_mark_node;
|
||||
|
|
445
gcc/cp/decl.c
445
gcc/cp/decl.c
File diff suppressed because it is too large
Load Diff
102
gcc/cp/decl2.c
102
gcc/cp/decl2.c
|
@ -758,7 +758,7 @@ grok_method_quals (ctype, function, quals)
|
|||
while (quals);
|
||||
|
||||
if (dup_quals != TYPE_UNQUALIFIED)
|
||||
cp_error ("duplicate type qualifiers in %s declaration",
|
||||
error ("duplicate type qualifiers in %s declaration",
|
||||
TREE_CODE (function) == FUNCTION_DECL
|
||||
? "member function" : "type");
|
||||
|
||||
|
@ -797,7 +797,7 @@ warn_if_unknown_interface (decl)
|
|||
lineno = TINST_LINE (til);
|
||||
input_filename = TINST_FILE (til);
|
||||
}
|
||||
cp_warning ("template `%#D' instantiated in file without #pragma interface",
|
||||
warning ("template `%#D' instantiated in file without #pragma interface",
|
||||
decl);
|
||||
lineno = sl;
|
||||
input_filename = sf;
|
||||
|
@ -1066,7 +1066,7 @@ grok_array_decl (array_expr, index_exp)
|
|||
array_expr = p2, index_exp = i1;
|
||||
else
|
||||
{
|
||||
cp_error ("invalid types `%T[%T]' for array subscript",
|
||||
error ("invalid types `%T[%T]' for array subscript",
|
||||
type, TREE_TYPE (index_exp));
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -1114,7 +1114,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",
|
||||
error ("type `%#T' argument given to `delete', expected pointer",
|
||||
TREE_TYPE (exp));
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
|
|||
/* Deleting ptr to void is undefined behaviour [expr.delete/3]. */
|
||||
if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
|
||||
{
|
||||
cp_warning ("deleting `%T' is undefined", type);
|
||||
warning ("deleting `%T' is undefined", type);
|
||||
doing_vec = 0;
|
||||
}
|
||||
|
||||
|
@ -1147,7 +1147,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));
|
||||
warning ("deleting array `%#D'", TREE_OPERAND (t, 0));
|
||||
|
||||
/* Deleting a pointer with the value zero is valid and has no effect. */
|
||||
if (integer_zerop (t))
|
||||
|
@ -1194,7 +1194,7 @@ check_member_template (tmpl)
|
|||
/* 14.5.2.2 [temp.mem]
|
||||
|
||||
A local class shall not have member templates. */
|
||||
cp_error ("invalid declaration of member template `%#D' in local class",
|
||||
error ("invalid declaration of member template `%#D' in local class",
|
||||
decl);
|
||||
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
|
||||
|
@ -1202,7 +1202,7 @@ check_member_template (tmpl)
|
|||
/* 14.5.2.3 [temp.mem]
|
||||
|
||||
A member function template shall not be virtual. */
|
||||
cp_error
|
||||
error
|
||||
("invalid use of `virtual' in template declaration of `%#D'",
|
||||
decl);
|
||||
DECL_VIRTUAL_P (decl) = 0;
|
||||
|
@ -1213,7 +1213,7 @@ check_member_template (tmpl)
|
|||
DECL_IGNORED_P (tmpl) = 1;
|
||||
}
|
||||
else
|
||||
cp_error ("template declaration of `%#D'", decl);
|
||||
error ("template declaration of `%#D'", decl);
|
||||
}
|
||||
|
||||
/* Return true iff TYPE is a valid Java parameter or return type. */
|
||||
|
@ -1263,7 +1263,7 @@ check_java_method (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'",
|
||||
error ("Java method '%D' has non-Java return type `%T'",
|
||||
method, ret_type);
|
||||
jerr++;
|
||||
}
|
||||
|
@ -1272,7 +1272,7 @@ check_java_method (method)
|
|||
tree type = TREE_VALUE (arg_types);
|
||||
if (! acceptable_java_type (type))
|
||||
{
|
||||
cp_error ("Java method '%D' has non-Java parameter type `%T'",
|
||||
error ("Java method '%D' has non-Java parameter type `%T'",
|
||||
method, type);
|
||||
jerr++;
|
||||
}
|
||||
|
@ -1368,7 +1368,7 @@ check_classfn (ctype, function)
|
|||
if (methods != end && *methods)
|
||||
{
|
||||
tree fndecl = *methods;
|
||||
cp_error ("prototype for `%#D' does not match any in class `%T'",
|
||||
error ("prototype for `%#D' does not match any in class `%T'",
|
||||
function, ctype);
|
||||
cp_error_at ("candidate%s: %+#D", OVL_NEXT (fndecl) ? "s are" : " is",
|
||||
OVL_CURRENT (fndecl));
|
||||
|
@ -1381,7 +1381,7 @@ check_classfn (ctype, function)
|
|||
if (!COMPLETE_TYPE_P (ctype))
|
||||
incomplete_type_error (function, ctype);
|
||||
else
|
||||
cp_error ("no `%#D' member function declared in class `%T'",
|
||||
error ("no `%#D' member function declared in class `%T'",
|
||||
function, ctype);
|
||||
}
|
||||
|
||||
|
@ -1491,10 +1491,10 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
|
|||
Explain that to the user. */
|
||||
static int explained;
|
||||
|
||||
cp_error ("invalid data member initialization");
|
||||
error ("invalid data member initialization");
|
||||
if (!explained)
|
||||
{
|
||||
cp_error ("(use `=' to initialize static data members)");
|
||||
error ("(use `=' to initialize static data members)");
|
||||
explained = 1;
|
||||
}
|
||||
|
||||
|
@ -1534,7 +1534,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",
|
||||
error ("member `%D' conflicts with virtual function table field name",
|
||||
value);
|
||||
|
||||
/* Stash away type declarations. */
|
||||
|
@ -1554,7 +1554,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
|
|||
|
||||
if (DECL_IN_AGGR_P (value))
|
||||
{
|
||||
cp_error ("`%D' is already defined in `%T'", value,
|
||||
error ("`%D' is already defined in `%T'", value,
|
||||
DECL_CONTEXT (value));
|
||||
return void_type_node;
|
||||
}
|
||||
|
@ -1628,7 +1628,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
|
|||
if (TREE_CODE (value) == FIELD_DECL)
|
||||
{
|
||||
if (asmspec)
|
||||
cp_error ("`asm' specifiers are not permitted on non-static data members");
|
||||
error ("`asm' specifiers are not permitted on non-static data members");
|
||||
if (DECL_INITIAL (value) == error_mark_node)
|
||||
init = error_mark_node;
|
||||
cp_finish_decl (value, init, NULL_TREE, flags);
|
||||
|
@ -1680,24 +1680,24 @@ grokbitfield (declarator, declspecs, width)
|
|||
|
||||
if (TREE_CODE (value) == TYPE_DECL)
|
||||
{
|
||||
cp_error ("cannot declare `%D' to be a bitfield type", value);
|
||||
error ("cannot declare `%D' to be a bitfield type", value);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Usually, finish_struct_1 catches bitifields with invalid types.
|
||||
/* Usually, finish_struct_1 catches bitfields with invalid types.
|
||||
But, in the case of bitfields with function type, we confuse
|
||||
ourselves into thinking they are member functions, so we must
|
||||
check here. */
|
||||
if (TREE_CODE (value) == FUNCTION_DECL)
|
||||
{
|
||||
cp_error ("cannot declare bitfield `%D' with function type",
|
||||
DECL_NAME (value));
|
||||
error ("cannot declare bitfield `%D' with function type",
|
||||
DECL_NAME (value));
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
if (DECL_IN_AGGR_P (value))
|
||||
{
|
||||
cp_error ("`%D' is already defined in the class %T", value,
|
||||
error ("`%D' is already defined in the class %T", value,
|
||||
DECL_CONTEXT (value));
|
||||
return void_type_node;
|
||||
}
|
||||
|
@ -1706,7 +1706,7 @@ grokbitfield (declarator, declspecs, width)
|
|||
|
||||
if (TREE_STATIC (value))
|
||||
{
|
||||
cp_error ("static member `%D' cannot be a bitfield", value);
|
||||
error ("static member `%D' cannot be a bitfield", value);
|
||||
return NULL_TREE;
|
||||
}
|
||||
cp_finish_decl (value, NULL_TREE, NULL_TREE, 0);
|
||||
|
@ -1775,11 +1775,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);
|
||||
error ("initializer specified for non-member function `%D'", decl);
|
||||
else if (integer_zerop (init))
|
||||
DECL_PURE_VIRTUAL_P (decl) = 1;
|
||||
else
|
||||
cp_error ("invalid initializer for virtual method `%D'", decl);
|
||||
error ("invalid initializer for virtual method `%D'", decl);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2056,7 +2056,7 @@ coerce_new_type (type)
|
|||
my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107);
|
||||
|
||||
if (!same_type_p (TREE_TYPE (type), ptr_type_node))
|
||||
e = 1, cp_error ("`operator new' must return type `%T'", ptr_type_node);
|
||||
e = 1, error ("`operator new' must return type `%T'", ptr_type_node);
|
||||
|
||||
if (!args || args == void_list_node
|
||||
|| !same_type_p (TREE_VALUE (args), c_size_type_node))
|
||||
|
@ -2064,7 +2064,7 @@ coerce_new_type (type)
|
|||
e = 2;
|
||||
if (args && args != void_list_node)
|
||||
args = TREE_CHAIN (args);
|
||||
cp_error ("`operator new' takes type `size_t' (`%T') as first parameter", c_size_type_node);
|
||||
error ("`operator new' takes type `size_t' (`%T') as first parameter", c_size_type_node);
|
||||
}
|
||||
switch (e)
|
||||
{
|
||||
|
@ -2091,7 +2091,7 @@ coerce_delete_type (type)
|
|||
my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107);
|
||||
|
||||
if (!same_type_p (TREE_TYPE (type), void_type_node))
|
||||
e = 1, cp_error ("`operator delete' must return type `%T'", void_type_node);
|
||||
e = 1, error ("`operator delete' must return type `%T'", void_type_node);
|
||||
|
||||
if (!args || args == void_list_node
|
||||
|| !same_type_p (TREE_VALUE (args), ptr_type_node))
|
||||
|
@ -2099,7 +2099,7 @@ coerce_delete_type (type)
|
|||
e = 2;
|
||||
if (args && args != void_list_node)
|
||||
args = TREE_CHAIN (args);
|
||||
cp_error ("`operator delete' takes type `%T' as first parameter", ptr_type_node);
|
||||
error ("`operator delete' takes type `%T' as first parameter", ptr_type_node);
|
||||
}
|
||||
switch (e)
|
||||
{
|
||||
|
@ -4198,7 +4198,7 @@ ambiguous_decl (name, old, new, flags)
|
|||
repeat ourselves. */
|
||||
if (BINDING_VALUE (old) != error_mark_node)
|
||||
{
|
||||
cp_error ("use of `%D' is ambiguous", name);
|
||||
error ("use of `%D' is ambiguous", name);
|
||||
cp_error_at (" first declared as `%#D' here",
|
||||
BINDING_VALUE (old));
|
||||
}
|
||||
|
@ -4217,7 +4217,7 @@ ambiguous_decl (name, old, new, flags)
|
|||
{
|
||||
if (flags & LOOKUP_COMPLAIN)
|
||||
{
|
||||
cp_error ("`%D' denotes an ambiguous type",name);
|
||||
error ("`%D' denotes an ambiguous type",name);
|
||||
cp_error_at (" first type here", BINDING_TYPE (old));
|
||||
cp_error_at (" other type here", type);
|
||||
}
|
||||
|
@ -4316,7 +4316,7 @@ set_decl_namespace (decl, scope, friendp)
|
|||
|
||||
/* It is ok for friends to be qualified in parallel space. */
|
||||
if (!friendp && !is_namespace_ancestor (current_namespace, scope))
|
||||
cp_error ("declaration of `%D' not in a namespace surrounding `%D'",
|
||||
error ("declaration of `%D' not in a namespace surrounding `%D'",
|
||||
decl, scope);
|
||||
DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
|
||||
if (scope != current_namespace)
|
||||
|
@ -4350,7 +4350,7 @@ set_decl_namespace (decl, scope, friendp)
|
|||
else
|
||||
return;
|
||||
complain:
|
||||
cp_error ("`%D' should have been declared inside `%D'",
|
||||
error ("`%D' should have been declared inside `%D'",
|
||||
decl, scope);
|
||||
}
|
||||
|
||||
|
@ -4486,7 +4486,7 @@ add_function (k, 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);
|
||||
error (" in call to `%D'", k->name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -4799,7 +4799,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);
|
||||
error ("unknown namespace `%D'", namespace);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4833,9 +4833,9 @@ validate_nonmember_using_decl (decl, scope, name)
|
|||
if(TREE_CODE (*scope) != NAMESPACE_DECL)
|
||||
{
|
||||
if (TYPE_P (*scope))
|
||||
cp_error ("`%T' is not a namespace", *scope);
|
||||
error ("`%T' is not a namespace", *scope);
|
||||
else
|
||||
cp_error ("`%D' is not a namespace", *scope);
|
||||
error ("`%D' is not a namespace", *scope);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -4844,7 +4844,7 @@ validate_nonmember_using_decl (decl, scope, name)
|
|||
if (TREE_CODE (*name) == TEMPLATE_ID_EXPR)
|
||||
{
|
||||
*name = TREE_OPERAND (*name, 0);
|
||||
cp_error ("a using-declaration cannot specify a template-id. Try `using %D'", *name);
|
||||
error ("a using-declaration cannot specify a template-id. Try `using %D'", *name);
|
||||
return NULL_TREE;
|
||||
}
|
||||
}
|
||||
|
@ -4858,7 +4858,7 @@ validate_nonmember_using_decl (decl, scope, name)
|
|||
}
|
||||
else if (TREE_CODE (decl) == NAMESPACE_DECL)
|
||||
{
|
||||
cp_error ("namespace `%D' not allowed in using-declaration", decl);
|
||||
error ("namespace `%D' not allowed in using-declaration", decl);
|
||||
return NULL_TREE;
|
||||
}
|
||||
else
|
||||
|
@ -4887,7 +4887,7 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
|
|||
|
||||
if (!BINDING_VALUE (decls) && !BINDING_TYPE (decls))
|
||||
{
|
||||
cp_error ("`%D' not declared", name);
|
||||
error ("`%D' not declared", name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4929,7 +4929,7 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
|
|||
this scope with the same parameter types. If both
|
||||
are the same extern "C" functions, that's ok. */
|
||||
if (!decls_match (new_fn, old_fn))
|
||||
cp_error ("`%D' is already declared in this scope", name);
|
||||
error ("`%D' is already declared in this scope", name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4956,7 +4956,7 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
|
|||
*newtype = BINDING_TYPE (decls);
|
||||
if (oldtype && *newtype && oldtype != *newtype)
|
||||
{
|
||||
cp_error ("using declaration `%D' introduced ambiguous type `%T'",
|
||||
error ("using declaration `%D' introduced ambiguous type `%T'",
|
||||
name, oldtype);
|
||||
return;
|
||||
}
|
||||
|
@ -5047,19 +5047,19 @@ do_class_using_decl (decl)
|
|||
if (TREE_CODE (decl) != SCOPE_REF
|
||||
|| !TYPE_P (TREE_OPERAND (decl, 0)))
|
||||
{
|
||||
cp_error ("using-declaration for non-member at class scope");
|
||||
error ("using-declaration for non-member at class scope");
|
||||
return NULL_TREE;
|
||||
}
|
||||
name = TREE_OPERAND (decl, 1);
|
||||
if (TREE_CODE (name) == BIT_NOT_EXPR)
|
||||
{
|
||||
cp_error ("using-declaration for destructor");
|
||||
error ("using-declaration for destructor");
|
||||
return NULL_TREE;
|
||||
}
|
||||
else if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
|
||||
{
|
||||
name = TREE_OPERAND (name, 0);
|
||||
cp_error ("a using-declaration cannot specify a template-id. Try `using %T::%D'", TREE_OPERAND (decl, 0), name);
|
||||
error ("a using-declaration cannot specify a template-id. Try `using %T::%D'", TREE_OPERAND (decl, 0), name);
|
||||
return NULL_TREE;
|
||||
}
|
||||
if (TREE_CODE (name) == TYPE_DECL || TREE_CODE (name) == TEMPLATE_DECL)
|
||||
|
@ -5088,13 +5088,13 @@ do_using_directive (namespace)
|
|||
{
|
||||
/* Lookup in lexer did not find a namespace. */
|
||||
if (!processing_template_decl)
|
||||
cp_error ("namespace `%T' undeclared", namespace);
|
||||
error ("namespace `%T' undeclared", namespace);
|
||||
return;
|
||||
}
|
||||
if (TREE_CODE (namespace) != NAMESPACE_DECL)
|
||||
{
|
||||
if (!processing_template_decl)
|
||||
cp_error ("`%T' is not a namespace", namespace);
|
||||
error ("`%T' is not a namespace", namespace);
|
||||
return;
|
||||
}
|
||||
namespace = ORIGINAL_NAMESPACE (namespace);
|
||||
|
@ -5198,13 +5198,13 @@ handle_class_head (aggr, scope, id)
|
|||
/* We've been given AGGR SCOPE::ID, when we're already inside SCOPE.
|
||||
Be nice about it. */
|
||||
if (pedantic)
|
||||
cp_pedwarn ("extra qualification `%T::' on member `%D' ignored",
|
||||
pedwarn ("extra qualification `%T::' on member `%D' ignored",
|
||||
FROB_CONTEXT (scope), id);
|
||||
}
|
||||
else if (scope != global_namespace)
|
||||
cp_error ("`%T' does not have a nested type named `%D'", scope, id);
|
||||
error ("`%T' does not have a nested type named `%D'", scope, id);
|
||||
else
|
||||
cp_error ("no file-scope type named `%D'", id);
|
||||
error ("no file-scope type named `%D'", id);
|
||||
|
||||
/* Inject it at the current scope. */
|
||||
if (! decl)
|
||||
|
|
|
@ -939,7 +939,7 @@ dump_decl (t, flags)
|
|||
break;
|
||||
|
||||
/* These special cases are duplicated here so that other functions
|
||||
can feed identifiers to cp_error and get them demangled properly. */
|
||||
can feed identifiers to error and get them demangled properly. */
|
||||
case IDENTIFIER_NODE:
|
||||
if (IDENTIFIER_TYPENAME_P (t))
|
||||
{
|
||||
|
@ -1093,7 +1093,7 @@ dump_template_decl (t, flags)
|
|||
|
||||
/* Pretty print a function decl. There are several ways we want to print a
|
||||
function declaration. The TFF_ bits in FLAGS tells us how to behave.
|
||||
As cp_error can only apply the '#' flag once to give 0 and 1 for V, there
|
||||
As error can only apply the '#' flag once to give 0 and 1 for V, there
|
||||
is %D which doesn't print the throw specs, and %F which does. */
|
||||
|
||||
static void
|
||||
|
@ -2215,7 +2215,7 @@ cp_line_of (t)
|
|||
return line;
|
||||
}
|
||||
|
||||
/* Now the interfaces from cp_error et al to dump_type et al. Each takes an
|
||||
/* Now the interfaces from error et al to dump_type et al. Each takes an
|
||||
on/off VERBOSE flag and supply the appropriate TFF_ flags to a dump_
|
||||
function. */
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ decl_is_java_type (decl, err)
|
|||
&& TYPE_FOR_JAVA (TREE_TYPE (decl)))
|
||||
{
|
||||
/* Can't throw a reference. */
|
||||
cp_error ("type `%T' is disallowed in Java `throw' or `catch'",
|
||||
error ("type `%T' is disallowed in Java `throw' or `catch'",
|
||||
decl);
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ decl_is_java_type (decl, err)
|
|||
if (! DERIVED_FROM_P (jthrow_node, TREE_TYPE (decl)))
|
||||
{
|
||||
/* Thrown object must be a Throwable. */
|
||||
cp_error ("type `%T' is not derived from `java::lang::Throwable'",
|
||||
error ("type `%T' is not derived from `java::lang::Throwable'",
|
||||
TREE_TYPE (decl));
|
||||
}
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ build_throw (exp)
|
|||
return build_min (THROW_EXPR, void_type_node, exp);
|
||||
|
||||
if (exp == null_node)
|
||||
cp_warning ("throwing NULL, which has integral, not pointer type");
|
||||
warning ("throwing NULL, which has integral, not pointer type");
|
||||
|
||||
if (exp != NULL_TREE)
|
||||
{
|
||||
|
@ -772,7 +772,7 @@ is_admissible_throw_operand (expr)
|
|||
conversion. */
|
||||
else if (CLASS_TYPE_P (type) && CLASSTYPE_PURE_VIRTUALS (type))
|
||||
{
|
||||
cp_error ("expression '%E' of abstract class type '%T' cannot be used in throw-expression", expr, type);
|
||||
error ("expression '%E' of abstract class type '%T' cannot be used in throw-expression", expr, type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -860,10 +860,10 @@ check_handlers_1 (master, handlers)
|
|||
&& can_convert_eh (type, TREE_TYPE (handler)))
|
||||
{
|
||||
lineno = STMT_LINENO (handler);
|
||||
cp_warning ("exception of type `%T' will be caught",
|
||||
warning ("exception of type `%T' will be caught",
|
||||
TREE_TYPE (handler));
|
||||
lineno = STMT_LINENO (master);
|
||||
cp_warning (" by earlier handler for `%T'", type);
|
||||
warning (" by earlier handler for `%T'", type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -883,7 +883,7 @@ check_handlers (handlers)
|
|||
else if (TREE_TYPE (handler) == NULL_TREE)
|
||||
{
|
||||
lineno = STMT_LINENO (handler);
|
||||
cp_pedwarn
|
||||
pedwarn
|
||||
("`...' handler must be the last handler for its try block");
|
||||
}
|
||||
else
|
||||
|
|
|
@ -152,7 +152,7 @@ add_friend (type, decl)
|
|||
{
|
||||
if (decl == TREE_VALUE (friends))
|
||||
{
|
||||
cp_warning ("`%D' is already a friend of class `%T'",
|
||||
warning ("`%D' is already a friend of class `%T'",
|
||||
decl, type);
|
||||
cp_warning_at ("previous friend declaration of `%D'",
|
||||
TREE_VALUE (friends));
|
||||
|
@ -194,7 +194,7 @@ make_friend_class (type, friend_type)
|
|||
|
||||
if (! IS_AGGR_TYPE (friend_type))
|
||||
{
|
||||
cp_error ("invalid type `%T' declared `friend'", friend_type);
|
||||
error ("invalid type `%T' declared `friend'", friend_type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ make_friend_class (type, friend_type)
|
|||
|
||||
Friend declarations shall not declare partial
|
||||
specializations. */
|
||||
cp_error ("partial specialization `%T' declared `friend'",
|
||||
error ("partial specialization `%T' declared `friend'",
|
||||
friend_type);
|
||||
return;
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ make_friend_class (type, friend_type)
|
|||
is_template_friend = 1;
|
||||
else if (same_type_p (type, friend_type))
|
||||
{
|
||||
cp_pedwarn ("class `%T' is implicitly friends with itself",
|
||||
pedwarn ("class `%T' is implicitly friends with itself",
|
||||
type);
|
||||
return;
|
||||
}
|
||||
|
@ -236,19 +236,19 @@ make_friend_class (type, friend_type)
|
|||
else if (TREE_CODE (friend_type) == TYPENAME_TYPE)
|
||||
{
|
||||
/* template <class T> friend typename S<T>::X; */
|
||||
cp_error ("typename type `%#T' declared `friend'", friend_type);
|
||||
error ("typename type `%#T' declared `friend'", friend_type);
|
||||
return;
|
||||
}
|
||||
else if (TREE_CODE (friend_type) == TEMPLATE_TYPE_PARM)
|
||||
{
|
||||
/* template <class T> friend class T; */
|
||||
cp_error ("template parameter type `%T' declared `friend'", friend_type);
|
||||
error ("template parameter type `%T' declared `friend'", friend_type);
|
||||
return;
|
||||
}
|
||||
else if (!CLASSTYPE_TEMPLATE_INFO (friend_type))
|
||||
{
|
||||
/* template <class T> friend class A; where A is not a template */
|
||||
cp_error ("`%#T' is not a template", friend_type);
|
||||
error ("`%#T' is not a template", friend_type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ make_friend_class (type, friend_type)
|
|||
same_type_p (TREE_VALUE (classes), friend_type)))
|
||||
classes = TREE_CHAIN (classes);
|
||||
if (classes)
|
||||
cp_warning ("`%T' is already a friend of `%T'",
|
||||
warning ("`%T' is already a friend of `%T'",
|
||||
TREE_VALUE (classes), type);
|
||||
else
|
||||
{
|
||||
|
@ -361,7 +361,7 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist,
|
|||
add_friend (current_class_type, decl);
|
||||
}
|
||||
else
|
||||
cp_error ("member `%D' declared as friend before type `%T' defined",
|
||||
error ("member `%D' declared as friend before type `%T' defined",
|
||||
decl, ctype);
|
||||
}
|
||||
/* A global friend.
|
||||
|
@ -416,7 +416,7 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist,
|
|||
if (warn)
|
||||
{
|
||||
static int explained;
|
||||
cp_warning ("friend declaration `%#D' declares a non-template function", decl);
|
||||
warning ("friend declaration `%#D' declares a non-template function", decl);
|
||||
if (! explained)
|
||||
{
|
||||
warning ("(if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) -Wno-non-template-friend disables this warning");
|
||||
|
|
|
@ -281,13 +281,13 @@ perform_member_init (member, init, explicit)
|
|||
{
|
||||
init = build_default_init (type);
|
||||
if (TREE_CODE (type) == REFERENCE_TYPE)
|
||||
cp_warning
|
||||
warning
|
||||
("default-initialization of `%#D', which has reference type",
|
||||
member);
|
||||
}
|
||||
/* member traversal: note it leaves init NULL */
|
||||
else if (TREE_CODE (type) == REFERENCE_TYPE)
|
||||
cp_pedwarn ("uninitialized reference member `%D'", member);
|
||||
pedwarn ("uninitialized reference member `%D'", member);
|
||||
}
|
||||
else if (TREE_CODE (init) == TREE_LIST)
|
||||
{
|
||||
|
@ -425,7 +425,7 @@ sort_member_init (t, member_init_list)
|
|||
/* If there was already an explicit initializer for this field,
|
||||
issue an error. */
|
||||
if (TREE_TYPE (f))
|
||||
cp_error ("multiple initializations given for member `%D'",
|
||||
error ("multiple initializations given for member `%D'",
|
||||
initialized_field);
|
||||
else
|
||||
{
|
||||
|
@ -497,7 +497,7 @@ sort_member_init (t, member_init_list)
|
|||
if (same_type_p (last_field_type, field_type))
|
||||
{
|
||||
if (TREE_CODE (field_type) == UNION_TYPE)
|
||||
cp_error ("initializations for multiple members of `%T'",
|
||||
error ("initializations for multiple members of `%T'",
|
||||
last_field_type);
|
||||
done = 1;
|
||||
break;
|
||||
|
@ -628,7 +628,7 @@ sort_base_init (t, base_init_list, rbase_ptr, vbase_ptr)
|
|||
}
|
||||
else if (binfo == base_binfo)
|
||||
{
|
||||
cp_error ("base class `%T' already initialized",
|
||||
error ("base class `%T' already initialized",
|
||||
BINFO_TYPE (binfo));
|
||||
break;
|
||||
}
|
||||
|
@ -699,7 +699,7 @@ emit_base_init (mem_init_list, base_init_list)
|
|||
init = NULL_TREE;
|
||||
if (extra_warnings
|
||||
&& DECL_COPY_CONSTRUCTOR_P (current_function_decl))
|
||||
cp_warning ("base class `%#T' should be explicitly initialized in the copy constructor",
|
||||
warning ("base class `%#T' should be explicitly initialized in the copy constructor",
|
||||
BINFO_TYPE (base_binfo));
|
||||
}
|
||||
|
||||
|
@ -742,7 +742,7 @@ emit_base_init (mem_init_list, base_init_list)
|
|||
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);
|
||||
warning ("`%D' should be initialized in the member initialization list", member);
|
||||
}
|
||||
|
||||
perform_member_init (member, init, from_init_list);
|
||||
|
@ -984,13 +984,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 `%D'", type,
|
||||
error ("class `%T' does not have any field named `%D'", type,
|
||||
member_name);
|
||||
return 0;
|
||||
}
|
||||
if (TREE_STATIC (field))
|
||||
{
|
||||
cp_error ("field `%#D' is static; the only point of initialization is its definition",
|
||||
error ("field `%#D' is static; the only point of initialization is its definition",
|
||||
field);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1029,14 +1029,14 @@ expand_member_init (exp, name, init)
|
|||
switch (CLASSTYPE_N_BASECLASSES (type))
|
||||
{
|
||||
case 0:
|
||||
cp_error ("unnamed initializer for `%T', which has no base classes",
|
||||
error ("unnamed initializer for `%T', which has no base classes",
|
||||
type);
|
||||
return NULL_TREE;
|
||||
case 1:
|
||||
basetype = TYPE_BINFO_BASETYPE (type, 0);
|
||||
break;
|
||||
default:
|
||||
cp_error ("unnamed initializer for `%T', which uses multiple inheritance",
|
||||
error ("unnamed initializer for `%T', which uses multiple inheritance",
|
||||
type);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -1065,10 +1065,10 @@ expand_member_init (exp, name, init)
|
|||
else
|
||||
{
|
||||
if (TYPE_USES_VIRTUAL_BASECLASSES (type))
|
||||
cp_error ("type `%D' is not a direct or virtual base of `%T'",
|
||||
error ("type `%D' is not a direct or virtual base of `%T'",
|
||||
name, type);
|
||||
else
|
||||
cp_error ("type `%D' is not a direct base of `%T'",
|
||||
error ("type `%D' is not a direct base of `%T'",
|
||||
name, type);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -1162,7 +1162,7 @@ build_aggr_init (exp, init, flags)
|
|||
COMPLEX zees(1.0, 0.0)[10];
|
||||
}
|
||||
*/
|
||||
cp_error ("bad array initializer");
|
||||
error ("bad array initializer");
|
||||
return error_mark_node;
|
||||
}
|
||||
if (cp_type_quals (type) != TYPE_UNQUALIFIED)
|
||||
|
@ -1354,7 +1354,7 @@ is_aggr_type (type, or_else)
|
|||
&& TREE_CODE (type) != BOUND_TEMPLATE_TEMPLATE_PARM)
|
||||
{
|
||||
if (or_else)
|
||||
cp_error ("`%T' is not an aggregate type", type);
|
||||
error ("`%T' is not an aggregate type", type);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
@ -1377,7 +1377,7 @@ get_aggr_from_typedef (name, or_else)
|
|||
else
|
||||
{
|
||||
if (or_else)
|
||||
cp_error ("`%T' fails to be an aggregate typedef", name);
|
||||
error ("`%T' fails to be an aggregate typedef", name);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -1386,7 +1386,7 @@ get_aggr_from_typedef (name, or_else)
|
|||
&& TREE_CODE (type) != BOUND_TEMPLATE_TEMPLATE_PARM)
|
||||
{
|
||||
if (or_else)
|
||||
cp_error ("type `%T' is of non-aggregate type", type);
|
||||
error ("type `%T' is of non-aggregate type", type);
|
||||
return NULL_TREE;
|
||||
}
|
||||
return type;
|
||||
|
@ -1488,7 +1488,7 @@ build_member_call (type, name, parmlist)
|
|||
|
||||
if (dtor)
|
||||
{
|
||||
cp_error ("cannot call destructor `%T::~%T' without object", type,
|
||||
error ("cannot call destructor `%T::~%T' without object", type,
|
||||
method_name);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -1530,7 +1530,7 @@ build_member_call (type, name, parmlist)
|
|||
{
|
||||
if (is_dummy_object (decl))
|
||||
{
|
||||
cp_error ("invalid use of non-static field `%D'", t);
|
||||
error ("invalid use of non-static field `%D'", t);
|
||||
return error_mark_node;
|
||||
}
|
||||
decl = build (COMPONENT_REF, TREE_TYPE (t), decl, t);
|
||||
|
@ -1539,7 +1539,7 @@ build_member_call (type, name, parmlist)
|
|||
decl = t;
|
||||
else
|
||||
{
|
||||
cp_error ("invalid use of member `%D'", t);
|
||||
error ("invalid use of member `%D'", t);
|
||||
return error_mark_node;
|
||||
}
|
||||
if (TYPE_LANG_SPECIFIC (TREE_TYPE (decl)))
|
||||
|
@ -1549,7 +1549,7 @@ build_member_call (type, name, parmlist)
|
|||
}
|
||||
else
|
||||
{
|
||||
cp_error ("no method `%T::%D'", type, name);
|
||||
error ("no method `%T::%D'", type, name);
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
|
@ -1634,7 +1634,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'",
|
||||
error ("qualified type `%T' does not match destructor name `~%T'",
|
||||
type, TREE_OPERAND (name, 0));
|
||||
name = dtor_identifier;
|
||||
}
|
||||
|
@ -1642,7 +1642,7 @@ build_offset_ref (type, name)
|
|||
if (!COMPLETE_TYPE_P (complete_type (type))
|
||||
&& !TYPE_BEING_DEFINED (type))
|
||||
{
|
||||
cp_error ("incomplete type `%T' does not have member `%D'", type,
|
||||
error ("incomplete type `%T' does not have member `%D'", type,
|
||||
name);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -1711,7 +1711,7 @@ build_offset_ref (type, name)
|
|||
|
||||
if (t == NULL_TREE)
|
||||
{
|
||||
cp_error ("`%D' is not a member of type `%T'", name, type);
|
||||
error ("`%D' is not a member of type `%T'", name, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1730,7 +1730,7 @@ build_offset_ref (type, name)
|
|||
|
||||
if (TREE_CODE (t) == FIELD_DECL && DECL_C_BIT_FIELD (t))
|
||||
{
|
||||
cp_error ("illegal pointer to bit field `%D'", t);
|
||||
error ("illegal pointer to bit field `%D'", t);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1859,7 +1859,7 @@ resolve_offset_ref (exp)
|
|||
{
|
||||
if (addr == error_mark_node)
|
||||
{
|
||||
cp_error ("object missing in `%E'", exp);
|
||||
error ("object missing in `%E'", exp);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -2416,7 +2416,7 @@ build_new_1 (exp)
|
|||
if (init == void_zero_node)
|
||||
init = build_default_init (full_type);
|
||||
else if (init && pedantic && has_array)
|
||||
cp_pedwarn ("ISO C++ forbids initialization in array new");
|
||||
pedwarn ("ISO C++ forbids initialization in array new");
|
||||
|
||||
if (has_array)
|
||||
init_expr = build_vec_init (init_expr, init, 0);
|
||||
|
@ -2515,7 +2515,7 @@ build_new_1 (exp)
|
|||
}
|
||||
}
|
||||
else if (CP_TYPE_CONST_P (true_type))
|
||||
cp_error ("uninitialized const in `new' of `%#T'", true_type);
|
||||
error ("uninitialized const in `new' of `%#T'", true_type);
|
||||
|
||||
/* Now build up the return value in reverse order. */
|
||||
|
||||
|
|
10
gcc/cp/lex.c
10
gcc/cp/lex.c
|
@ -1000,7 +1000,7 @@ check_for_missing_semicolon (type)
|
|||
error ("semicolon missing after %s declaration",
|
||||
TREE_CODE (type) == ENUMERAL_TYPE ? "enum" : "struct");
|
||||
else
|
||||
cp_error ("semicolon missing after declaration of `%T'", type);
|
||||
error ("semicolon missing after declaration of `%T'", type);
|
||||
shadow_tag (build_tree_list (0, type));
|
||||
}
|
||||
/* Could probably also hack cases where class { ... } f (); appears. */
|
||||
|
@ -1248,12 +1248,12 @@ do_identifier (token, parsing, args)
|
|||
else if (IDENTIFIER_OPNAME_P (token))
|
||||
{
|
||||
if (token != ansi_opname (ERROR_MARK))
|
||||
cp_error ("`%D' not defined", token);
|
||||
error ("`%D' not defined", token);
|
||||
id = error_mark_node;
|
||||
}
|
||||
else if (current_function_decl == 0)
|
||||
{
|
||||
cp_error ("`%D' was not declared in this scope", token);
|
||||
error ("`%D' was not declared in this scope", token);
|
||||
id = error_mark_node;
|
||||
}
|
||||
else
|
||||
|
@ -1263,7 +1263,7 @@ do_identifier (token, parsing, args)
|
|||
{
|
||||
static int undeclared_variable_notice;
|
||||
|
||||
cp_error ("`%D' undeclared (first use this function)", token);
|
||||
error ("`%D' undeclared (first use this function)", token);
|
||||
|
||||
if (! undeclared_variable_notice)
|
||||
{
|
||||
|
@ -1378,7 +1378,7 @@ do_scoped_id (token, parsing)
|
|||
return id;
|
||||
}
|
||||
if (IDENTIFIER_NAMESPACE_VALUE (token) != error_mark_node)
|
||||
cp_error ("`::%D' undeclared (first use here)", token);
|
||||
error ("`::%D' undeclared (first use here)", token);
|
||||
id = error_mark_node;
|
||||
/* Prevent repeated error messages. */
|
||||
SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node);
|
||||
|
|
|
@ -185,13 +185,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",
|
||||
error ("invalid use of member `%D' 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);
|
||||
error ("invalid use of member `%D'", value);
|
||||
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -233,12 +233,12 @@ hack_identifier (value, name)
|
|||
}
|
||||
else if (TREE_CODE (value) == NAMESPACE_DECL)
|
||||
{
|
||||
cp_error ("use of namespace `%D' as expression", value);
|
||||
error ("use of namespace `%D' as expression", value);
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (DECL_CLASS_TEMPLATE_P (value))
|
||||
{
|
||||
cp_error ("use of class template `%T' as expression", value);
|
||||
error ("use of class template `%T' as expression", value);
|
||||
return error_mark_node;
|
||||
}
|
||||
else
|
||||
|
@ -251,7 +251,7 @@ hack_identifier (value, name)
|
|||
if (context != NULL_TREE && context != current_function_decl
|
||||
&& ! TREE_STATIC (value))
|
||||
{
|
||||
cp_error ("use of %s from containing function",
|
||||
error ("use of %s from containing function",
|
||||
(TREE_CODE (value) == VAR_DECL
|
||||
? "`auto' variable" : "parameter"));
|
||||
cp_error_at (" `%#D' declared here", value);
|
||||
|
@ -272,7 +272,7 @@ hack_identifier (value, name)
|
|||
else if (TREE_CODE (value) == TREE_LIST
|
||||
&& TREE_TYPE (value) == error_mark_node)
|
||||
{
|
||||
cp_error ("\
|
||||
error ("\
|
||||
request for member `%D' is ambiguous in multiple inheritance lattice",
|
||||
name);
|
||||
print_candidates (value);
|
||||
|
@ -325,7 +325,7 @@ make_thunk (function, delta, vcall_index)
|
|||
thunk = IDENTIFIER_GLOBAL_VALUE (thunk_id);
|
||||
if (thunk && !DECL_THUNK_P (thunk))
|
||||
{
|
||||
cp_error ("implementation-reserved name `%D' used", thunk_id);
|
||||
error ("implementation-reserved name `%D' used", thunk_id);
|
||||
thunk = NULL_TREE;
|
||||
SET_IDENTIFIER_GLOBAL_VALUE (thunk_id, thunk);
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ use_thunk (thunk_fndecl, emit_p)
|
|||
tree a, t;
|
||||
|
||||
if (varargs_function_p (function))
|
||||
cp_error ("generic thunk code fails for method `%#D' which uses `...'",
|
||||
error ("generic thunk code fails for method `%#D' which uses `...'",
|
||||
function);
|
||||
|
||||
/* Set up clone argument trees for the thunk. */
|
||||
|
@ -675,12 +675,12 @@ do_build_assign_ref (fndecl)
|
|||
|
||||
if (CP_TYPE_CONST_P (TREE_TYPE (field)))
|
||||
{
|
||||
cp_error ("non-static const member `%#D', can't use default assignment operator", field);
|
||||
error ("non-static const member `%#D', can't use default assignment operator", field);
|
||||
continue;
|
||||
}
|
||||
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE)
|
||||
{
|
||||
cp_error ("non-static reference member `%#D', can't use default assignment operator", field);
|
||||
error ("non-static reference member `%#D', can't use default assignment operator", field);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -498,7 +498,7 @@ extdef:
|
|||
{ do_pending_inlines (); }
|
||||
|
||||
| EXPORT
|
||||
{ cp_warning ("keyword `export' not implemented, and will be ignored"); }
|
||||
{ warning ("keyword `export' not implemented, and will be ignored"); }
|
||||
template_def
|
||||
{ do_pending_inlines (); }
|
||||
| template_def
|
||||
|
@ -602,7 +602,7 @@ 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);
|
||||
error ("use of linkage spec `%D' is different from previous spec `%D'", $2, current_lang_name);
|
||||
pop_lang_context (); push_lang_context ($2); }
|
||||
;
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ template_arg:
|
|||
{
|
||||
if (!processing_template_decl)
|
||||
{
|
||||
cp_error ("use of template qualifier outside template");
|
||||
error ("use of template qualifier outside template");
|
||||
$$ = error_mark_node;
|
||||
}
|
||||
else
|
||||
|
@ -1169,9 +1169,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);
|
||||
error ("definition of class `%T' in condition", s);
|
||||
else if (TREE_CODE (s) == ENUMERAL_TYPE)
|
||||
cp_error ("definition of enum `%T' in condition", s);
|
||||
error ("definition of enum `%T' in condition", s);
|
||||
}
|
||||
}
|
||||
current_declspecs = $1.t;
|
||||
|
@ -1182,7 +1182,7 @@ condition:
|
|||
parse_end_decl ($<ttype>6, $7, $4);
|
||||
$$ = convert_from_reference ($<ttype>6);
|
||||
if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE)
|
||||
cp_error ("definition of array `%#D' in condition", $$);
|
||||
error ("definition of array `%#D' in condition", $$);
|
||||
}
|
||||
| expr
|
||||
;
|
||||
|
@ -1291,7 +1291,7 @@ new_placement:
|
|||
'(' nonnull_exprlist ')'
|
||||
{ $$ = $2; }
|
||||
| '{' nonnull_exprlist '}'
|
||||
{ cp_pedwarn ("old style placement syntax, use () instead");
|
||||
{ pedwarn ("old style placement syntax, use () instead");
|
||||
$$ = $2; }
|
||||
;
|
||||
|
||||
|
@ -1302,7 +1302,7 @@ new_initializer:
|
|||
{ $$ = void_zero_node; }
|
||||
| '(' typespec ')'
|
||||
{
|
||||
cp_error ("`%T' is not a valid expression", $2.t);
|
||||
error ("`%T' is not a valid expression", $2.t);
|
||||
$$ = error_mark_node;
|
||||
}
|
||||
/* GNU extension so people can use initializer lists. Note that
|
||||
|
@ -2275,7 +2275,7 @@ structsp:
|
|||
{ $$.t = $2;
|
||||
$$.new_type_flag = 0;
|
||||
if (!processing_template_decl)
|
||||
cp_pedwarn ("using `typename' outside of template"); }
|
||||
pedwarn ("using `typename' outside of template"); }
|
||||
/* C++ extensions, merged with C to avoid shift/reduce conflicts */
|
||||
| class_head '{'
|
||||
{ $1.t = begin_class_definition ($1.t);
|
||||
|
@ -2319,7 +2319,7 @@ structsp:
|
|||
$$.t = $1.t;
|
||||
else if (TYPE_BINFO ($1.t) == NULL_TREE)
|
||||
{
|
||||
cp_error ("%T is not a class type", $1.t);
|
||||
error ("%T is not a class type", $1.t);
|
||||
$$.t = error_mark_node;
|
||||
}
|
||||
else
|
||||
|
@ -2330,7 +2330,7 @@ structsp:
|
|||
&& TYPE_BINFO_BASETYPES ($$.t)
|
||||
&& !COMPLETE_TYPE_P ($$.t)
|
||||
&& ! TYPE_BEING_DEFINED ($$.t))
|
||||
cp_error ("base clause without member specification for `%#T'",
|
||||
error ("base clause without member specification for `%#T'",
|
||||
$$.t);
|
||||
}
|
||||
}
|
||||
|
@ -2448,7 +2448,7 @@ named_class_head:
|
|||
$$.new_type_flag = $1.new_type_flag;
|
||||
if ((current_aggr == union_type_node)
|
||||
!= (TREE_CODE (type) == UNION_TYPE))
|
||||
cp_pedwarn (current_aggr == union_type_node
|
||||
pedwarn (current_aggr == union_type_node
|
||||
? "`union' tag used in declaring `%#T'"
|
||||
: "non-`union' tag used in declaring `%#T'",
|
||||
type);
|
||||
|
@ -2524,7 +2524,7 @@ base_class_access_list:
|
|||
VISSPEC see_typename
|
||||
| SCSPEC see_typename
|
||||
{ if ($1 != ridpointers[(int)RID_VIRTUAL])
|
||||
cp_error ("`%D' access", $1);
|
||||
error ("`%D' access", $1);
|
||||
$$ = access_default_virtual_node; }
|
||||
| base_class_access_list VISSPEC see_typename
|
||||
{
|
||||
|
@ -2539,7 +2539,7 @@ base_class_access_list:
|
|||
}
|
||||
| base_class_access_list SCSPEC see_typename
|
||||
{ if ($2 != ridpointers[(int)RID_VIRTUAL])
|
||||
cp_error ("`%D' access", $2);
|
||||
error ("`%D' access", $2);
|
||||
else if ($$ == access_public_node)
|
||||
$$ = access_public_virtual_node;
|
||||
else if ($$ == access_protected_node)
|
||||
|
@ -3085,7 +3085,7 @@ typename_sub0:
|
|||
if (TYPE_P ($1))
|
||||
$$ = make_typename_type ($1, $2, /*complain=*/1);
|
||||
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
|
||||
cp_error ("`%T' is not a class or namespace", $2);
|
||||
error ("`%T' is not a class or namespace", $2);
|
||||
else
|
||||
{
|
||||
$$ = $2;
|
||||
|
@ -3105,7 +3105,7 @@ typename_sub1:
|
|||
typename_sub2
|
||||
{
|
||||
if (TREE_CODE ($1) == IDENTIFIER_NODE)
|
||||
cp_error ("`%T' is not a class or namespace", $1);
|
||||
error ("`%T' is not a class or namespace", $1);
|
||||
else if (TREE_CODE ($1) == TYPE_DECL)
|
||||
$$ = TREE_TYPE ($1);
|
||||
}
|
||||
|
@ -3114,7 +3114,7 @@ typename_sub1:
|
|||
if (TYPE_P ($1))
|
||||
$$ = make_typename_type ($1, $2, /*complain=*/1);
|
||||
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
|
||||
cp_error ("`%T' is not a class or namespace", $2);
|
||||
error ("`%T' is not a class or namespace", $2);
|
||||
else
|
||||
{
|
||||
$$ = $2;
|
||||
|
@ -3143,7 +3143,7 @@ typename_sub2:
|
|||
got_scope = complete_type (TREE_TYPE ($$));
|
||||
|
||||
if ($$ == error_mark_node)
|
||||
cp_error ("`%T' is not a class or namespace", $1);
|
||||
error ("`%T' is not a class or namespace", $1);
|
||||
}
|
||||
| SELFNAME SCOPE
|
||||
{
|
||||
|
@ -3770,7 +3770,7 @@ bad_parm:
|
|||
if (TREE_CODE ($$) == SCOPE_REF
|
||||
&& (TREE_CODE (TREE_OPERAND ($$, 0)) == TEMPLATE_TYPE_PARM
|
||||
|| TREE_CODE (TREE_OPERAND ($$, 0)) == BOUND_TEMPLATE_TEMPLATE_PARM))
|
||||
cp_error (" perhaps you want `typename %E' to make it a type", $$);
|
||||
error (" perhaps you want `typename %E' to make it a type", $$);
|
||||
$$ = build_tree_list (integer_type_node, $$);
|
||||
}
|
||||
;
|
||||
|
@ -3778,7 +3778,7 @@ bad_parm:
|
|||
bad_decl:
|
||||
IDENTIFIER template_arg_list_ignore IDENTIFIER arg_list_ignore ';'
|
||||
{
|
||||
cp_error("'%D' is used as a type, but is not defined as a type.", $1);
|
||||
error("'%D' is used as a type, but is not defined as a type.", $1);
|
||||
$3 = error_mark_node;
|
||||
}
|
||||
;
|
||||
|
|
192
gcc/cp/pt.c
192
gcc/cp/pt.c
|
@ -206,7 +206,7 @@ finish_member_template_decl (decl)
|
|||
return NULL_TREE;
|
||||
}
|
||||
else if (TREE_CODE (decl) == FIELD_DECL)
|
||||
cp_error ("data member `%D' cannot be a member template", decl);
|
||||
error ("data member `%D' cannot be a member template", decl);
|
||||
else if (DECL_TEMPLATE_INFO (decl))
|
||||
{
|
||||
if (!DECL_TEMPLATE_SPECIALIZATION (decl))
|
||||
|
@ -218,7 +218,7 @@ finish_member_template_decl (decl)
|
|||
return decl;
|
||||
}
|
||||
else
|
||||
cp_error ("invalid member template declaration `%D'", decl);
|
||||
error ("invalid member template declaration `%D'", decl);
|
||||
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -613,7 +613,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'",
|
||||
error ("explicit specialization in non-namespace scope `%D'",
|
||||
scope);
|
||||
|
||||
/* [temp.expl.spec]
|
||||
|
@ -625,7 +625,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 explicitly specialized");
|
||||
error ("enclosing class templates are not explicitly specialized");
|
||||
}
|
||||
|
||||
/* We've just seen template <>. */
|
||||
|
@ -700,7 +700,7 @@ maybe_process_partial_specialization (type)
|
|||
if (current_namespace
|
||||
!= decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type)))
|
||||
{
|
||||
cp_pedwarn ("specializing `%#T' in different namespace", type);
|
||||
pedwarn ("specializing `%#T' in different namespace", type);
|
||||
cp_pedwarn_at (" from definition of `%#D'",
|
||||
CLASSTYPE_TI_TEMPLATE (type));
|
||||
}
|
||||
|
@ -709,10 +709,10 @@ 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);
|
||||
error ("specialization of `%T' after instantiation", type);
|
||||
}
|
||||
else if (processing_specialization)
|
||||
cp_error ("explicit specialization of non-template `%T'", type);
|
||||
error ("explicit specialization of non-template `%T'", type);
|
||||
}
|
||||
|
||||
/* Retrieve the specialization (in the sense of [temp.spec] - a
|
||||
|
@ -844,7 +844,7 @@ register_specialization (spec, tmpl, args)
|
|||
if (TREE_USED (fn)
|
||||
|| DECL_EXPLICIT_INSTANTIATION (fn))
|
||||
{
|
||||
cp_error ("specialization of %D after instantiation",
|
||||
error ("specialization of %D after instantiation",
|
||||
fn);
|
||||
return spec;
|
||||
}
|
||||
|
@ -998,7 +998,7 @@ determine_specialization (template_id, decl, targs_out,
|
|||
|
||||
if (!is_overloaded_fn (fns))
|
||||
{
|
||||
cp_error ("`%D' is not a function template", fns);
|
||||
error ("`%D' is not a function template", fns);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1356,7 +1356,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",
|
||||
error ("template-id `%D' in declaration of primary template",
|
||||
declarator);
|
||||
return decl;
|
||||
}
|
||||
|
@ -1369,19 +1369,19 @@ check_explicit_specialization (declarator, decl, template_count, flags)
|
|||
return error_mark_node;
|
||||
|
||||
case tsk_invalid_expl_inst:
|
||||
cp_error ("template parameter list used in explicit instantiation");
|
||||
error ("template parameter list used in explicit instantiation");
|
||||
|
||||
/* Fall through. */
|
||||
|
||||
case tsk_expl_inst:
|
||||
if (have_def)
|
||||
cp_error ("definition provided for explicit instantiation");
|
||||
error ("definition provided for explicit instantiation");
|
||||
|
||||
explicit_instantiation = 1;
|
||||
break;
|
||||
|
||||
case tsk_excessive_parms:
|
||||
cp_error ("too many template parameter lists in declaration of `%D'",
|
||||
error ("too many template parameter lists in declaration of `%D'",
|
||||
decl);
|
||||
return error_mark_node;
|
||||
|
||||
|
@ -1397,7 +1397,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
|
|||
case tsk_insufficient_parms:
|
||||
if (template_header_count)
|
||||
{
|
||||
cp_error("too few template parameter lists in declaration of `%D'",
|
||||
error("too few template parameter lists in declaration of `%D'",
|
||||
decl);
|
||||
return decl;
|
||||
}
|
||||
|
@ -1413,7 +1413,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
|
|||
|
||||
That used to be legal C++. */
|
||||
if (pedantic)
|
||||
cp_pedwarn
|
||||
pedwarn
|
||||
("explicit specialization not preceded by `template <>'");
|
||||
specialization = 1;
|
||||
SET_DECL_TEMPLATE_SPECIALIZATION (decl);
|
||||
|
@ -1427,10 +1427,10 @@ check_explicit_specialization (declarator, decl, template_count, flags)
|
|||
template <class T> void f<int>(); */
|
||||
|
||||
if (uses_template_parms (declarator))
|
||||
cp_error ("partial specialization `%D' of function template",
|
||||
error ("partial specialization `%D' of function template",
|
||||
declarator);
|
||||
else
|
||||
cp_error ("template-id `%D' in declaration of primary template",
|
||||
error ("template-id `%D' in declaration of primary template",
|
||||
declarator);
|
||||
return decl;
|
||||
}
|
||||
|
@ -1458,12 +1458,12 @@ check_explicit_specialization (declarator, decl, template_count, flags)
|
|||
for (; t; t = TREE_CHAIN (t))
|
||||
if (TREE_PURPOSE (t))
|
||||
{
|
||||
cp_pedwarn
|
||||
pedwarn
|
||||
("default argument specified in explicit specialization");
|
||||
break;
|
||||
}
|
||||
if (current_lang_name == lang_name_c)
|
||||
cp_error ("template specialization with C linkage");
|
||||
error ("template specialization with C linkage");
|
||||
}
|
||||
|
||||
if (specialization || member_specialization || explicit_instantiation)
|
||||
|
@ -1551,7 +1551,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");
|
||||
error ("specialization of implicitly-declared special member function");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1594,7 +1594,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
|
|||
|
||||
if (fns == NULL_TREE)
|
||||
{
|
||||
cp_error ("no member function `%D' declared in `%T'",
|
||||
error ("no member function `%D' declared in `%T'",
|
||||
name, ctype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -1742,7 +1742,7 @@ 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);
|
||||
error ("too many template parameter lists in declaration of `%T'", type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2241,11 +2241,11 @@ process_partial_specialization (decl)
|
|||
specialization. */
|
||||
if (!did_error_intro)
|
||||
{
|
||||
cp_error ("template parameters not used in partial specialization:");
|
||||
error ("template parameters not used in partial specialization:");
|
||||
did_error_intro = 1;
|
||||
}
|
||||
|
||||
cp_error (" `%D'",
|
||||
error (" `%D'",
|
||||
TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
|
||||
}
|
||||
|
||||
|
@ -2257,7 +2257,7 @@ process_partial_specialization (decl)
|
|||
(inner_args,
|
||||
INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (TREE_TYPE
|
||||
(maintmpl)))))
|
||||
cp_error ("partial specialization `%T' does not specialize any template arguments", type);
|
||||
error ("partial specialization `%T' does not specialize any template arguments", type);
|
||||
|
||||
/* [temp.class.spec]
|
||||
|
||||
|
@ -2282,7 +2282,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);
|
||||
error ("template argument `%E' involves template parameter(s)", arg);
|
||||
else
|
||||
{
|
||||
/* Look at the corresponding template parameter,
|
||||
|
@ -2325,7 +2325,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 parameter(s)",
|
||||
error ("type `%T' of template argument `%E' depends on template parameter(s)",
|
||||
type,
|
||||
arg);
|
||||
break;
|
||||
|
@ -2413,7 +2413,7 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
|
|||
seen_def_arg_p = 1;
|
||||
else if (seen_def_arg_p)
|
||||
{
|
||||
cp_error ("no default argument for `%D'", TREE_VALUE (parm));
|
||||
error ("no default argument for `%D'", TREE_VALUE (parm));
|
||||
/* For better subsequent error-recovery, we indicate that
|
||||
there should have been a default argument. */
|
||||
TREE_PURPOSE (parm) = error_mark_node;
|
||||
|
@ -2477,7 +2477,7 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
|
|||
{
|
||||
if (msg)
|
||||
{
|
||||
cp_error (msg, decl);
|
||||
error (msg, decl);
|
||||
msg = 0;
|
||||
}
|
||||
|
||||
|
@ -2546,17 +2546,17 @@ push_template_decl_real (decl, is_friend)
|
|||
if (primary)
|
||||
{
|
||||
if (current_lang_name == lang_name_c)
|
||||
cp_error ("template with C linkage");
|
||||
error ("template with C linkage");
|
||||
else if (TREE_CODE (decl) == TYPE_DECL
|
||||
&& ANON_AGGRNAME_P (DECL_NAME (decl)))
|
||||
cp_error ("template class without a name");
|
||||
error ("template class without a name");
|
||||
else if ((DECL_IMPLICIT_TYPEDEF_P (decl)
|
||||
&& CLASS_TYPE_P (TREE_TYPE (decl)))
|
||||
|| (TREE_CODE (decl) == VAR_DECL && ctx && CLASS_TYPE_P (ctx))
|
||||
|| TREE_CODE (decl) == FUNCTION_DECL)
|
||||
/* OK */;
|
||||
else
|
||||
cp_error ("template declaration of `%#D'", decl);
|
||||
error ("template declaration of `%#D'", decl);
|
||||
}
|
||||
|
||||
/* Check to see that the rules regarding the use of default
|
||||
|
@ -2624,13 +2624,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);
|
||||
error ("`%D' does not declare a template type", decl);
|
||||
return decl;
|
||||
}
|
||||
}
|
||||
else if (! DECL_TEMPLATE_INFO (decl))
|
||||
{
|
||||
cp_error ("template definition of non-template `%#D'", decl);
|
||||
error ("template definition of non-template `%#D'", decl);
|
||||
return decl;
|
||||
}
|
||||
else
|
||||
|
@ -2671,7 +2671,7 @@ push_template_decl_real (decl, is_friend)
|
|||
i = TMPL_PARMS_DEPTH (parms);
|
||||
if (TMPL_ARGS_DEPTH (args) != i)
|
||||
{
|
||||
cp_error ("expected %d levels of template parms for `%#D', got %d",
|
||||
error ("expected %d levels of template parms for `%#D', got %d",
|
||||
i, decl, TMPL_ARGS_DEPTH (args));
|
||||
}
|
||||
else
|
||||
|
@ -2683,12 +2683,12 @@ push_template_decl_real (decl, is_friend)
|
|||
if (TREE_VEC_LENGTH (t) != TREE_VEC_LENGTH (a))
|
||||
{
|
||||
if (current == decl)
|
||||
cp_error ("got %d template parameters for `%#D'",
|
||||
error ("got %d template parameters for `%#D'",
|
||||
TREE_VEC_LENGTH (a), decl);
|
||||
else
|
||||
cp_error ("got %d template parameters for `%#T'",
|
||||
error ("got %d template parameters for `%#T'",
|
||||
TREE_VEC_LENGTH (a), current);
|
||||
cp_error (" but %d required", TREE_VEC_LENGTH (t));
|
||||
error (" but %d required", TREE_VEC_LENGTH (t));
|
||||
}
|
||||
|
||||
/* Perhaps we should also check that the parms are used in the
|
||||
|
@ -2756,7 +2756,7 @@ redeclare_class_template (type, parms)
|
|||
|
||||
if (!TYPE_TEMPLATE_INFO (type))
|
||||
{
|
||||
cp_error ("`%T' is not a template type", type);
|
||||
error ("`%T' is not a template type", type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2773,7 +2773,7 @@ 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",
|
||||
error ("used %d template parameter%s instead of %d",
|
||||
TREE_VEC_LENGTH (tmpl_parms),
|
||||
TREE_VEC_LENGTH (tmpl_parms) == 1 ? "" : "s",
|
||||
TREE_VEC_LENGTH (parms));
|
||||
|
@ -2790,7 +2790,7 @@ 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);
|
||||
error ("redeclared here as `%#D'", parm);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2800,7 +2800,7 @@ 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);
|
||||
error ("redefinition of default argument for `%#D'", parm);
|
||||
cp_error_at (" original definition appeared here", tmpl_parm);
|
||||
return;
|
||||
}
|
||||
|
@ -2894,17 +2894,17 @@ convert_nontype_argument (type, expr)
|
|||
if (TREE_CODE (e) != ADDR_EXPR)
|
||||
{
|
||||
bad_argument:
|
||||
cp_error ("`%E' is not a valid template argument", expr);
|
||||
error ("`%E' is not a valid template argument", expr);
|
||||
if (TYPE_PTR_P (expr_type))
|
||||
{
|
||||
if (TREE_CODE (TREE_TYPE (expr_type)) == FUNCTION_TYPE)
|
||||
cp_error ("it must be the address of a function with external linkage");
|
||||
error ("it must be the address of a function with external linkage");
|
||||
else
|
||||
cp_error ("it must be the address of an object with external linkage");
|
||||
error ("it must be the address of an object with external linkage");
|
||||
}
|
||||
else if (TYPE_PTRMEM_P (expr_type)
|
||||
|| TYPE_PTRMEMFUNC_P (expr_type))
|
||||
cp_error ("it must be a pointer-to-member of the form `&X::Y'");
|
||||
error ("it must be a pointer-to-member of the form `&X::Y'");
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -2915,7 +2915,7 @@ convert_nontype_argument (type, expr)
|
|||
|
||||
if (TREE_CODE (referent) == STRING_CST)
|
||||
{
|
||||
cp_error ("string literal %E is not a valid template argument because it is the address of an object with static linkage",
|
||||
error ("string literal %E is not a valid template argument because it is the address of an object with static linkage",
|
||||
referent);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -2927,7 +2927,7 @@ convert_nontype_argument (type, expr)
|
|||
goto bad_argument;
|
||||
else if (!DECL_EXTERNAL_LINKAGE_P (referent))
|
||||
{
|
||||
cp_error ("address of non-extern `%E' cannot be used as template argument", referent);
|
||||
error ("address of non-extern `%E' cannot be used as template argument", referent);
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
|
@ -2938,14 +2938,14 @@ convert_nontype_argument (type, expr)
|
|||
if (! TREE_CONSTANT (expr))
|
||||
{
|
||||
non_constant:
|
||||
cp_error ("non-constant `%E' cannot be used as template argument",
|
||||
error ("non-constant `%E' cannot be used as template argument",
|
||||
expr);
|
||||
return NULL_TREE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cp_error ("object `%E' cannot be used as template argument", expr);
|
||||
error ("object `%E' cannot be used as template argument", expr);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
@ -3321,7 +3321,7 @@ 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, use `typename %E'", arg);
|
||||
pedwarn ("to refer to a type member of a template parameter, use `typename %E'", arg);
|
||||
|
||||
arg = make_typename_type (TREE_OPERAND (arg, 0),
|
||||
TREE_OPERAND (arg, 1),
|
||||
|
@ -3334,14 +3334,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'",
|
||||
error ("type/value mismatch at argument %d in template parameter list for `%D'",
|
||||
i + 1, in_decl);
|
||||
if (is_type)
|
||||
cp_error (" expected a constant of type `%T', got `%T'",
|
||||
error (" expected a constant of type `%T', got `%T'",
|
||||
TREE_TYPE (parm),
|
||||
(is_tmpl_type ? DECL_NAME (arg) : arg));
|
||||
else
|
||||
cp_error (" expected a type, got `%E'", arg);
|
||||
error (" expected a type, got `%E'", arg);
|
||||
}
|
||||
}
|
||||
return error_mark_node;
|
||||
|
@ -3350,12 +3350,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'",
|
||||
error ("type/value mismatch at argument %d in template parameter list for `%D'",
|
||||
i + 1, in_decl);
|
||||
if (is_tmpl_type)
|
||||
cp_error (" expected a type, got `%T'", DECL_NAME (arg));
|
||||
error (" expected a type, got `%T'", DECL_NAME (arg));
|
||||
else
|
||||
cp_error (" expected a class template, got `%T'", arg);
|
||||
error (" expected a class template, got `%T'", arg);
|
||||
}
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -3389,9 +3389,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'",
|
||||
error ("type/value mismatch at argument %d in template parameter list for `%D'",
|
||||
i + 1, in_decl);
|
||||
cp_error (" expected a template of type `%D', got `%D'", parm, arg);
|
||||
error (" expected a template of type `%D', got `%D'", parm, arg);
|
||||
}
|
||||
|
||||
val = error_mark_node;
|
||||
|
@ -3412,10 +3412,10 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
|
|||
if (t)
|
||||
{
|
||||
if (TYPE_ANONYMOUS_P (t))
|
||||
cp_pedwarn
|
||||
pedwarn
|
||||
("template-argument `%T' uses anonymous type", val);
|
||||
else
|
||||
cp_error
|
||||
error
|
||||
("template-argument `%T' uses local type `%T'",
|
||||
val, t);
|
||||
return error_mark_node;
|
||||
|
@ -3451,7 +3451,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'",
|
||||
error ("could not convert template argument `%E' to `%T'",
|
||||
arg, t);
|
||||
}
|
||||
|
||||
|
@ -3495,7 +3495,7 @@ coerce_template_parms (parms, args, in_decl,
|
|||
{
|
||||
if (complain)
|
||||
{
|
||||
cp_error ("wrong number of template arguments (%d, should be %d)",
|
||||
error ("wrong number of template arguments (%d, should be %d)",
|
||||
nargs, nparms);
|
||||
|
||||
if (in_decl)
|
||||
|
@ -3546,7 +3546,7 @@ coerce_template_parms (parms, args, in_decl,
|
|||
}
|
||||
else if (arg == error_mark_node)
|
||||
{
|
||||
cp_error ("template argument %d is invalid", i + 1);
|
||||
error ("template argument %d is invalid", i + 1);
|
||||
arg = error_mark_node;
|
||||
}
|
||||
else
|
||||
|
@ -3778,7 +3778,7 @@ lookup_template_function (fns, arglist)
|
|||
|
||||
if (fns == NULL_TREE)
|
||||
{
|
||||
cp_error ("non-template used as template");
|
||||
error ("non-template used as template");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -3896,7 +3896,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
|
|||
if (! template)
|
||||
{
|
||||
if (complain)
|
||||
cp_error ("`%T' is not a template", d1);
|
||||
error ("`%T' is not a template", d1);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -3909,7 +3909,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
|
|||
{
|
||||
if (complain)
|
||||
{
|
||||
cp_error ("non-template type `%T' used as a template", d1);
|
||||
error ("non-template type `%T' used as a template", d1);
|
||||
if (in_decl)
|
||||
cp_error_at ("for template declaration `%D'", in_decl);
|
||||
}
|
||||
|
@ -4474,7 +4474,7 @@ push_tinst_level (d)
|
|||
return 0;
|
||||
|
||||
last_template_error_tick = tinst_level_tick;
|
||||
cp_error ("template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN to increase the maximum) instantiating `%D'",
|
||||
error ("template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN to increase the maximum) instantiating `%D'",
|
||||
max_tinst_depth, d);
|
||||
|
||||
print_instantiation_context ();
|
||||
|
@ -4909,7 +4909,7 @@ instantiate_class_template (type)
|
|||
if (t == error_mark_node)
|
||||
{
|
||||
const char *str = "candidates are:";
|
||||
cp_error ("ambiguous class template instantiation for `%#T'", type);
|
||||
error ("ambiguous class template instantiation for `%#T'", type);
|
||||
for (t = DECL_TEMPLATE_SPECIALIZATIONS (template); t;
|
||||
t = TREE_CHAIN (t))
|
||||
{
|
||||
|
@ -6094,7 +6094,7 @@ tsubst_arg_types (arg_types, args, complain, in_decl)
|
|||
{
|
||||
if (complain)
|
||||
{
|
||||
cp_error ("invalid parameter type `%T'", type);
|
||||
error ("invalid parameter type `%T'", type);
|
||||
if (in_decl)
|
||||
cp_error_at ("in declaration `%D'", in_decl);
|
||||
}
|
||||
|
@ -6171,7 +6171,7 @@ tsubst_function_type (t, args, complain, in_decl)
|
|||
-- Attempting to create "pointer to member of T" when T
|
||||
is not a class type. */
|
||||
if (complain)
|
||||
cp_error ("creating pointer to member function of non-class type `%T'",
|
||||
error ("creating pointer to member function of non-class type `%T'",
|
||||
r);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -6348,7 +6348,7 @@ tsubst (t, args, complain, in_decl)
|
|||
Attempting to create an array with a size that is
|
||||
zero or negative. */
|
||||
if (complain)
|
||||
cp_error ("creating array with size zero (`%E')", max);
|
||||
error ("creating array with size zero (`%E')", max);
|
||||
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -6586,9 +6586,9 @@ tsubst (t, args, complain, in_decl)
|
|||
last_file != input_filename))
|
||||
{
|
||||
if (TREE_CODE (type) == VOID_TYPE)
|
||||
cp_error ("forming reference to void");
|
||||
error ("forming reference to void");
|
||||
else
|
||||
cp_error ("forming %s to reference type `%T'",
|
||||
error ("forming %s to reference type `%T'",
|
||||
(code == POINTER_TYPE) ? "pointer" : "reference",
|
||||
type);
|
||||
last_line = lineno;
|
||||
|
@ -6622,7 +6622,7 @@ tsubst (t, args, complain, in_decl)
|
|||
-- Attempting to create "pointer to member of T" when T
|
||||
is not a class type. */
|
||||
if (complain)
|
||||
cp_error ("creating pointer to member of non-class type `%T'",
|
||||
error ("creating pointer to member of non-class type `%T'",
|
||||
r);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -6684,7 +6684,7 @@ tsubst (t, args, complain, in_decl)
|
|||
|| TREE_CODE (type) == REFERENCE_TYPE)
|
||||
{
|
||||
if (complain)
|
||||
cp_error ("creating array of `%T'", type);
|
||||
error ("creating array of `%T'", type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -6730,7 +6730,7 @@ tsubst (t, args, complain, in_decl)
|
|||
if (!IS_AGGR_TYPE (ctx))
|
||||
{
|
||||
if (complain)
|
||||
cp_error ("`%T' is not a class, struct, or union type",
|
||||
error ("`%T' is not a class, struct, or union type",
|
||||
ctx);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -7624,8 +7624,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);
|
||||
error ("type `%T' composed from a local class is not a valid template-argument", t);
|
||||
error (" trying to instantiate `%D'", gen_tmpl);
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
|
@ -9432,7 +9432,7 @@ do_decl_instantiation (declspecs, declarator, storage)
|
|||
return;
|
||||
else if (! DECL_LANG_SPECIFIC (decl))
|
||||
{
|
||||
cp_error ("explicit instantiation of non-template `%#D'", decl);
|
||||
error ("explicit instantiation of non-template `%#D'", decl);
|
||||
return;
|
||||
}
|
||||
else if (TREE_CODE (decl) == VAR_DECL)
|
||||
|
@ -9448,13 +9448,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);
|
||||
error ("no matching template for `%D' found", result);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (decl) != FUNCTION_DECL)
|
||||
{
|
||||
cp_error ("explicit instantiation of `%#D'", decl);
|
||||
error ("explicit instantiation of `%#D'", decl);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -9471,7 +9471,7 @@ do_decl_instantiation (declspecs, declarator, storage)
|
|||
|
||||
No program shall both explicitly instantiate and explicitly
|
||||
specialize a template. */
|
||||
cp_pedwarn ("explicit instantiation of `%#D' after", result);
|
||||
pedwarn ("explicit instantiation of `%#D' after", result);
|
||||
cp_pedwarn_at ("explicit specialization here", result);
|
||||
return;
|
||||
}
|
||||
|
@ -9487,7 +9487,7 @@ do_decl_instantiation (declspecs, declarator, storage)
|
|||
the opposite case. If -frepo, chances are we already got marked
|
||||
as an explicit instantiation because of the repo file. */
|
||||
if (DECL_INTERFACE_KNOWN (result) && !extern_p && !flag_use_repository)
|
||||
cp_pedwarn ("duplicate explicit instantiation of `%#D'", result);
|
||||
pedwarn ("duplicate explicit instantiation of `%#D'", result);
|
||||
|
||||
/* If we've already instantiated the template, just return now. */
|
||||
if (DECL_INTERFACE_KNOWN (result))
|
||||
|
@ -9495,12 +9495,12 @@ do_decl_instantiation (declspecs, declarator, storage)
|
|||
}
|
||||
else if (!DECL_IMPLICIT_INSTANTIATION (result))
|
||||
{
|
||||
cp_error ("no matching template for `%D' found", result);
|
||||
error ("no matching template for `%D' found", result);
|
||||
return;
|
||||
}
|
||||
else if (!DECL_TEMPLATE_INFO (result))
|
||||
{
|
||||
cp_pedwarn ("explicit instantiation of non-template `%#D'", result);
|
||||
pedwarn ("explicit instantiation of non-template `%#D'", result);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -9512,11 +9512,11 @@ do_decl_instantiation (declspecs, declarator, storage)
|
|||
else if (storage == ridpointers[(int) RID_EXTERN])
|
||||
{
|
||||
if (pedantic)
|
||||
cp_pedwarn ("ISO C++ forbids the use of `extern' on explicit instantiations");
|
||||
pedwarn ("ISO C++ forbids the use of `extern' on explicit instantiations");
|
||||
extern_p = 1;
|
||||
}
|
||||
else
|
||||
cp_error ("storage class `%D' applied to template instantiation",
|
||||
error ("storage class `%D' applied to template instantiation",
|
||||
storage);
|
||||
|
||||
SET_DECL_EXPLICIT_INSTANTIATION (result);
|
||||
|
@ -9561,7 +9561,7 @@ do_type_instantiation (t, storage, complain)
|
|||
|
||||
if (! CLASS_TYPE_P (t) || ! CLASSTYPE_TEMPLATE_INFO (t))
|
||||
{
|
||||
cp_error ("explicit instantiation of non-template type `%T'", t);
|
||||
error ("explicit instantiation of non-template type `%T'", t);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -9575,7 +9575,7 @@ do_type_instantiation (t, storage, complain)
|
|||
if (!COMPLETE_TYPE_P (t))
|
||||
{
|
||||
if (complain)
|
||||
cp_error ("explicit instantiation of `%#T' before definition of template",
|
||||
error ("explicit instantiation of `%#T' before definition of template",
|
||||
t);
|
||||
return;
|
||||
}
|
||||
|
@ -9583,7 +9583,7 @@ do_type_instantiation (t, storage, complain)
|
|||
if (storage != NULL_TREE)
|
||||
{
|
||||
if (pedantic)
|
||||
cp_pedwarn("ISO C++ forbids the use of `%s' on explicit instantiations",
|
||||
pedwarn("ISO C++ forbids the use of `%s' on explicit instantiations",
|
||||
IDENTIFIER_POINTER (storage));
|
||||
|
||||
if (storage == ridpointers[(int) RID_INLINE])
|
||||
|
@ -9594,7 +9594,7 @@ do_type_instantiation (t, storage, complain)
|
|||
static_p = 1;
|
||||
else
|
||||
{
|
||||
cp_error ("storage class `%D' applied to template instantiation",
|
||||
error ("storage class `%D' applied to template instantiation",
|
||||
storage);
|
||||
extern_p = 0;
|
||||
}
|
||||
|
@ -9608,7 +9608,7 @@ do_type_instantiation (t, storage, complain)
|
|||
specialize a template. */
|
||||
if (complain)
|
||||
{
|
||||
cp_error ("explicit instantiation of `%#T' after", t);
|
||||
error ("explicit instantiation of `%#T' after", t);
|
||||
cp_error_at ("explicit specialization here", t);
|
||||
}
|
||||
return;
|
||||
|
@ -9626,7 +9626,7 @@ do_type_instantiation (t, storage, complain)
|
|||
repo file. All these cases are OK. */
|
||||
if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p && !flag_use_repository
|
||||
&& complain)
|
||||
cp_pedwarn ("duplicate explicit instantiation of `%#T'", t);
|
||||
pedwarn ("duplicate explicit instantiation of `%#T'", t);
|
||||
|
||||
/* If we've already instantiated the template, just return now. */
|
||||
if (!CLASSTYPE_INTERFACE_ONLY (t))
|
||||
|
@ -9966,7 +9966,7 @@ instantiate_decl (d, defer_ok)
|
|||
member function or static data member of a class template
|
||||
shall be present in every translation unit in which it is
|
||||
explicitly instantiated. */
|
||||
cp_pedwarn
|
||||
pedwarn
|
||||
("explicit instantiation of `%D' but no definition available", d);
|
||||
|
||||
add_pending_template (d);
|
||||
|
@ -10339,7 +10339,7 @@ invalid_nontype_parm_type_p (type, complain)
|
|||
return 0;
|
||||
|
||||
if (complain)
|
||||
cp_error ("`%#T' is not a valid type for a template constant parameter",
|
||||
error ("`%#T' is not a valid type for a template constant parameter",
|
||||
type);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ get_tinfo_decl (type)
|
|||
if (COMPLETE_TYPE_P (type)
|
||||
&& TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
|
||||
{
|
||||
cp_error ("cannot create type information for type `%T' because its size is variable",
|
||||
error ("cannot create type information for type `%T' because its size is variable",
|
||||
type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -522,7 +522,7 @@ build_dynamic_cast_1 (type, expr)
|
|||
&& TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE)
|
||||
{
|
||||
tree expr = throw_bad_cast ();
|
||||
cp_warning ("dynamic_cast of `%#D' to `%#T' can never succeed",
|
||||
warning ("dynamic_cast of `%#D' to `%#T' can never succeed",
|
||||
old_expr, type);
|
||||
/* Bash it to the expected type. */
|
||||
TREE_TYPE (expr) = type;
|
||||
|
@ -536,7 +536,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",
|
||||
warning ("dynamic_cast of `%#D' to `%#T' can never succeed",
|
||||
op, type);
|
||||
retval = build_int_2 (0, 0);
|
||||
TREE_TYPE (retval) = type;
|
||||
|
@ -611,7 +611,7 @@ build_dynamic_cast_1 (type, expr)
|
|||
errstr = "source type is not polymorphic";
|
||||
|
||||
fail:
|
||||
cp_error ("cannot dynamic_cast `%E' (of type `%#T') to type `%#T' (%s)",
|
||||
error ("cannot dynamic_cast `%E' (of type `%#T') to type `%#T' (%s)",
|
||||
expr, exprtype, type, errstr);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
|
|
@ -337,7 +337,7 @@ lookup_base (t, base, access, kind_ptr)
|
|||
binfo = NULL_TREE;
|
||||
if (!(access & ba_quiet))
|
||||
{
|
||||
cp_error ("`%T' is an inaccessible base of `%T'", base, t);
|
||||
error ("`%T' is an inaccessible base of `%T'", base, t);
|
||||
binfo = error_mark_node;
|
||||
}
|
||||
break;
|
||||
|
@ -347,7 +347,7 @@ lookup_base (t, base, access, kind_ptr)
|
|||
binfo = NULL_TREE;
|
||||
if (!(access & ba_quiet))
|
||||
{
|
||||
cp_error ("`%T' is an ambiguous base of `%T'", base, t);
|
||||
error ("`%T' is an ambiguous base of `%T'", base, t);
|
||||
binfo = error_mark_node;
|
||||
}
|
||||
}
|
||||
|
@ -1456,7 +1456,7 @@ lookup_member (xbasetype, name, protect, want_type)
|
|||
|
||||
if (errstr && protect)
|
||||
{
|
||||
cp_error (errstr, name, type);
|
||||
error (errstr, name, type);
|
||||
if (lfi.ambiguous)
|
||||
print_candidates (lfi.ambiguous);
|
||||
rval = error_mark_node;
|
||||
|
@ -2127,7 +2127,7 @@ get_pure_virtuals (type)
|
|||
{
|
||||
tree base_fndecl = BV_FN (virtuals);
|
||||
if (DECL_NEEDS_FINAL_OVERRIDER_P (base_fndecl))
|
||||
cp_error ("`%#D' needs a final overrider", base_fndecl);
|
||||
error ("`%#D' needs a final overrider", base_fndecl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -878,7 +878,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",
|
||||
warning ("%s qualifier ignored on asm",
|
||||
IDENTIFIER_POINTER (cv_qualifier));
|
||||
cv_qualifier = NULL_TREE;
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
|
|||
resolve the overloading. */
|
||||
if (TREE_TYPE (converted_operand) == unknown_type_node)
|
||||
{
|
||||
cp_error ("type of asm operand `%E' could not be determined",
|
||||
error ("type of asm operand `%E' could not be determined",
|
||||
TREE_VALUE (t));
|
||||
converted_operand = error_mark_node;
|
||||
}
|
||||
|
@ -1051,7 +1051,7 @@ finish_named_return_value (return_id, init)
|
|||
DECL_NAME (decl) = return_id;
|
||||
else
|
||||
{
|
||||
cp_error ("return identifier `%D' already in place", return_id);
|
||||
error ("return identifier `%D' already in place", return_id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1126,7 +1126,7 @@ finish_mem_initializers (init_list)
|
|||
base != last_base_warned_about;
|
||||
base = TREE_CHAIN (base))
|
||||
{
|
||||
cp_warning ("base initializer for `%T'",
|
||||
warning ("base initializer for `%T'",
|
||||
TREE_PURPOSE (base));
|
||||
warning (" will be re-ordered to precede member initializations");
|
||||
}
|
||||
|
@ -1444,7 +1444,7 @@ finish_object_call_expr (fn, object, args)
|
|||
fn = DECL_NAME (fn);
|
||||
else
|
||||
{
|
||||
cp_error ("calling type `%T' like a method", fn);
|
||||
error ("calling type `%T' like a method", fn);
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
|
@ -1480,13 +1480,13 @@ finish_pseudo_destructor_call_expr (object, scope, destructor)
|
|||
return build_min_nt (PSEUDO_DTOR_EXPR, object, scope, destructor);
|
||||
|
||||
if (scope && scope != destructor)
|
||||
cp_error ("destructor specifier `%T::~%T()' must have matching names",
|
||||
error ("destructor specifier `%T::~%T()' 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);
|
||||
error ("`%E' is not of type `%T'", object, destructor);
|
||||
|
||||
return cp_convert (void_type_node, object);
|
||||
}
|
||||
|
@ -1757,7 +1757,7 @@ begin_class_definition (t)
|
|||
|
||||
if (processing_template_parmlist)
|
||||
{
|
||||
cp_error ("definition of `%#T' inside template parameter list", t);
|
||||
error ("definition of `%#T' inside template parameter list", t);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1773,7 +1773,7 @@ begin_class_definition (t)
|
|||
This is erroneous. */
|
||||
else if (TREE_CODE (t) == TYPENAME_TYPE)
|
||||
{
|
||||
cp_error ("invalid definition of qualified type `%T'", t);
|
||||
error ("invalid definition of qualified type `%T'", t);
|
||||
t = error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -2125,7 +2125,7 @@ finish_base_specifier (access_specifier, base_class)
|
|||
{
|
||||
if (cp_type_quals (base_class) != 0)
|
||||
{
|
||||
cp_error ("base class `%T' has cv qualifiers", base_class);
|
||||
error ("base class `%T' has cv qualifiers", base_class);
|
||||
base_class = TYPE_MAIN_VARIANT (base_class);
|
||||
}
|
||||
result = build_tree_list (access_specifier, base_class);
|
||||
|
@ -2158,7 +2158,7 @@ check_multiple_declarators ()
|
|||
if (PROCESSING_REAL_TEMPLATE_DECL_P ()
|
||||
|| processing_explicit_instantiation
|
||||
|| processing_specialization)
|
||||
cp_error ("multiple declarators in template declaration");
|
||||
error ("multiple declarators in template declaration");
|
||||
}
|
||||
|
||||
/* Implement the __typeof keyword: Return the type of EXPR, suitable for
|
||||
|
|
|
@ -1432,7 +1432,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'",
|
||||
pedwarn ("invalid type `%T' for default argument to `%T'",
|
||||
TREE_TYPE (init), TREE_VALUE (arg));
|
||||
if (!defarg_depfns)
|
||||
TREE_PURPOSE (arg) = init;
|
||||
|
|
|
@ -533,7 +533,7 @@ cp_build_qualified_type_real (type, type_quals, complain)
|
|||
|| TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE))
|
||||
{
|
||||
if (complain)
|
||||
cp_error ("`%T' cannot be `restrict'-qualified", type);
|
||||
error ("`%T' cannot be `restrict'-qualified", type);
|
||||
else
|
||||
return error_mark_node;
|
||||
|
||||
|
@ -544,7 +544,7 @@ cp_build_qualified_type_real (type, type_quals, complain)
|
|||
&& TREE_CODE (type) == FUNCTION_TYPE)
|
||||
{
|
||||
if (complain)
|
||||
cp_error ("`%T' cannot be `const'-, `volatile'-, or `restrict'-qualified", type);
|
||||
error ("`%T' cannot be `const'-, `volatile'-, or `restrict'-qualified", type);
|
||||
else
|
||||
return error_mark_node;
|
||||
type_quals = TYPE_UNQUALIFIED;
|
||||
|
|
138
gcc/cp/typeck.c
138
gcc/cp/typeck.c
|
@ -506,7 +506,7 @@ composite_pointer_type (t1, t2, arg1, arg2, location)
|
|||
result_type = full2;
|
||||
else
|
||||
{
|
||||
cp_pedwarn ("%s between distinct pointer types `%T' and `%T' lacks a cast",
|
||||
pedwarn ("%s between distinct pointer types `%T' and `%T' lacks a cast",
|
||||
location, t1, t2);
|
||||
result_type = ptr_type_node;
|
||||
}
|
||||
|
@ -1490,7 +1490,7 @@ comp_target_parms (parms1, parms2)
|
|||
|
||||
if (t1 == 0 && t2 != 0)
|
||||
{
|
||||
cp_pedwarn ("ISO C++ prohibits conversion from `%#T' to `(...)'",
|
||||
pedwarn ("ISO C++ prohibits conversion from `%#T' to `(...)'",
|
||||
parms2);
|
||||
return self_promoting_args_p (t2);
|
||||
}
|
||||
|
@ -1586,12 +1586,12 @@ c_sizeof (type)
|
|||
|
||||
if (code == OFFSET_TYPE)
|
||||
{
|
||||
cp_error ("`sizeof' applied to non-static member");
|
||||
error ("`sizeof' applied to non-static member");
|
||||
size = size_zero_node;
|
||||
}
|
||||
else if (!COMPLETE_TYPE_P (complete_type (type)))
|
||||
{
|
||||
cp_error ("`sizeof' applied to incomplete type `%T'", type);
|
||||
error ("`sizeof' applied to incomplete type `%T'", type);
|
||||
size = size_zero_node;
|
||||
}
|
||||
else
|
||||
|
@ -1877,7 +1877,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 `%T'", totype);
|
||||
warning ("deprecated conversion from string constant to `%T'", totype);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1895,7 +1895,7 @@ 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'",
|
||||
error ("request for member `%T::%D' in expression of non-aggregate type `%T'",
|
||||
basetype, field, dtype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -2038,7 +2038,7 @@ build_component_ref (datum, component, basetype_path, protect)
|
|||
basetype_path, protect));
|
||||
|
||||
case TEMPLATE_DECL:
|
||||
cp_error ("invalid use of %D", datum);
|
||||
error ("invalid use of %D", datum);
|
||||
datum = error_mark_node;
|
||||
break;
|
||||
|
||||
|
@ -2076,7 +2076,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'",
|
||||
error ("request for member `%D' in `%E', which is of non-aggregate type `%T'",
|
||||
component, datum, basetype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -2088,13 +2088,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",
|
||||
error ("destructor specifier `%T::~%T' 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);
|
||||
error ("type `%T' has no destructor", basetype);
|
||||
return error_mark_node;
|
||||
}
|
||||
return TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (basetype), 1);
|
||||
|
@ -2111,12 +2111,12 @@ build_component_ref (datum, component, basetype_path, protect)
|
|||
field = component;
|
||||
else if (TREE_CODE (component) == TYPE_DECL)
|
||||
{
|
||||
cp_error ("invalid use of type decl `%#D' as expression", component);
|
||||
error ("invalid use of type decl `%#D' as expression", component);
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (TREE_CODE (component) == TEMPLATE_DECL)
|
||||
{
|
||||
cp_error ("invalid use of template `%#D' as expression", component);
|
||||
error ("invalid use of template `%#D' as expression", component);
|
||||
return error_mark_node;
|
||||
}
|
||||
else
|
||||
|
@ -2175,7 +2175,7 @@ build_component_ref (datum, component, basetype_path, protect)
|
|||
return ref;
|
||||
}
|
||||
|
||||
cp_error ("`%#T' has no member named `%D'", basetype, name);
|
||||
error ("`%#T' has no member named `%D'", basetype, name);
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (TREE_TYPE (field) == error_mark_node)
|
||||
|
@ -2184,7 +2184,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);
|
||||
pedwarn ("invalid use of type decl `%#D' as expression", field);
|
||||
else if (DECL_RTL (field) != 0)
|
||||
mark_used (field);
|
||||
else
|
||||
|
@ -2342,7 +2342,7 @@ build_indirect_ref (ptr, errorstring)
|
|||
{
|
||||
/* A pointer to incomplete type (other than cv void) can be
|
||||
dereferenced [expr.unary.op]/1 */
|
||||
cp_error ("`%T' is not a pointer-to-object type", type);
|
||||
error ("`%T' is not a pointer-to-object type", type);
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (TREE_CODE (pointer) == ADDR_EXPR
|
||||
|
@ -2688,7 +2688,7 @@ build_x_function_call (function, params, decl)
|
|||
{
|
||||
if (current_class_type == NULL_TREE)
|
||||
{
|
||||
cp_error ("object missing in call to method `%D'", function);
|
||||
error ("object missing in call to method `%D'", function);
|
||||
return error_mark_node;
|
||||
}
|
||||
/* Yow: call from a static member function. */
|
||||
|
@ -2722,7 +2722,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?!?",
|
||||
error ("function `%D' declared overloaded, but no definitions appear with which to resolve it?!?",
|
||||
TREE_PURPOSE (function));
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -2946,7 +2946,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);
|
||||
error ("object missing in `%E'", function);
|
||||
|
||||
function = e1;
|
||||
}
|
||||
|
@ -3010,7 +3010,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 (...)'",
|
||||
error ("must use .* or ->* to call pointer-to-member function in `%E (...)'",
|
||||
function);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -3023,7 +3023,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);
|
||||
error ("`%E' cannot be used as a function", function);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -3384,7 +3384,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
|||
tree t = instantiate_type (TREE_TYPE (op1), op0, itf_none);
|
||||
if (t != error_mark_node)
|
||||
{
|
||||
cp_pedwarn ("assuming cast to type `%T' from overloaded function",
|
||||
pedwarn ("assuming cast to type `%T' from overloaded function",
|
||||
TREE_TYPE (t));
|
||||
op0 = t;
|
||||
}
|
||||
|
@ -3394,7 +3394,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
|||
tree t = instantiate_type (TREE_TYPE (op0), op1, itf_none);
|
||||
if (t != error_mark_node)
|
||||
{
|
||||
cp_pedwarn ("assuming cast to type `%T' from overloaded function",
|
||||
pedwarn ("assuming cast to type `%T' from overloaded function",
|
||||
TREE_TYPE (t));
|
||||
op1 = t;
|
||||
}
|
||||
|
@ -3454,9 +3454,9 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
|||
|| code1 == COMPLEX_TYPE))
|
||||
{
|
||||
if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1))
|
||||
cp_warning ("division by zero in `%E / 0'", op0);
|
||||
warning ("division by zero in `%E / 0'", op0);
|
||||
else if (TREE_CODE (op1) == REAL_CST && real_zerop (op1))
|
||||
cp_warning ("division by zero in `%E / 0.'", op0);
|
||||
warning ("division by zero in `%E / 0.'", op0);
|
||||
|
||||
if (!(code0 == INTEGER_TYPE && code1 == INTEGER_TYPE))
|
||||
resultcode = RDIV_EXPR;
|
||||
|
@ -3511,9 +3511,9 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
|||
case TRUNC_MOD_EXPR:
|
||||
case FLOOR_MOD_EXPR:
|
||||
if (code1 == INTEGER_TYPE && integer_zerop (op1))
|
||||
cp_warning ("division by zero in `%E %% 0'", op0);
|
||||
warning ("division by zero in `%E %% 0'", op0);
|
||||
else if (code1 == REAL_TYPE && real_zerop (op1))
|
||||
cp_warning ("division by zero in `%E %% 0.'", op0);
|
||||
warning ("division by zero in `%E %% 0.'", op0);
|
||||
|
||||
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
|
||||
{
|
||||
|
@ -3908,7 +3908,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
|||
&& TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0))
|
||||
!= TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1)))
|
||||
{
|
||||
cp_warning ("comparison between types `%#T' and `%#T'",
|
||||
warning ("comparison between types `%#T' and `%#T'",
|
||||
TREE_TYPE (orig_op0), TREE_TYPE (orig_op1));
|
||||
}
|
||||
|
||||
|
@ -4009,7 +4009,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
|||
|
||||
if (!result_type)
|
||||
{
|
||||
cp_error ("invalid operands of types `%T' and `%T' to binary `%O'",
|
||||
error ("invalid operands of types `%T' and `%T' to binary `%O'",
|
||||
TREE_TYPE (orig_op0), TREE_TYPE (orig_op1), code);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -4031,7 +4031,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
|||
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");
|
||||
warning ("NULL used in arithmetic");
|
||||
|
||||
if (! converted)
|
||||
{
|
||||
|
@ -4227,7 +4227,7 @@ build_component_addr (arg, argtype)
|
|||
|
||||
if (DECL_C_BIT_FIELD (field))
|
||||
{
|
||||
cp_error ("attempt to take address of bit-field structure member `%D'",
|
||||
error ("attempt to take address of bit-field structure member `%D'",
|
||||
field);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -4512,14 +4512,14 @@ build_unary_op (code, xarg, noconvert)
|
|||
tree type = complete_type (TREE_TYPE (argtype));
|
||||
|
||||
if (!COMPLETE_OR_VOID_TYPE_P (type))
|
||||
cp_error ("cannot %s a pointer to incomplete type `%T'",
|
||||
error ("cannot %s a pointer to incomplete type `%T'",
|
||||
((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 ("ISO C++ forbids %sing a pointer of type `%T'",
|
||||
pedwarn ("ISO C++ forbids %sing a pointer of type `%T'",
|
||||
((code == PREINCREMENT_EXPR
|
||||
|| code == POSTINCREMENT_EXPR)
|
||||
? "increment" : "decrement"), argtype);
|
||||
|
@ -4578,7 +4578,7 @@ build_unary_op (code, xarg, noconvert)
|
|||
{
|
||||
if (code == POSTDECREMENT_EXPR || code == PREDECREMENT_EXPR)
|
||||
{
|
||||
cp_error ("invalid use of `--' on bool variable `%D'", arg);
|
||||
error ("invalid use of `--' on bool variable `%D'", arg);
|
||||
return error_mark_node;
|
||||
}
|
||||
#if 0
|
||||
|
@ -4678,9 +4678,9 @@ build_unary_op (code, xarg, noconvert)
|
|||
if (current_class_type
|
||||
&& TREE_OPERAND (arg, 0) == current_class_ref)
|
||||
/* An expression like &memfn. */
|
||||
cp_pedwarn ("ISO C++ forbids taking the address of an unqualified non-static member function to form a pointer to member function. Say `&%T::%D'", base, name);
|
||||
pedwarn ("ISO C++ forbids taking the address of an unqualified non-static member function to form a pointer to member function. Say `&%T::%D'", base, name);
|
||||
else
|
||||
cp_pedwarn ("ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say `&%T::%D'", base, name);
|
||||
pedwarn ("ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say `&%T::%D'", base, name);
|
||||
}
|
||||
arg = build_offset_ref (base, name);
|
||||
}
|
||||
|
@ -4840,7 +4840,7 @@ unary_complex_lvalue (code, arg)
|
|||
if (TREE_CODE (t) == FUNCTION_DECL)
|
||||
{
|
||||
if (DECL_DESTRUCTOR_P (t))
|
||||
cp_error ("taking address of destructor");
|
||||
error ("taking address of destructor");
|
||||
return build_unary_op (ADDR_EXPR, t, 0);
|
||||
}
|
||||
if (TREE_CODE (t) == VAR_DECL)
|
||||
|
@ -4853,7 +4853,7 @@ unary_complex_lvalue (code, arg)
|
|||
&& ! is_dummy_object (TREE_OPERAND (arg, 0))
|
||||
&& TREE_CODE (t) != FIELD_DECL)
|
||||
{
|
||||
cp_error ("taking address of bound pointer-to-member expression");
|
||||
error ("taking address of bound pointer-to-member expression");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -4937,7 +4937,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'",
|
||||
warning ("address requested for `%D', which is declared `register'",
|
||||
x);
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
return 1;
|
||||
|
@ -5141,7 +5141,7 @@ build_static_cast (type, expr)
|
|||
constness. */
|
||||
if (ok && casts_away_constness (intype, type))
|
||||
{
|
||||
cp_error ("static_cast from type `%T' to type `%T' casts away constness",
|
||||
error ("static_cast from type `%T' to type `%T' casts away constness",
|
||||
intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -5149,7 +5149,7 @@ build_static_cast (type, expr)
|
|||
if (ok)
|
||||
return build_c_cast (type, expr);
|
||||
|
||||
cp_error ("invalid static_cast from type `%T' to type `%T'", intype, type);
|
||||
error ("invalid static_cast from type `%T' to type `%T'", intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -5188,7 +5188,7 @@ build_reinterpret_cast (type, expr)
|
|||
{
|
||||
if (! real_lvalue_p (expr))
|
||||
{
|
||||
cp_error ("invalid reinterpret_cast of an rvalue expression of type `%T' to type `%T'", intype, type);
|
||||
error ("invalid reinterpret_cast of an rvalue expression of type `%T' to type `%T'", intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
expr = build_unary_op (ADDR_EXPR, expr, 0);
|
||||
|
@ -5208,7 +5208,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",
|
||||
pedwarn ("reinterpret_cast from `%T' to `%T' loses precision",
|
||||
intype, type);
|
||||
}
|
||||
else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype))
|
||||
|
@ -5221,7 +5221,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)",
|
||||
pedwarn ("reinterpret_cast from `%T' to `%T' casts away const (or volatile)",
|
||||
intype, type);
|
||||
|
||||
expr = decl_constant_value (expr);
|
||||
|
@ -5236,7 +5236,7 @@ build_reinterpret_cast (type, expr)
|
|||
}
|
||||
else
|
||||
{
|
||||
cp_error ("invalid reinterpret_cast from type `%T' to type `%T'",
|
||||
error ("invalid reinterpret_cast from type `%T' to type `%T'",
|
||||
intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -5263,10 +5263,10 @@ build_const_cast (type, expr)
|
|||
}
|
||||
|
||||
if (!POINTER_TYPE_P (type))
|
||||
cp_error ("invalid use of const_cast with type `%T', which is not a pointer, reference, nor a pointer-to-data-member type", type);
|
||||
error ("invalid use of const_cast with type `%T', which is not a pointer, reference, nor a pointer-to-data-member type", type);
|
||||
else if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
|
||||
{
|
||||
cp_error ("invalid use of const_cast with type `%T', which is a pointer or reference to a function type", type);
|
||||
error ("invalid use of const_cast with type `%T', which is a pointer or reference to a function type", type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -5289,7 +5289,7 @@ build_const_cast (type, expr)
|
|||
{
|
||||
if (! real_lvalue_p (expr))
|
||||
{
|
||||
cp_error ("invalid const_cast of an rvalue of type `%T' to type `%T'", intype, type);
|
||||
error ("invalid const_cast of an rvalue of type `%T' to type `%T'", intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -5305,7 +5305,7 @@ build_const_cast (type, expr)
|
|||
&& comp_ptr_ttypes_const (TREE_TYPE (type), TREE_TYPE (intype)))
|
||||
return cp_convert (type, expr);
|
||||
|
||||
cp_error ("invalid const_cast from type `%T' to type `%T'", intype, type);
|
||||
error ("invalid const_cast from type `%T' to type `%T'", intype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -5347,12 +5347,12 @@ build_c_cast (type, expr)
|
|||
NIHCL uses it. It is not valid ISO C++ however. */
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
|
||||
{
|
||||
cp_pedwarn ("ISO C++ forbids casting to an array type `%T'", type);
|
||||
pedwarn ("ISO C++ forbids casting to an array type `%T'", type);
|
||||
type = build_pointer_type (TREE_TYPE (type));
|
||||
}
|
||||
else
|
||||
{
|
||||
cp_error ("ISO C++ forbids casting to an array type `%T'", type);
|
||||
error ("ISO C++ forbids casting to an array type `%T'", type);
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
|
@ -5360,7 +5360,7 @@ build_c_cast (type, expr)
|
|||
if (TREE_CODE (type) == FUNCTION_TYPE
|
||||
|| TREE_CODE (type) == METHOD_TYPE)
|
||||
{
|
||||
cp_error ("invalid cast to function type `%T'", type);
|
||||
error ("invalid cast to function type `%T'", type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -5412,7 +5412,7 @@ build_c_cast (type, expr)
|
|||
&& TREE_CODE (otype) == POINTER_TYPE
|
||||
&& !at_least_as_qualified_p (TREE_TYPE (type),
|
||||
TREE_TYPE (otype)))
|
||||
cp_warning ("cast from `%T' to `%T' discards qualifiers from pointer target type",
|
||||
warning ("cast from `%T' to `%T' discards qualifiers from pointer target type",
|
||||
otype, type);
|
||||
|
||||
if (TREE_CODE (type) == INTEGER_TYPE
|
||||
|
@ -5458,7 +5458,7 @@ build_c_cast (type, expr)
|
|||
&& COMPLETE_TYPE_P (TREE_TYPE (otype))
|
||||
&& COMPLETE_TYPE_P (TREE_TYPE (type))
|
||||
&& TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (otype)))
|
||||
cp_warning ("cast from `%T' to `%T' increases required alignment of target type",
|
||||
warning ("cast from `%T' to `%T' increases required alignment of target type",
|
||||
otype, type);
|
||||
|
||||
/* Always produce some operator for an explicit cast,
|
||||
|
@ -5646,7 +5646,7 @@ build_modify_expr (lhs, modifycode, rhs)
|
|||
newrhs = cp_build_binary_op (modifycode, lhs, rhs);
|
||||
if (newrhs == error_mark_node)
|
||||
{
|
||||
cp_error (" in evaluation of `%Q(%#T, %#T)'", modifycode,
|
||||
error (" in evaluation of `%Q(%#T, %#T)'", modifycode,
|
||||
TREE_TYPE (lhs), TREE_TYPE (rhs));
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -5779,7 +5779,7 @@ build_modify_expr (lhs, modifycode, rhs)
|
|||
|
||||
if (!same_or_base_type_p (lhstype, TREE_TYPE (rhs)))
|
||||
{
|
||||
cp_error ("incompatible types in assignment of `%T' to `%T'",
|
||||
error ("incompatible types in assignment of `%T' to `%T'",
|
||||
TREE_TYPE (rhs), lhstype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -5957,7 +5957,7 @@ get_delta_difference (from, to, force)
|
|||
if (virt_binfo)
|
||||
{
|
||||
/* This is a reinterpret cast, we choose to do nothing. */
|
||||
cp_warning ("pointer to member cast via virtual base `%T' of `%T'",
|
||||
warning ("pointer to member cast via virtual base `%T' of `%T'",
|
||||
BINFO_TYPE (virt_binfo),
|
||||
BINFO_TYPE (BINFO_INHERITANCE_CHAIN (virt_binfo)));
|
||||
return delta;
|
||||
|
@ -5976,11 +5976,11 @@ get_delta_difference (from, to, force)
|
|||
{
|
||||
/* This is a reinterpret cast, we choose to do nothing. */
|
||||
if (force)
|
||||
cp_warning ("pointer to member cast via virtual base `%T' of `%T'",
|
||||
warning ("pointer to member cast via virtual base `%T' of `%T'",
|
||||
BINFO_TYPE (virt_binfo),
|
||||
BINFO_TYPE (BINFO_INHERITANCE_CHAIN (virt_binfo)));
|
||||
else
|
||||
cp_error ("pointer to member conversion via virtual base `%T' of `%T'",
|
||||
error ("pointer to member conversion via virtual base `%T' of `%T'",
|
||||
BINFO_TYPE (virt_binfo),
|
||||
BINFO_TYPE (BINFO_INHERITANCE_CHAIN (virt_binfo)));
|
||||
return delta;
|
||||
|
@ -6050,7 +6050,7 @@ build_ptrmemfunc (type, pfn, force)
|
|||
|
||||
if (!force
|
||||
&& !can_convert_arg (to_type, TREE_TYPE (pfn), pfn))
|
||||
cp_error ("invalid conversion to type `%T' from type `%T'",
|
||||
error ("invalid conversion to type `%T' from type `%T'",
|
||||
to_type, pfn_type);
|
||||
|
||||
n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type),
|
||||
|
@ -6215,10 +6215,10 @@ dubious_conversion_warnings (type, expr, errtype, fndecl, parmnum)
|
|||
if (ARITHMETIC_TYPE_P (type) && expr == null_node)
|
||||
{
|
||||
if (fndecl)
|
||||
cp_warning ("passing NULL used for non-pointer %s %P of `%D'",
|
||||
warning ("passing NULL used for non-pointer %s %P of `%D'",
|
||||
errtype, parmnum, fndecl);
|
||||
else
|
||||
cp_warning ("%s to non-pointer type `%T' from NULL", errtype, type);
|
||||
warning ("%s to non-pointer type `%T' from NULL", errtype, type);
|
||||
}
|
||||
|
||||
/* Warn about assigning a floating-point type to an integer type. */
|
||||
|
@ -6226,10 +6226,10 @@ dubious_conversion_warnings (type, expr, errtype, fndecl, parmnum)
|
|||
&& TREE_CODE (type) == INTEGER_TYPE)
|
||||
{
|
||||
if (fndecl)
|
||||
cp_warning ("passing `%T' for %s %P of `%D'",
|
||||
warning ("passing `%T' for %s %P of `%D'",
|
||||
TREE_TYPE (expr), errtype, parmnum, fndecl);
|
||||
else
|
||||
cp_warning ("%s to `%T' from `%T'", errtype, type, TREE_TYPE (expr));
|
||||
warning ("%s to `%T' from `%T'", errtype, type, TREE_TYPE (expr));
|
||||
}
|
||||
/* And warn about assigning a negative value to an unsigned
|
||||
variable. */
|
||||
|
@ -6239,10 +6239,10 @@ dubious_conversion_warnings (type, expr, errtype, fndecl, parmnum)
|
|||
&& TREE_NEGATED_INT (expr))
|
||||
{
|
||||
if (fndecl)
|
||||
cp_warning ("passing negative value `%E' for %s %P of `%D'",
|
||||
warning ("passing negative value `%E' for %s %P of `%D'",
|
||||
expr, errtype, parmnum, fndecl);
|
||||
else
|
||||
cp_warning ("%s of negative value `%E' to `%T'",
|
||||
warning ("%s of negative value `%E' to `%T'",
|
||||
errtype, expr, type);
|
||||
}
|
||||
|
||||
|
@ -6329,10 +6329,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
|
|||
if (rhstype == unknown_type_node)
|
||||
instantiate_type (type, rhs, itf_complain);
|
||||
else if (fndecl)
|
||||
cp_error ("cannot convert `%T' to `%T' for argument `%P' to `%D'",
|
||||
error ("cannot convert `%T' to `%T' for argument `%P' to `%D'",
|
||||
rhstype, type, parmnum, fndecl);
|
||||
else
|
||||
cp_error ("cannot convert `%T' to `%T' in %s", rhstype, type,
|
||||
error ("cannot convert `%T' to `%T' in %s", rhstype, type,
|
||||
errtype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -6653,13 +6653,13 @@ check_return_expr (retval)
|
|||
&& !TYPE_NOTHROW_P (TREE_TYPE (current_function_decl))
|
||||
&& ! flag_check_new
|
||||
&& null_ptr_cst_p (retval))
|
||||
cp_warning ("`operator new' must not return NULL unless it is declared `throw()' (or -fcheck-new is in effect)");
|
||||
warning ("`operator new' must not return NULL unless it is declared `throw()' (or -fcheck-new is in effect)");
|
||||
|
||||
/* Effective C++ rule 15. See also start_function. */
|
||||
if (warn_ecpp
|
||||
&& DECL_NAME (current_function_decl) == ansi_assopname(NOP_EXPR)
|
||||
&& retval != current_class_ref)
|
||||
cp_warning ("`operator=' should return a reference to `*this'");
|
||||
warning ("`operator=' should return a reference to `*this'");
|
||||
|
||||
/* The fabled Named Return Value optimization, as per [class.copy]/15:
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ error_not_base_type (basetype, type)
|
|||
{
|
||||
if (TREE_CODE (basetype) == FUNCTION_DECL)
|
||||
basetype = DECL_CONTEXT (basetype);
|
||||
cp_error ("type `%T' is not a base type for type `%T'", basetype, type);
|
||||
error ("type `%T' is not a base type for type `%T'", basetype, type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -83,9 +83,9 @@ readonly_error (arg, string, soft)
|
|||
void (*fn) PARAMS ((const char *, ...));
|
||||
|
||||
if (soft)
|
||||
fn = cp_pedwarn;
|
||||
fn = pedwarn;
|
||||
else
|
||||
fn = cp_error;
|
||||
fn = error;
|
||||
|
||||
if (TREE_CODE (arg) == COMPONENT_REF)
|
||||
{
|
||||
|
@ -148,22 +148,22 @@ abstract_virtuals_error (decl, type)
|
|||
return 0;
|
||||
|
||||
if (TREE_CODE (decl) == VAR_DECL)
|
||||
cp_error ("cannot declare variable `%D' to be of type `%T'",
|
||||
error ("cannot declare variable `%D' to be of type `%T'",
|
||||
decl, type);
|
||||
else if (TREE_CODE (decl) == PARM_DECL)
|
||||
cp_error ("cannot declare parameter `%D' to be of type `%T'",
|
||||
error ("cannot declare parameter `%D' to be of type `%T'",
|
||||
decl, type);
|
||||
else if (TREE_CODE (decl) == FIELD_DECL)
|
||||
cp_error ("cannot declare field `%D' to be of type `%T'",
|
||||
error ("cannot declare field `%D' to be of type `%T'",
|
||||
decl, type);
|
||||
else if (TREE_CODE (decl) == FUNCTION_DECL
|
||||
&& TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
|
||||
cp_error ("invalid return type for member function `%#D'", decl);
|
||||
error ("invalid return type for member function `%#D'", decl);
|
||||
else if (TREE_CODE (decl) == FUNCTION_DECL)
|
||||
cp_error ("invalid return type for function `%#D'", decl);
|
||||
error ("invalid return type for function `%#D'", decl);
|
||||
}
|
||||
else
|
||||
cp_error ("cannot allocate an object of type `%T'", type);
|
||||
error ("cannot allocate an object of type `%T'", type);
|
||||
|
||||
/* Only go through this once. */
|
||||
if (TREE_PURPOSE (u) == NULL_TREE)
|
||||
|
@ -175,7 +175,7 @@ abstract_virtuals_error (decl, type)
|
|||
cp_error_at ("\t%#D", TREE_VALUE (tu));
|
||||
}
|
||||
else
|
||||
cp_error (" since type `%T' has abstract virtual functions", type);
|
||||
error (" since type `%T' has abstract virtual functions", type);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -210,12 +210,12 @@ retry:
|
|||
case UNION_TYPE:
|
||||
case ENUMERAL_TYPE:
|
||||
if (!decl)
|
||||
cp_error ("invalid use of undefined type `%#T'", type);
|
||||
error ("invalid use of undefined type `%#T'", type);
|
||||
cp_error_at ("forward declaration of `%#T'", type);
|
||||
break;
|
||||
|
||||
case VOID_TYPE:
|
||||
cp_error ("invalid use of `%T'", type);
|
||||
error ("invalid use of `%T'", type);
|
||||
break;
|
||||
|
||||
case ARRAY_TYPE:
|
||||
|
@ -224,27 +224,27 @@ retry:
|
|||
type = TREE_TYPE (type);
|
||||
goto retry;
|
||||
}
|
||||
cp_error ("invalid use of array with unspecified bounds");
|
||||
error ("invalid use of array with unspecified bounds");
|
||||
break;
|
||||
|
||||
case OFFSET_TYPE:
|
||||
bad_member:
|
||||
cp_error ("invalid use of member (did you forget the `&' ?)");
|
||||
error ("invalid use of member (did you forget the `&' ?)");
|
||||
break;
|
||||
|
||||
case TEMPLATE_TYPE_PARM:
|
||||
cp_error ("invalid use of template type parameter");
|
||||
error ("invalid use of template type parameter");
|
||||
break;
|
||||
|
||||
case UNKNOWN_TYPE:
|
||||
if (value && TREE_CODE (value) == COMPONENT_REF)
|
||||
goto bad_member;
|
||||
else if (value && TREE_CODE (value) == ADDR_EXPR)
|
||||
cp_error ("address of overloaded function with no contextual type information");
|
||||
error ("address of overloaded function with no contextual type information");
|
||||
else if (value && TREE_CODE (value) == OVERLOAD)
|
||||
cp_error ("overloaded function with no contextual type information");
|
||||
error ("overloaded function with no contextual type information");
|
||||
else
|
||||
cp_error ("insufficient contextual information to determine type");
|
||||
error ("insufficient contextual information to determine type");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -322,7 +322,7 @@ store_init_value (decl, init)
|
|||
|
||||
if (TREE_CODE (init) == TREE_LIST)
|
||||
{
|
||||
cp_error ("constructor syntax used, but no constructor declared for type `%T'", type);
|
||||
error ("constructor syntax used, but no constructor declared for type `%T'", type);
|
||||
init = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (init));
|
||||
}
|
||||
#if 0
|
||||
|
@ -576,10 +576,10 @@ digest_init (type, init, tail)
|
|||
}
|
||||
while (TREE_CODE (init) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (init))
|
||||
{
|
||||
cp_pedwarn ("braces around scalar initializer for `%T'", type);
|
||||
pedwarn ("braces around scalar initializer for `%T'", type);
|
||||
init = CONSTRUCTOR_ELTS (init);
|
||||
if (TREE_CHAIN (init))
|
||||
cp_pedwarn ("ignoring extra initializers for `%T'", type);
|
||||
pedwarn ("ignoring extra initializers for `%T'", type);
|
||||
init = TREE_VALUE (init);
|
||||
}
|
||||
|
||||
|
@ -591,7 +591,7 @@ digest_init (type, init, tail)
|
|||
|
||||
if (COMPLETE_TYPE_P (type) && ! TREE_CONSTANT (TYPE_SIZE (type)))
|
||||
{
|
||||
cp_error ("variable-sized object of type `%T' may not be initialized",
|
||||
error ("variable-sized object of type `%T' may not be initialized",
|
||||
type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ digest_init (type, init, tail)
|
|||
if (raw_constructor && TYPE_NON_AGGREGATE_CLASS (type)
|
||||
&& TREE_HAS_CONSTRUCTOR (init))
|
||||
{
|
||||
cp_error ("subobject of type `%T' must be initialized by constructor, not by `%E'",
|
||||
error ("subobject of type `%T' must be initialized by constructor, not by `%E'",
|
||||
type, init);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -839,24 +839,24 @@ process_init_constructor (type, init, elts)
|
|||
/* Warn when some struct elements are implicitly initialized. */
|
||||
if (extra_warnings
|
||||
&& (!init || TREE_HAS_CONSTRUCTOR (init)))
|
||||
cp_warning ("missing initializer for member `%D'", field);
|
||||
warning ("missing initializer for member `%D'", field);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TREE_READONLY (field))
|
||||
cp_error ("uninitialized const member `%D'", field);
|
||||
error ("uninitialized const member `%D'", field);
|
||||
else if (TYPE_LANG_SPECIFIC (TREE_TYPE (field))
|
||||
&& CLASSTYPE_READONLY_FIELDS_NEED_INIT (TREE_TYPE (field)))
|
||||
cp_error ("member `%D' with uninitialized const fields",
|
||||
error ("member `%D' with uninitialized const fields",
|
||||
field);
|
||||
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE)
|
||||
cp_error ("member `%D' is uninitialized reference", field);
|
||||
error ("member `%D' is uninitialized reference", field);
|
||||
|
||||
/* Warn when some struct elements are implicitly initialized
|
||||
to zero. */
|
||||
if (extra_warnings
|
||||
&& (!init || TREE_HAS_CONSTRUCTOR (init)))
|
||||
cp_warning ("missing initializer for member `%D'", field);
|
||||
warning ("missing initializer for member `%D'", field);
|
||||
|
||||
/* The default zero-initialization is fine for us; don't
|
||||
add anything to the CONSTRUCTOR. */
|
||||
|
@ -905,7 +905,7 @@ process_init_constructor (type, init, elts)
|
|||
if (temp)
|
||||
field = temp, win = 1;
|
||||
else
|
||||
cp_error ("no field `%D' in union being initialized",
|
||||
error ("no field `%D' in union being initialized",
|
||||
TREE_PURPOSE (tail));
|
||||
}
|
||||
if (!win)
|
||||
|
@ -913,7 +913,7 @@ process_init_constructor (type, init, elts)
|
|||
}
|
||||
else if (field == 0)
|
||||
{
|
||||
cp_error ("union `%T' with no named members cannot be initialized",
|
||||
error ("union `%T' with no named members cannot be initialized",
|
||||
type);
|
||||
TREE_VALUE (tail) = error_mark_node;
|
||||
}
|
||||
|
@ -1067,7 +1067,7 @@ build_x_arrow (datum)
|
|||
|
||||
if (last_rval == NULL_TREE)
|
||||
{
|
||||
cp_error ("base operand of `->' has non-pointer type `%T'", type);
|
||||
error ("base operand of `->' has non-pointer type `%T'", type);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1131,15 +1131,15 @@ build_m_component_ref (datum, component)
|
|||
}
|
||||
else
|
||||
{
|
||||
cp_error ("`%E' cannot be used as a member pointer, since it is of type `%T'",
|
||||
error ("`%E' cannot be used as a member pointer, since it is of type `%T'",
|
||||
component, TREE_TYPE (component));
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
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);
|
||||
error ("cannot apply member pointer `%E' to `%E'", component, datum);
|
||||
error ("which is of non-aggregate type `%T'", objtype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1147,7 +1147,7 @@ build_m_component_ref (datum, component)
|
|||
ba_check, NULL);
|
||||
if (!binfo)
|
||||
{
|
||||
cp_error ("member type `%T::' incompatible with object type `%T'",
|
||||
error ("member type `%T::' incompatible with object type `%T'",
|
||||
TYPE_METHOD_BASETYPE (type), objtype);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
@ -1201,7 +1201,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);
|
||||
error ("`%T' fails to be a typedef or built-in type", exp);
|
||||
return error_mark_node;
|
||||
}
|
||||
type = TREE_TYPE (type);
|
||||
|
|
Loading…
Reference in New Issue