Commit 33bd39a2 by Zack Weinberg

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
parent 86460bab
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> 2001-12-16 Neil Booth <neil@daikokuya.demon.co.uk>
* decl2.c (finish_file): Remove back_end_hook. * decl2.c (finish_file): Remove back_end_hook.
...@@ -50,7 +61,7 @@ ...@@ -50,7 +61,7 @@
(ctor_label): Remove. (ctor_label): Remove.
* semantics.c (finish_return_stmt): Lose ctor_label support. * semantics.c (finish_return_stmt): Lose ctor_label support.
* decl.c (finish_constructor_body, mark_lang_function): Likewise. * 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. dtor_label.
* call.c (build_new_method_call): Let resolves_to_fixed_type_p * call.c (build_new_method_call): Let resolves_to_fixed_type_p
...@@ -125,8 +136,8 @@ ...@@ -125,8 +136,8 @@
2001-12-08 Aldy Hernandez <aldyh@redhat.com> 2001-12-08 Aldy Hernandez <aldyh@redhat.com>
* lex.c (rid_to_yy): Add RID_CHOOSE_EXPR and * lex.c (rid_to_yy): Add RID_CHOOSE_EXPR and
RID_TYPES_COMPATIBLE_P. RID_TYPES_COMPATIBLE_P.
2001-12-08 John David Anglin <dave@hiauly1.hia.nrc.ca> 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> ...@@ -225,7 +236,7 @@ Wed Dec 5 17:00:49 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
PR c++/3048 PR c++/3048
* cp-tree.h (ovl_member): Remove. * cp-tree.h (ovl_member): Remove.
* decl2.c (merge_functions): Handle extern "C" functions * decl2.c (merge_functions): Handle extern "C" functions
specially. specially.
* tree.c (ovl_member): Remove. * tree.c (ovl_member): Remove.
...@@ -303,7 +314,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -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 * cp/search.c (lookup_base_r): Declare bk in variable declaration
space. space.
2001-11-25 Nathan Sidwell <nathan@codesourcery.com> 2001-11-25 Nathan Sidwell <nathan@codesourcery.com>
PR g++/3145 PR g++/3145
...@@ -351,9 +362,9 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -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. * cp-tree.h (CP_TYPE_QUALS): Removed.
* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree. * 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. 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. lang-hooks prototype.
* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c, * 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 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> ...@@ -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> 2001-11-20 Mark Mitchell <mark@codesourcery.com>
* call.c (non_reference): Add documentation. * 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. from conversion operators.
(maybe_handle_ref_bind): Simplify. (maybe_handle_ref_bind): Simplify.
(compare_ics): Correct handling of references. (compare_ics): Correct handling of references.
...@@ -382,7 +393,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -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 (cp_dump_tree): Dump CLASSTYPE_TEMPLATE_SPECIALIZATION. Use
dump_op. Dump DECL_MUTABLE, access and staticness for VAR_DECLs. dump_op. Dump DECL_MUTABLE, access and staticness for VAR_DECLs.
DECL_PURE_VIRTUAL_P, DECL_VIRTUAL_P, DECL_PURE_VIRTUAL_P, DECL_VIRTUAL_P,
2001-11-19 Mark Mitchell <mark@codesourcery.com> 2001-11-19 Mark Mitchell <mark@codesourcery.com>
PR4629 PR4629
...@@ -494,7 +505,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -494,7 +505,7 @@ Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(struct lang_hooks): Constify. (struct lang_hooks): Constify.
* lex.c (cxx_init_options): Update. * lex.c (cxx_init_options): Update.
(lang_identify): Remove. (lang_identify): Remove.
* parse.y (language_string): Remove. * parse.y (language_string): Remove.
2001-11-08 Andreas Franck <afranck@gmx.de> 2001-11-08 Andreas Franck <afranck@gmx.de>
......
...@@ -281,7 +281,7 @@ build_base_path (code, expr, binfo, nonnull) ...@@ -281,7 +281,7 @@ build_base_path (code, expr, binfo, nonnull)
if (code == MINUS_EXPR && v_binfo) 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)); BINFO_TYPE (binfo), BINFO_TYPE (t), BINFO_TYPE (v_binfo));
return error_mark_node; return error_mark_node;
} }
...@@ -991,7 +991,7 @@ add_method (type, method, error_p) ...@@ -991,7 +991,7 @@ add_method (type, method, error_p)
/* Defer to the local function. */ /* Defer to the local function. */
return; return;
else else
cp_error ("`%#D' and `%#D' cannot be overloaded", error ("`%#D' and `%#D' cannot be overloaded",
fn, method); fn, method);
} }
} }
...@@ -1323,7 +1323,7 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p, ...@@ -1323,7 +1323,7 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
dtor is handled in finish_struct_1. */ dtor is handled in finish_struct_1. */
if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype) if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype)
&& TYPE_HAS_DESTRUCTOR (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); basetype);
/* If the base class doesn't have copy constructors or /* 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, ...@@ -1343,7 +1343,7 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
{ {
*cant_have_default_ctor_p = 1; *cant_have_default_ctor_p = 1;
if (! TYPE_HAS_CONSTRUCTOR (t)) 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); basetype);
} }
...@@ -1929,7 +1929,7 @@ maybe_warn_about_overly_private_class (t) ...@@ -1929,7 +1929,7 @@ maybe_warn_about_overly_private_class (t)
} }
if (!has_nonprivate_method) 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; return;
} }
} }
...@@ -1943,7 +1943,7 @@ maybe_warn_about_overly_private_class (t) ...@@ -1943,7 +1943,7 @@ maybe_warn_about_overly_private_class (t)
if (TREE_PRIVATE (dtor)) 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); t);
return; return;
} }
...@@ -1986,7 +1986,7 @@ maybe_warn_about_overly_private_class (t) ...@@ -1986,7 +1986,7 @@ maybe_warn_about_overly_private_class (t)
if (nonprivate_ctor == 0) 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); t);
return; return;
} }
...@@ -2107,7 +2107,7 @@ void ...@@ -2107,7 +2107,7 @@ void
duplicate_tag_error (t) duplicate_tag_error (t)
tree t; tree t;
{ {
cp_error ("redefinition of `%#T'", t); error ("redefinition of `%#T'", t);
cp_error_at ("previous definition of `%#T'", t); cp_error_at ("previous definition of `%#T'", t);
/* Pretend we haven't defined this type. */ /* Pretend we haven't defined this type. */
...@@ -2438,7 +2438,7 @@ find_final_overrider (t, binfo, fn) ...@@ -2438,7 +2438,7 @@ find_final_overrider (t, binfo, fn)
/* If there was no winner, issue an error message. */ /* If there was no winner, issue an error message. */
if (!ffod.overriding_fn) 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; return error_mark_node;
} }
...@@ -3426,16 +3426,16 @@ check_field_decls (t, access_decls, empty_p, ...@@ -3426,16 +3426,16 @@ check_field_decls (t, access_decls, empty_p,
if (has_pointers && warn_ecpp && TYPE_HAS_CONSTRUCTOR (t) if (has_pointers && warn_ecpp && TYPE_HAS_CONSTRUCTOR (t)
&& ! (TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (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)) 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)) 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)) 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) ...@@ -4687,7 +4687,7 @@ layout_virtual_bases (t, offsets)
tree basetype = BINFO_TYPE (TREE_VALUE (vbases)); tree basetype = BINFO_TYPE (TREE_VALUE (vbases));
if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL)) 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); basetype, t);
} }
} }
...@@ -4757,7 +4757,7 @@ warn_about_ambiguous_direct_bases (t) ...@@ -4757,7 +4757,7 @@ warn_about_ambiguous_direct_bases (t)
tree basetype = TYPE_BINFO_BASETYPE (t, i); tree basetype = TYPE_BINFO_BASETYPE (t, i);
if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL)) 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); basetype, t);
} }
} }
...@@ -5011,7 +5011,7 @@ finish_struct_1 (t) ...@@ -5011,7 +5011,7 @@ finish_struct_1 (t)
if (COMPLETE_TYPE_P (t)) if (COMPLETE_TYPE_P (t))
{ {
if (IS_AGGR_TYPE (t)) if (IS_AGGR_TYPE (t))
cp_error ("redefinition of `%#T'", t); error ("redefinition of `%#T'", t);
else else
my_friendly_abort (172); my_friendly_abort (172);
popclass (); popclass ();
...@@ -5174,7 +5174,7 @@ finish_struct_1 (t) ...@@ -5174,7 +5174,7 @@ finish_struct_1 (t)
if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && TYPE_HAS_DESTRUCTOR (t) if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && TYPE_HAS_DESTRUCTOR (t)
&& DECL_VINDEX (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1)) == NULL_TREE) && 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); hack_incomplete_structures (t);
...@@ -5811,7 +5811,7 @@ resolve_address_of_overloaded_function (target_type, ...@@ -5811,7 +5811,7 @@ resolve_address_of_overloaded_function (target_type,
else else
{ {
if (complain) if (complain)
cp_error ("\ error ("\
cannot resolve overloaded function `%D' based on conversion to type `%T'", cannot resolve overloaded function `%D' based on conversion to type `%T'",
DECL_NAME (OVL_FUNCTION (overload)), target_type); DECL_NAME (OVL_FUNCTION (overload)), target_type);
return error_mark_node; return error_mark_node;
...@@ -5932,7 +5932,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", ...@@ -5932,7 +5932,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
/* There were *no* matches. */ /* There were *no* matches. */
if (complain) 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)), DECL_NAME (OVL_FUNCTION (overload)),
target_type); target_type);
...@@ -5955,7 +5955,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", ...@@ -5955,7 +5955,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
{ {
tree match; 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)), DECL_NAME (OVL_FUNCTION (overload)),
target_type); target_type);
...@@ -5981,10 +5981,10 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", ...@@ -5981,10 +5981,10 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
if (!complain) if (!complain)
return error_mark_node; return error_mark_node;
cp_pedwarn ("assuming pointer to member `%D'", fn); pedwarn ("assuming pointer to member `%D'", fn);
if (!explained) 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; explained = 1;
} }
} }
...@@ -6037,7 +6037,7 @@ instantiate_type (lhstype, rhs, flags) ...@@ -6037,7 +6037,7 @@ instantiate_type (lhstype, rhs, flags)
if (comptypes (lhstype, TREE_TYPE (rhs), strict)) if (comptypes (lhstype, TREE_TYPE (rhs), strict))
return rhs; return rhs;
if (complain) 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); TREE_TYPE (rhs), lhstype);
return error_mark_node; return error_mark_node;
} }
...@@ -6431,7 +6431,7 @@ note_name_declared_in_class (name, decl) ...@@ -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 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 in its context and when re-evaluated in the completed scope of
S. */ S. */
cp_error ("declaration of `%#D'", decl); error ("declaration of `%#D'", decl);
cp_error_at ("changes meaning of `%D' from `%+#D'", cp_error_at ("changes meaning of `%D' from `%+#D'",
DECL_NAME (OVL_CURRENT (decl)), DECL_NAME (OVL_CURRENT (decl)),
(tree) n->value); (tree) n->value);
......
...@@ -3780,14 +3780,6 @@ extern tree set_guard PARAMS ((tree)); ...@@ -3780,14 +3780,6 @@ extern tree set_guard PARAMS ((tree));
/* in parse.y */ /* in parse.y */
extern void cp_parse_init PARAMS ((void)); 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_error_at PARAMS ((const char *msgid, ...));
extern void cp_warning_at PARAMS ((const char *msgid, ...)); extern void cp_warning_at PARAMS ((const char *msgid, ...));
extern void cp_pedwarn_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, ...)); ...@@ -3795,8 +3787,8 @@ extern void cp_pedwarn_at PARAMS ((const char *msgid, ...));
/* XXX Not i18n clean. */ /* XXX Not i18n clean. */
#define cp_deprecated(str) \ #define cp_deprecated(str) \
do { if (warn_deprecated) \ do { if (warn_deprecated) \
cp_warning("%s is deprecated, please see the documentation for details", \ warning("%s is deprecated, please see the documentation for details", \
str); \ str); \
} while (0) } while (0)
/* in error.c */ /* in error.c */
......
...@@ -85,7 +85,7 @@ cp_convert_to_pointer (type, expr, force) ...@@ -85,7 +85,7 @@ cp_convert_to_pointer (type, expr, force)
intype = complete_type (intype); intype = complete_type (intype);
if (!COMPLETE_TYPE_P (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); intype, type);
return error_mark_node; return error_mark_node;
} }
...@@ -94,7 +94,7 @@ cp_convert_to_pointer (type, expr, force) ...@@ -94,7 +94,7 @@ cp_convert_to_pointer (type, expr, force)
if (rval) if (rval)
{ {
if (rval == error_mark_node) 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); expr, intype, type);
return rval; return rval;
} }
...@@ -123,7 +123,7 @@ cp_convert_to_pointer (type, expr, force) ...@@ -123,7 +123,7 @@ cp_convert_to_pointer (type, expr, force)
{ {
if (TREE_CODE (TREE_TYPE (TREE_TYPE (expr))) == METHOD_TYPE) if (TREE_CODE (TREE_TYPE (TREE_TYPE (expr))) == METHOD_TYPE)
if (pedantic || warn_pmf2ptr) if (pedantic || warn_pmf2ptr)
cp_pedwarn ("converting from `%T' to `%T'", TREE_TYPE (expr), pedwarn ("converting from `%T' to `%T'", TREE_TYPE (expr),
type); type);
return build1 (NOP_EXPR, type, expr); return build1 (NOP_EXPR, type, expr);
} }
...@@ -195,11 +195,11 @@ cp_convert_to_pointer (type, expr, force) ...@@ -195,11 +195,11 @@ cp_convert_to_pointer (type, expr, force)
if (bk == bk_via_virtual) if (bk == bk_via_virtual)
{ {
if (force) 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)); TREE_TYPE (intype), TREE_TYPE (type));
else 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)); TREE_TYPE (intype), TREE_TYPE (type));
return error_mark_node; return error_mark_node;
} }
...@@ -217,7 +217,7 @@ cp_convert_to_pointer (type, expr, force) ...@@ -217,7 +217,7 @@ cp_convert_to_pointer (type, expr, force)
} }
else if (TYPE_PTRMEMFUNC_P (type)) 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); expr, intype, type);
return error_mark_node; return error_mark_node;
} }
...@@ -230,7 +230,7 @@ cp_convert_to_pointer (type, expr, force) ...@@ -230,7 +230,7 @@ cp_convert_to_pointer (type, expr, force)
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0); return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0);
else if (TYPE_PTRMEMFUNC_P (intype)) 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); expr, intype, type);
return error_mark_node; return error_mark_node;
} }
...@@ -269,7 +269,7 @@ cp_convert_to_pointer (type, expr, force) ...@@ -269,7 +269,7 @@ cp_convert_to_pointer (type, expr, force)
if (type_unknown_p (expr)) if (type_unknown_p (expr))
return instantiate_type (type, expr, itf_complain); 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); expr, intype, type);
return error_mark_node; return error_mark_node;
} }
...@@ -451,7 +451,7 @@ warn_ref_binding (reftype, intype, decl) ...@@ -451,7 +451,7 @@ warn_ref_binding (reftype, intype, decl)
else else
msg = "conversion to non-const reference type `%#T' from rvalue of type `%T'"; 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) ...@@ -523,7 +523,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
if (! (convtype & CONV_CONST) if (! (convtype & CONV_CONST)
&& !at_least_as_qualified_p (ttl, ttr)) && !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); ttr, reftype);
} }
...@@ -541,7 +541,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl) ...@@ -541,7 +541,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
if (TREE_CODE (intype) == POINTER_TYPE if (TREE_CODE (intype) == POINTER_TYPE
&& (comptypes (TREE_TYPE (intype), type, && (comptypes (TREE_TYPE (intype), type,
COMPARE_BASE | COMPARE_RELAXED ))) 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); intype, reftype);
rval = build_unary_op (ADDR_EXPR, expr, 0); rval = build_unary_op (ADDR_EXPR, expr, 0);
...@@ -570,7 +570,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl) ...@@ -570,7 +570,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
my_friendly_assert (TREE_CODE (intype) != OFFSET_TYPE, 189); my_friendly_assert (TREE_CODE (intype) != OFFSET_TYPE, 189);
if (flags & LOOKUP_COMPLAIN) 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) if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE; return NULL_TREE;
...@@ -687,7 +687,7 @@ ocp_convert (type, expr, convtype, flags) ...@@ -687,7 +687,7 @@ ocp_convert (type, expr, convtype, flags)
&& ((ARITHMETIC_TYPE_P (intype) && ! (convtype & CONV_STATIC)) && ((ARITHMETIC_TYPE_P (intype) && ! (convtype & CONV_STATIC))
|| (TREE_CODE (intype) == POINTER_TYPE))) || (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) if (flag_pedantic_errors)
return error_mark_node; return error_mark_node;
...@@ -699,7 +699,7 @@ ocp_convert (type, expr, convtype, flags) ...@@ -699,7 +699,7 @@ ocp_convert (type, expr, convtype, flags)
if (rval) if (rval)
return rval; return rval;
if (flags & LOOKUP_COMPLAIN) 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) if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE; return NULL_TREE;
return error_mark_node; return error_mark_node;
...@@ -716,7 +716,7 @@ ocp_convert (type, expr, convtype, flags) ...@@ -716,7 +716,7 @@ ocp_convert (type, expr, convtype, flags)
&& TREE_CODE (TREE_OPERAND (expr, 0)) == FUNCTION_DECL) && TREE_CODE (TREE_OPERAND (expr, 0)) == FUNCTION_DECL)
fn = TREE_OPERAND (expr, 0); fn = TREE_OPERAND (expr, 0);
if (fn && !DECL_WEAK (fn)) 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 cp_truthvalue_conversion (e);
} }
return fold (convert_to_integer (type, e)); return fold (convert_to_integer (type, e));
...@@ -736,7 +736,7 @@ ocp_convert (type, expr, convtype, flags) ...@@ -736,7 +736,7 @@ ocp_convert (type, expr, convtype, flags)
return rval; return rval;
else else
if (flags & LOOKUP_COMPLAIN) 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)); TREE_TYPE (e));
} }
if (code == REAL_TYPE) if (code == REAL_TYPE)
...@@ -791,7 +791,7 @@ ocp_convert (type, expr, convtype, flags) ...@@ -791,7 +791,7 @@ ocp_convert (type, expr, convtype, flags)
return e; return e;
if (flags & LOOKUP_COMPLAIN) 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); TREE_TYPE (expr), type);
if (flags & LOOKUP_SPECULATIVELY) if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE; return NULL_TREE;
...@@ -876,10 +876,10 @@ convert_to_void (expr, implicit) ...@@ -876,10 +876,10 @@ convert_to_void (expr, implicit)
int is_complete = COMPLETE_TYPE_P (complete_type (type)); int is_complete = COMPLETE_TYPE_P (complete_type (type));
if (is_volatile && !is_complete) 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"); type, implicit ? implicit : "void context");
else if (is_reference && is_volatile) 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)), TREE_TYPE (TREE_OPERAND (expr, 0)),
implicit ? implicit : "void context"); implicit ? implicit : "void context");
if (is_reference || !is_volatile || !is_complete) if (is_reference || !is_volatile || !is_complete)
...@@ -895,7 +895,7 @@ convert_to_void (expr, implicit) ...@@ -895,7 +895,7 @@ convert_to_void (expr, implicit)
int is_complete = COMPLETE_TYPE_P (complete_type (type)); int is_complete = COMPLETE_TYPE_P (complete_type (type));
if (TYPE_VOLATILE (type) && !is_complete) 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"); expr, type, implicit ? implicit : "void context");
break; break;
} }
...@@ -915,12 +915,12 @@ convert_to_void (expr, implicit) ...@@ -915,12 +915,12 @@ convert_to_void (expr, implicit)
{ {
/* [over.over] enumerates the places where we can take the address /* [over.over] enumerates the places where we can take the address
of an overloaded function, and this is not one of them. */ 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"); implicit ? implicit : "void cast");
} }
else if (implicit && probe == expr && is_overloaded_fn (probe)) else if (implicit && probe == expr && is_overloaded_fn (probe))
/* Only warn when there is no &. */ /* 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); implicit, expr);
} }
...@@ -1058,7 +1058,7 @@ build_expr_type_conversion (desires, expr, complain) ...@@ -1058,7 +1058,7 @@ build_expr_type_conversion (desires, expr, complain)
if (expr == null_node if (expr == null_node
&& (desires & WANT_INT) && (desires & WANT_INT)
&& !(desires & WANT_NULL)) && !(desires & WANT_NULL))
cp_warning ("converting NULL to non-pointer type"); warning ("converting NULL to non-pointer type");
if (TREE_CODE (expr) == OFFSET_REF) if (TREE_CODE (expr) == OFFSET_REF)
expr = resolve_offset_ref (expr); expr = resolve_offset_ref (expr);
...@@ -1134,9 +1134,9 @@ build_expr_type_conversion (desires, expr, complain) ...@@ -1134,9 +1134,9 @@ build_expr_type_conversion (desires, expr, complain)
{ {
if (complain) if (complain)
{ {
cp_error ("ambiguous default type conversion from `%T'", error ("ambiguous default type conversion from `%T'",
basetype); basetype);
cp_error (" candidate conversions include `%D' and `%D'", error (" candidate conversions include `%D' and `%D'",
winner, cand); winner, cand);
} }
return error_mark_node; return error_mark_node;
......
...@@ -939,7 +939,7 @@ dump_decl (t, flags) ...@@ -939,7 +939,7 @@ dump_decl (t, flags)
break; break;
/* These special cases are duplicated here so that other functions /* 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: case IDENTIFIER_NODE:
if (IDENTIFIER_TYPENAME_P (t)) if (IDENTIFIER_TYPENAME_P (t))
{ {
...@@ -1093,7 +1093,7 @@ dump_template_decl (t, flags) ...@@ -1093,7 +1093,7 @@ dump_template_decl (t, flags)
/* Pretty print a function decl. There are several ways we want to print a /* 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. 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. */ is %D which doesn't print the throw specs, and %F which does. */
static void static void
...@@ -2215,7 +2215,7 @@ cp_line_of (t) ...@@ -2215,7 +2215,7 @@ cp_line_of (t)
return line; 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_ on/off VERBOSE flag and supply the appropriate TFF_ flags to a dump_
function. */ function. */
......
...@@ -242,7 +242,7 @@ decl_is_java_type (decl, err) ...@@ -242,7 +242,7 @@ decl_is_java_type (decl, err)
&& TYPE_FOR_JAVA (TREE_TYPE (decl))) && TYPE_FOR_JAVA (TREE_TYPE (decl)))
{ {
/* Can't throw a reference. */ /* 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); decl);
} }
...@@ -260,7 +260,7 @@ decl_is_java_type (decl, err) ...@@ -260,7 +260,7 @@ decl_is_java_type (decl, err)
if (! DERIVED_FROM_P (jthrow_node, TREE_TYPE (decl))) if (! DERIVED_FROM_P (jthrow_node, TREE_TYPE (decl)))
{ {
/* Thrown object must be a Throwable. */ /* 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)); TREE_TYPE (decl));
} }
} }
...@@ -555,7 +555,7 @@ build_throw (exp) ...@@ -555,7 +555,7 @@ build_throw (exp)
return build_min (THROW_EXPR, void_type_node, exp); return build_min (THROW_EXPR, void_type_node, exp);
if (exp == null_node) 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) if (exp != NULL_TREE)
{ {
...@@ -772,7 +772,7 @@ is_admissible_throw_operand (expr) ...@@ -772,7 +772,7 @@ is_admissible_throw_operand (expr)
conversion. */ conversion. */
else if (CLASS_TYPE_P (type) && CLASSTYPE_PURE_VIRTUALS (type)) 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; return false;
} }
...@@ -860,10 +860,10 @@ check_handlers_1 (master, handlers) ...@@ -860,10 +860,10 @@ check_handlers_1 (master, handlers)
&& can_convert_eh (type, TREE_TYPE (handler))) && can_convert_eh (type, TREE_TYPE (handler)))
{ {
lineno = STMT_LINENO (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)); TREE_TYPE (handler));
lineno = STMT_LINENO (master); lineno = STMT_LINENO (master);
cp_warning (" by earlier handler for `%T'", type); warning (" by earlier handler for `%T'", type);
break; break;
} }
} }
...@@ -883,7 +883,7 @@ check_handlers (handlers) ...@@ -883,7 +883,7 @@ check_handlers (handlers)
else if (TREE_TYPE (handler) == NULL_TREE) else if (TREE_TYPE (handler) == NULL_TREE)
{ {
lineno = STMT_LINENO (handler); lineno = STMT_LINENO (handler);
cp_pedwarn pedwarn
("`...' handler must be the last handler for its try block"); ("`...' handler must be the last handler for its try block");
} }
else else
......
...@@ -152,7 +152,7 @@ add_friend (type, decl) ...@@ -152,7 +152,7 @@ add_friend (type, decl)
{ {
if (decl == TREE_VALUE (friends)) 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); decl, type);
cp_warning_at ("previous friend declaration of `%D'", cp_warning_at ("previous friend declaration of `%D'",
TREE_VALUE (friends)); TREE_VALUE (friends));
...@@ -194,7 +194,7 @@ make_friend_class (type, friend_type) ...@@ -194,7 +194,7 @@ make_friend_class (type, friend_type)
if (! IS_AGGR_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; return;
} }
...@@ -206,7 +206,7 @@ make_friend_class (type, friend_type) ...@@ -206,7 +206,7 @@ make_friend_class (type, friend_type)
Friend declarations shall not declare partial Friend declarations shall not declare partial
specializations. */ specializations. */
cp_error ("partial specialization `%T' declared `friend'", error ("partial specialization `%T' declared `friend'",
friend_type); friend_type);
return; return;
} }
...@@ -218,7 +218,7 @@ make_friend_class (type, friend_type) ...@@ -218,7 +218,7 @@ make_friend_class (type, friend_type)
is_template_friend = 1; is_template_friend = 1;
else if (same_type_p (type, friend_type)) 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); type);
return; return;
} }
...@@ -236,19 +236,19 @@ make_friend_class (type, friend_type) ...@@ -236,19 +236,19 @@ make_friend_class (type, friend_type)
else if (TREE_CODE (friend_type) == TYPENAME_TYPE) else if (TREE_CODE (friend_type) == TYPENAME_TYPE)
{ {
/* template <class T> friend typename S<T>::X; */ /* 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; return;
} }
else if (TREE_CODE (friend_type) == TEMPLATE_TYPE_PARM) else if (TREE_CODE (friend_type) == TEMPLATE_TYPE_PARM)
{ {
/* template <class T> friend class T; */ /* 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; return;
} }
else if (!CLASSTYPE_TEMPLATE_INFO (friend_type)) else if (!CLASSTYPE_TEMPLATE_INFO (friend_type))
{ {
/* template <class T> friend class A; where A is not a template */ /* 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; return;
} }
...@@ -265,7 +265,7 @@ make_friend_class (type, friend_type) ...@@ -265,7 +265,7 @@ make_friend_class (type, friend_type)
same_type_p (TREE_VALUE (classes), friend_type))) same_type_p (TREE_VALUE (classes), friend_type)))
classes = TREE_CHAIN (classes); classes = TREE_CHAIN (classes);
if (classes) if (classes)
cp_warning ("`%T' is already a friend of `%T'", warning ("`%T' is already a friend of `%T'",
TREE_VALUE (classes), type); TREE_VALUE (classes), type);
else else
{ {
...@@ -361,7 +361,7 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist, ...@@ -361,7 +361,7 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist,
add_friend (current_class_type, decl); add_friend (current_class_type, decl);
} }
else else
cp_error ("member `%D' declared as friend before type `%T' defined", error ("member `%D' declared as friend before type `%T' defined",
decl, ctype); decl, ctype);
} }
/* A global friend. /* A global friend.
...@@ -416,7 +416,7 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist, ...@@ -416,7 +416,7 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist,
if (warn) if (warn)
{ {
static int explained; 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) 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"); 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) ...@@ -281,13 +281,13 @@ perform_member_init (member, init, explicit)
{ {
init = build_default_init (type); init = build_default_init (type);
if (TREE_CODE (type) == REFERENCE_TYPE) if (TREE_CODE (type) == REFERENCE_TYPE)
cp_warning warning
("default-initialization of `%#D', which has reference type", ("default-initialization of `%#D', which has reference type",
member); member);
} }
/* member traversal: note it leaves init NULL */ /* member traversal: note it leaves init NULL */
else if (TREE_CODE (type) == REFERENCE_TYPE) 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) else if (TREE_CODE (init) == TREE_LIST)
{ {
...@@ -425,7 +425,7 @@ sort_member_init (t, member_init_list) ...@@ -425,7 +425,7 @@ sort_member_init (t, member_init_list)
/* If there was already an explicit initializer for this field, /* If there was already an explicit initializer for this field,
issue an error. */ issue an error. */
if (TREE_TYPE (f)) if (TREE_TYPE (f))
cp_error ("multiple initializations given for member `%D'", error ("multiple initializations given for member `%D'",
initialized_field); initialized_field);
else else
{ {
...@@ -497,7 +497,7 @@ sort_member_init (t, member_init_list) ...@@ -497,7 +497,7 @@ sort_member_init (t, member_init_list)
if (same_type_p (last_field_type, field_type)) if (same_type_p (last_field_type, field_type))
{ {
if (TREE_CODE (field_type) == UNION_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); last_field_type);
done = 1; done = 1;
break; break;
...@@ -628,7 +628,7 @@ sort_base_init (t, base_init_list, rbase_ptr, vbase_ptr) ...@@ -628,7 +628,7 @@ sort_base_init (t, base_init_list, rbase_ptr, vbase_ptr)
} }
else if (binfo == base_binfo) else if (binfo == base_binfo)
{ {
cp_error ("base class `%T' already initialized", error ("base class `%T' already initialized",
BINFO_TYPE (binfo)); BINFO_TYPE (binfo));
break; break;
} }
...@@ -699,7 +699,7 @@ emit_base_init (mem_init_list, base_init_list) ...@@ -699,7 +699,7 @@ emit_base_init (mem_init_list, base_init_list)
init = NULL_TREE; init = NULL_TREE;
if (extra_warnings if (extra_warnings
&& DECL_COPY_CONSTRUCTOR_P (current_function_decl)) && 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)); BINFO_TYPE (base_binfo));
} }
...@@ -742,7 +742,7 @@ emit_base_init (mem_init_list, base_init_list) ...@@ -742,7 +742,7 @@ emit_base_init (mem_init_list, base_init_list)
if (warn_ecpp && init == NULL_TREE if (warn_ecpp && init == NULL_TREE
&& !DECL_ARTIFICIAL (member) && !DECL_ARTIFICIAL (member)
&& TREE_CODE (TREE_TYPE (member)) != ARRAY_TYPE) && 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); perform_member_init (member, init, from_init_list);
...@@ -984,13 +984,13 @@ member_init_ok_or_else (field, type, member_name) ...@@ -984,13 +984,13 @@ member_init_ok_or_else (field, type, member_name)
return 0; return 0;
if (field == NULL_TREE || initializing_context (field) != type) 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); member_name);
return 0; return 0;
} }
if (TREE_STATIC (field)) 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); field);
return 0; return 0;
} }
...@@ -1029,14 +1029,14 @@ expand_member_init (exp, name, init) ...@@ -1029,14 +1029,14 @@ expand_member_init (exp, name, init)
switch (CLASSTYPE_N_BASECLASSES (type)) switch (CLASSTYPE_N_BASECLASSES (type))
{ {
case 0: case 0:
cp_error ("unnamed initializer for `%T', which has no base classes", error ("unnamed initializer for `%T', which has no base classes",
type); type);
return NULL_TREE; return NULL_TREE;
case 1: case 1:
basetype = TYPE_BINFO_BASETYPE (type, 0); basetype = TYPE_BINFO_BASETYPE (type, 0);
break; break;
default: default:
cp_error ("unnamed initializer for `%T', which uses multiple inheritance", error ("unnamed initializer for `%T', which uses multiple inheritance",
type); type);
return NULL_TREE; return NULL_TREE;
} }
...@@ -1065,10 +1065,10 @@ expand_member_init (exp, name, init) ...@@ -1065,10 +1065,10 @@ expand_member_init (exp, name, init)
else else
{ {
if (TYPE_USES_VIRTUAL_BASECLASSES (type)) 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); name, type);
else else
cp_error ("type `%D' is not a direct base of `%T'", error ("type `%D' is not a direct base of `%T'",
name, type); name, type);
return NULL_TREE; return NULL_TREE;
} }
...@@ -1162,7 +1162,7 @@ build_aggr_init (exp, init, flags) ...@@ -1162,7 +1162,7 @@ build_aggr_init (exp, init, flags)
COMPLEX zees(1.0, 0.0)[10]; COMPLEX zees(1.0, 0.0)[10];
} }
*/ */
cp_error ("bad array initializer"); error ("bad array initializer");
return error_mark_node; return error_mark_node;
} }
if (cp_type_quals (type) != TYPE_UNQUALIFIED) if (cp_type_quals (type) != TYPE_UNQUALIFIED)
...@@ -1354,7 +1354,7 @@ is_aggr_type (type, or_else) ...@@ -1354,7 +1354,7 @@ is_aggr_type (type, or_else)
&& TREE_CODE (type) != BOUND_TEMPLATE_TEMPLATE_PARM) && TREE_CODE (type) != BOUND_TEMPLATE_TEMPLATE_PARM)
{ {
if (or_else) if (or_else)
cp_error ("`%T' is not an aggregate type", type); error ("`%T' is not an aggregate type", type);
return 0; return 0;
} }
return 1; return 1;
...@@ -1377,7 +1377,7 @@ get_aggr_from_typedef (name, or_else) ...@@ -1377,7 +1377,7 @@ get_aggr_from_typedef (name, or_else)
else else
{ {
if (or_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; return NULL_TREE;
} }
...@@ -1386,7 +1386,7 @@ get_aggr_from_typedef (name, or_else) ...@@ -1386,7 +1386,7 @@ get_aggr_from_typedef (name, or_else)
&& TREE_CODE (type) != BOUND_TEMPLATE_TEMPLATE_PARM) && TREE_CODE (type) != BOUND_TEMPLATE_TEMPLATE_PARM)
{ {
if (or_else) 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 NULL_TREE;
} }
return type; return type;
...@@ -1488,7 +1488,7 @@ build_member_call (type, name, parmlist) ...@@ -1488,7 +1488,7 @@ build_member_call (type, name, parmlist)
if (dtor) if (dtor)
{ {
cp_error ("cannot call destructor `%T::~%T' without object", type, error ("cannot call destructor `%T::~%T' without object", type,
method_name); method_name);
return error_mark_node; return error_mark_node;
} }
...@@ -1530,7 +1530,7 @@ build_member_call (type, name, parmlist) ...@@ -1530,7 +1530,7 @@ build_member_call (type, name, parmlist)
{ {
if (is_dummy_object (decl)) 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; return error_mark_node;
} }
decl = build (COMPONENT_REF, TREE_TYPE (t), decl, t); decl = build (COMPONENT_REF, TREE_TYPE (t), decl, t);
...@@ -1539,7 +1539,7 @@ build_member_call (type, name, parmlist) ...@@ -1539,7 +1539,7 @@ build_member_call (type, name, parmlist)
decl = t; decl = t;
else else
{ {
cp_error ("invalid use of member `%D'", t); error ("invalid use of member `%D'", t);
return error_mark_node; return error_mark_node;
} }
if (TYPE_LANG_SPECIFIC (TREE_TYPE (decl))) if (TYPE_LANG_SPECIFIC (TREE_TYPE (decl)))
...@@ -1549,7 +1549,7 @@ build_member_call (type, name, parmlist) ...@@ -1549,7 +1549,7 @@ build_member_call (type, name, parmlist)
} }
else else
{ {
cp_error ("no method `%T::%D'", type, name); error ("no method `%T::%D'", type, name);
return error_mark_node; return error_mark_node;
} }
} }
...@@ -1634,7 +1634,7 @@ build_offset_ref (type, name) ...@@ -1634,7 +1634,7 @@ build_offset_ref (type, name)
if (TREE_CODE (name) == BIT_NOT_EXPR) if (TREE_CODE (name) == BIT_NOT_EXPR)
{ {
if (! check_dtor_name (type, name)) 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)); type, TREE_OPERAND (name, 0));
name = dtor_identifier; name = dtor_identifier;
} }
...@@ -1642,7 +1642,7 @@ build_offset_ref (type, name) ...@@ -1642,7 +1642,7 @@ build_offset_ref (type, name)
if (!COMPLETE_TYPE_P (complete_type (type)) if (!COMPLETE_TYPE_P (complete_type (type))
&& !TYPE_BEING_DEFINED (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); name);
return error_mark_node; return error_mark_node;
} }
...@@ -1711,7 +1711,7 @@ build_offset_ref (type, name) ...@@ -1711,7 +1711,7 @@ build_offset_ref (type, name)
if (t == NULL_TREE) 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; return error_mark_node;
} }
...@@ -1730,7 +1730,7 @@ build_offset_ref (type, name) ...@@ -1730,7 +1730,7 @@ build_offset_ref (type, name)
if (TREE_CODE (t) == FIELD_DECL && DECL_C_BIT_FIELD (t)) 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; return error_mark_node;
} }
...@@ -1859,7 +1859,7 @@ resolve_offset_ref (exp) ...@@ -1859,7 +1859,7 @@ resolve_offset_ref (exp)
{ {
if (addr == error_mark_node) if (addr == error_mark_node)
{ {
cp_error ("object missing in `%E'", exp); error ("object missing in `%E'", exp);
return error_mark_node; return error_mark_node;
} }
...@@ -2416,7 +2416,7 @@ build_new_1 (exp) ...@@ -2416,7 +2416,7 @@ build_new_1 (exp)
if (init == void_zero_node) if (init == void_zero_node)
init = build_default_init (full_type); init = build_default_init (full_type);
else if (init && pedantic && has_array) 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) if (has_array)
init_expr = build_vec_init (init_expr, init, 0); init_expr = build_vec_init (init_expr, init, 0);
...@@ -2515,7 +2515,7 @@ build_new_1 (exp) ...@@ -2515,7 +2515,7 @@ build_new_1 (exp)
} }
} }
else if (CP_TYPE_CONST_P (true_type)) 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. */ /* Now build up the return value in reverse order. */
......
...@@ -1000,7 +1000,7 @@ check_for_missing_semicolon (type) ...@@ -1000,7 +1000,7 @@ check_for_missing_semicolon (type)
error ("semicolon missing after %s declaration", error ("semicolon missing after %s declaration",
TREE_CODE (type) == ENUMERAL_TYPE ? "enum" : "struct"); TREE_CODE (type) == ENUMERAL_TYPE ? "enum" : "struct");
else 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)); shadow_tag (build_tree_list (0, type));
} }
/* Could probably also hack cases where class { ... } f (); appears. */ /* Could probably also hack cases where class { ... } f (); appears. */
...@@ -1248,12 +1248,12 @@ do_identifier (token, parsing, args) ...@@ -1248,12 +1248,12 @@ do_identifier (token, parsing, args)
else if (IDENTIFIER_OPNAME_P (token)) else if (IDENTIFIER_OPNAME_P (token))
{ {
if (token != ansi_opname (ERROR_MARK)) if (token != ansi_opname (ERROR_MARK))
cp_error ("`%D' not defined", token); error ("`%D' not defined", token);
id = error_mark_node; id = error_mark_node;
} }
else if (current_function_decl == 0) 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; id = error_mark_node;
} }
else else
...@@ -1263,7 +1263,7 @@ do_identifier (token, parsing, args) ...@@ -1263,7 +1263,7 @@ do_identifier (token, parsing, args)
{ {
static int undeclared_variable_notice; 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) if (! undeclared_variable_notice)
{ {
...@@ -1378,7 +1378,7 @@ do_scoped_id (token, parsing) ...@@ -1378,7 +1378,7 @@ do_scoped_id (token, parsing)
return id; return id;
} }
if (IDENTIFIER_NAMESPACE_VALUE (token) != error_mark_node) 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; id = error_mark_node;
/* Prevent repeated error messages. */ /* Prevent repeated error messages. */
SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node); SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node);
......
...@@ -185,13 +185,13 @@ hack_identifier (value, name) ...@@ -185,13 +185,13 @@ hack_identifier (value, name)
{ {
if (current_function_decl if (current_function_decl
&& DECL_STATIC_FUNCTION_P (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); value);
else else
/* We can get here when processing a bad default /* We can get here when processing a bad default
argument, like: argument, like:
struct S { int a; void f(int i = a); } */ 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; return error_mark_node;
} }
...@@ -233,12 +233,12 @@ hack_identifier (value, name) ...@@ -233,12 +233,12 @@ hack_identifier (value, name)
} }
else if (TREE_CODE (value) == NAMESPACE_DECL) 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; return error_mark_node;
} }
else if (DECL_CLASS_TEMPLATE_P (value)) 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; return error_mark_node;
} }
else else
...@@ -251,7 +251,7 @@ hack_identifier (value, name) ...@@ -251,7 +251,7 @@ hack_identifier (value, name)
if (context != NULL_TREE && context != current_function_decl if (context != NULL_TREE && context != current_function_decl
&& ! TREE_STATIC (value)) && ! TREE_STATIC (value))
{ {
cp_error ("use of %s from containing function", error ("use of %s from containing function",
(TREE_CODE (value) == VAR_DECL (TREE_CODE (value) == VAR_DECL
? "`auto' variable" : "parameter")); ? "`auto' variable" : "parameter"));
cp_error_at (" `%#D' declared here", value); cp_error_at (" `%#D' declared here", value);
...@@ -272,7 +272,7 @@ hack_identifier (value, name) ...@@ -272,7 +272,7 @@ hack_identifier (value, name)
else if (TREE_CODE (value) == TREE_LIST else if (TREE_CODE (value) == TREE_LIST
&& TREE_TYPE (value) == error_mark_node) && TREE_TYPE (value) == error_mark_node)
{ {
cp_error ("\ error ("\
request for member `%D' is ambiguous in multiple inheritance lattice", request for member `%D' is ambiguous in multiple inheritance lattice",
name); name);
print_candidates (value); print_candidates (value);
...@@ -325,7 +325,7 @@ make_thunk (function, delta, vcall_index) ...@@ -325,7 +325,7 @@ make_thunk (function, delta, vcall_index)
thunk = IDENTIFIER_GLOBAL_VALUE (thunk_id); thunk = IDENTIFIER_GLOBAL_VALUE (thunk_id);
if (thunk && !DECL_THUNK_P (thunk)) 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; thunk = NULL_TREE;
SET_IDENTIFIER_GLOBAL_VALUE (thunk_id, thunk); SET_IDENTIFIER_GLOBAL_VALUE (thunk_id, thunk);
} }
...@@ -445,7 +445,7 @@ use_thunk (thunk_fndecl, emit_p) ...@@ -445,7 +445,7 @@ use_thunk (thunk_fndecl, emit_p)
tree a, t; tree a, t;
if (varargs_function_p (function)) 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); function);
/* Set up clone argument trees for the thunk. */ /* Set up clone argument trees for the thunk. */
...@@ -675,12 +675,12 @@ do_build_assign_ref (fndecl) ...@@ -675,12 +675,12 @@ do_build_assign_ref (fndecl)
if (CP_TYPE_CONST_P (TREE_TYPE (field))) 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; continue;
} }
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE) 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; continue;
} }
......
...@@ -498,7 +498,7 @@ extdef: ...@@ -498,7 +498,7 @@ extdef:
{ do_pending_inlines (); } { do_pending_inlines (); }
| EXPORT | EXPORT
{ cp_warning ("keyword `export' not implemented, and will be ignored"); } { warning ("keyword `export' not implemented, and will be ignored"); }
template_def template_def
{ do_pending_inlines (); } { do_pending_inlines (); }
| template_def | template_def
...@@ -602,7 +602,7 @@ extern_lang_string: ...@@ -602,7 +602,7 @@ extern_lang_string:
{ push_lang_context ($1); } { push_lang_context ($1); }
| extern_lang_string EXTERN_LANG_STRING | extern_lang_string EXTERN_LANG_STRING
{ if (current_lang_name != $2) { 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); } pop_lang_context (); push_lang_context ($2); }
; ;
...@@ -1108,7 +1108,7 @@ template_arg: ...@@ -1108,7 +1108,7 @@ template_arg:
{ {
if (!processing_template_decl) if (!processing_template_decl)
{ {
cp_error ("use of template qualifier outside template"); error ("use of template qualifier outside template");
$$ = error_mark_node; $$ = error_mark_node;
} }
else else
...@@ -1169,9 +1169,9 @@ condition: ...@@ -1169,9 +1169,9 @@ condition:
if (TREE_CODE (d) == TYPE_DECL) { if (TREE_CODE (d) == TYPE_DECL) {
tree s = TREE_TYPE (d); tree s = TREE_TYPE (d);
if (TREE_CODE (s) == RECORD_TYPE) 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) 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; current_declspecs = $1.t;
...@@ -1182,7 +1182,7 @@ condition: ...@@ -1182,7 +1182,7 @@ condition:
parse_end_decl ($<ttype>6, $7, $4); parse_end_decl ($<ttype>6, $7, $4);
$$ = convert_from_reference ($<ttype>6); $$ = convert_from_reference ($<ttype>6);
if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE) if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE)
cp_error ("definition of array `%#D' in condition", $$); error ("definition of array `%#D' in condition", $$);
} }
| expr | expr
; ;
...@@ -1291,7 +1291,7 @@ new_placement: ...@@ -1291,7 +1291,7 @@ new_placement:
'(' nonnull_exprlist ')' '(' nonnull_exprlist ')'
{ $$ = $2; } { $$ = $2; }
| '{' nonnull_exprlist '}' | '{' nonnull_exprlist '}'
{ cp_pedwarn ("old style placement syntax, use () instead"); { pedwarn ("old style placement syntax, use () instead");
$$ = $2; } $$ = $2; }
; ;
...@@ -1302,7 +1302,7 @@ new_initializer: ...@@ -1302,7 +1302,7 @@ new_initializer:
{ $$ = void_zero_node; } { $$ = void_zero_node; }
| '(' typespec ')' | '(' typespec ')'
{ {
cp_error ("`%T' is not a valid expression", $2.t); error ("`%T' is not a valid expression", $2.t);
$$ = error_mark_node; $$ = error_mark_node;
} }
/* GNU extension so people can use initializer lists. Note that /* GNU extension so people can use initializer lists. Note that
...@@ -2275,7 +2275,7 @@ structsp: ...@@ -2275,7 +2275,7 @@ structsp:
{ $$.t = $2; { $$.t = $2;
$$.new_type_flag = 0; $$.new_type_flag = 0;
if (!processing_template_decl) 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 */ /* C++ extensions, merged with C to avoid shift/reduce conflicts */
| class_head '{' | class_head '{'
{ $1.t = begin_class_definition ($1.t); { $1.t = begin_class_definition ($1.t);
...@@ -2319,7 +2319,7 @@ structsp: ...@@ -2319,7 +2319,7 @@ structsp:
$$.t = $1.t; $$.t = $1.t;
else if (TYPE_BINFO ($1.t) == NULL_TREE) 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; $$.t = error_mark_node;
} }
else else
...@@ -2330,7 +2330,7 @@ structsp: ...@@ -2330,7 +2330,7 @@ structsp:
&& TYPE_BINFO_BASETYPES ($$.t) && TYPE_BINFO_BASETYPES ($$.t)
&& !COMPLETE_TYPE_P ($$.t) && !COMPLETE_TYPE_P ($$.t)
&& ! TYPE_BEING_DEFINED ($$.t)) && ! TYPE_BEING_DEFINED ($$.t))
cp_error ("base clause without member specification for `%#T'", error ("base clause without member specification for `%#T'",
$$.t); $$.t);
} }
} }
...@@ -2448,7 +2448,7 @@ named_class_head: ...@@ -2448,7 +2448,7 @@ named_class_head:
$$.new_type_flag = $1.new_type_flag; $$.new_type_flag = $1.new_type_flag;
if ((current_aggr == union_type_node) if ((current_aggr == union_type_node)
!= (TREE_CODE (type) == UNION_TYPE)) != (TREE_CODE (type) == UNION_TYPE))
cp_pedwarn (current_aggr == union_type_node pedwarn (current_aggr == union_type_node
? "`union' tag used in declaring `%#T'" ? "`union' tag used in declaring `%#T'"
: "non-`union' tag used in declaring `%#T'", : "non-`union' tag used in declaring `%#T'",
type); type);
...@@ -2524,7 +2524,7 @@ base_class_access_list: ...@@ -2524,7 +2524,7 @@ base_class_access_list:
VISSPEC see_typename VISSPEC see_typename
| SCSPEC see_typename | SCSPEC see_typename
{ if ($1 != ridpointers[(int)RID_VIRTUAL]) { if ($1 != ridpointers[(int)RID_VIRTUAL])
cp_error ("`%D' access", $1); error ("`%D' access", $1);
$$ = access_default_virtual_node; } $$ = access_default_virtual_node; }
| base_class_access_list VISSPEC see_typename | base_class_access_list VISSPEC see_typename
{ {
...@@ -2539,7 +2539,7 @@ base_class_access_list: ...@@ -2539,7 +2539,7 @@ base_class_access_list:
} }
| base_class_access_list SCSPEC see_typename | base_class_access_list SCSPEC see_typename
{ if ($2 != ridpointers[(int)RID_VIRTUAL]) { if ($2 != ridpointers[(int)RID_VIRTUAL])
cp_error ("`%D' access", $2); error ("`%D' access", $2);
else if ($$ == access_public_node) else if ($$ == access_public_node)
$$ = access_public_virtual_node; $$ = access_public_virtual_node;
else if ($$ == access_protected_node) else if ($$ == access_protected_node)
...@@ -3085,7 +3085,7 @@ typename_sub0: ...@@ -3085,7 +3085,7 @@ typename_sub0:
if (TYPE_P ($1)) if (TYPE_P ($1))
$$ = make_typename_type ($1, $2, /*complain=*/1); $$ = make_typename_type ($1, $2, /*complain=*/1);
else if (TREE_CODE ($2) == IDENTIFIER_NODE) 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 else
{ {
$$ = $2; $$ = $2;
...@@ -3105,7 +3105,7 @@ typename_sub1: ...@@ -3105,7 +3105,7 @@ typename_sub1:
typename_sub2 typename_sub2
{ {
if (TREE_CODE ($1) == IDENTIFIER_NODE) 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) else if (TREE_CODE ($1) == TYPE_DECL)
$$ = TREE_TYPE ($1); $$ = TREE_TYPE ($1);
} }
...@@ -3114,7 +3114,7 @@ typename_sub1: ...@@ -3114,7 +3114,7 @@ typename_sub1:
if (TYPE_P ($1)) if (TYPE_P ($1))
$$ = make_typename_type ($1, $2, /*complain=*/1); $$ = make_typename_type ($1, $2, /*complain=*/1);
else if (TREE_CODE ($2) == IDENTIFIER_NODE) 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 else
{ {
$$ = $2; $$ = $2;
...@@ -3143,7 +3143,7 @@ typename_sub2: ...@@ -3143,7 +3143,7 @@ typename_sub2:
got_scope = complete_type (TREE_TYPE ($$)); got_scope = complete_type (TREE_TYPE ($$));
if ($$ == error_mark_node) 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 | SELFNAME SCOPE
{ {
...@@ -3770,7 +3770,7 @@ bad_parm: ...@@ -3770,7 +3770,7 @@ bad_parm:
if (TREE_CODE ($$) == SCOPE_REF if (TREE_CODE ($$) == SCOPE_REF
&& (TREE_CODE (TREE_OPERAND ($$, 0)) == TEMPLATE_TYPE_PARM && (TREE_CODE (TREE_OPERAND ($$, 0)) == TEMPLATE_TYPE_PARM
|| TREE_CODE (TREE_OPERAND ($$, 0)) == BOUND_TEMPLATE_TEMPLATE_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, $$); $$ = build_tree_list (integer_type_node, $$);
} }
; ;
...@@ -3778,7 +3778,7 @@ bad_parm: ...@@ -3778,7 +3778,7 @@ bad_parm:
bad_decl: bad_decl:
IDENTIFIER template_arg_list_ignore IDENTIFIER arg_list_ignore ';' 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; $3 = error_mark_node;
} }
; ;
......
...@@ -277,7 +277,7 @@ get_tinfo_decl (type) ...@@ -277,7 +277,7 @@ get_tinfo_decl (type)
if (COMPLETE_TYPE_P (type) if (COMPLETE_TYPE_P (type)
&& TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) && 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); type);
return error_mark_node; return error_mark_node;
} }
...@@ -522,7 +522,7 @@ build_dynamic_cast_1 (type, expr) ...@@ -522,7 +522,7 @@ build_dynamic_cast_1 (type, expr)
&& TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE) && TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE)
{ {
tree expr = throw_bad_cast (); 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); old_expr, type);
/* Bash it to the expected type. */ /* Bash it to the expected type. */
TREE_TYPE (expr) = type; TREE_TYPE (expr) = type;
...@@ -536,7 +536,7 @@ build_dynamic_cast_1 (type, expr) ...@@ -536,7 +536,7 @@ build_dynamic_cast_1 (type, expr)
if (TREE_CODE (op) == VAR_DECL if (TREE_CODE (op) == VAR_DECL
&& TREE_CODE (TREE_TYPE (op)) == RECORD_TYPE) && 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); op, type);
retval = build_int_2 (0, 0); retval = build_int_2 (0, 0);
TREE_TYPE (retval) = type; TREE_TYPE (retval) = type;
...@@ -611,7 +611,7 @@ build_dynamic_cast_1 (type, expr) ...@@ -611,7 +611,7 @@ build_dynamic_cast_1 (type, expr)
errstr = "source type is not polymorphic"; errstr = "source type is not polymorphic";
fail: 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); expr, exprtype, type, errstr);
return error_mark_node; return error_mark_node;
} }
......
...@@ -337,7 +337,7 @@ lookup_base (t, base, access, kind_ptr) ...@@ -337,7 +337,7 @@ lookup_base (t, base, access, kind_ptr)
binfo = NULL_TREE; binfo = NULL_TREE;
if (!(access & ba_quiet)) 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; binfo = error_mark_node;
} }
break; break;
...@@ -347,7 +347,7 @@ lookup_base (t, base, access, kind_ptr) ...@@ -347,7 +347,7 @@ lookup_base (t, base, access, kind_ptr)
binfo = NULL_TREE; binfo = NULL_TREE;
if (!(access & ba_quiet)) 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; binfo = error_mark_node;
} }
} }
...@@ -1456,7 +1456,7 @@ lookup_member (xbasetype, name, protect, want_type) ...@@ -1456,7 +1456,7 @@ lookup_member (xbasetype, name, protect, want_type)
if (errstr && protect) if (errstr && protect)
{ {
cp_error (errstr, name, type); error (errstr, name, type);
if (lfi.ambiguous) if (lfi.ambiguous)
print_candidates (lfi.ambiguous); print_candidates (lfi.ambiguous);
rval = error_mark_node; rval = error_mark_node;
...@@ -2127,7 +2127,7 @@ get_pure_virtuals (type) ...@@ -2127,7 +2127,7 @@ get_pure_virtuals (type)
{ {
tree base_fndecl = BV_FN (virtuals); tree base_fndecl = BV_FN (virtuals);
if (DECL_NEEDS_FINAL_OVERRIDER_P (base_fndecl)) 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, ...@@ -878,7 +878,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
if (cv_qualifier != NULL_TREE if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE]) && cv_qualifier != ridpointers[(int) RID_VOLATILE])
{ {
cp_warning ("%s qualifier ignored on asm", warning ("%s qualifier ignored on asm",
IDENTIFIER_POINTER (cv_qualifier)); IDENTIFIER_POINTER (cv_qualifier));
cv_qualifier = NULL_TREE; cv_qualifier = NULL_TREE;
} }
...@@ -900,7 +900,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands, ...@@ -900,7 +900,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
resolve the overloading. */ resolve the overloading. */
if (TREE_TYPE (converted_operand) == unknown_type_node) 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)); TREE_VALUE (t));
converted_operand = error_mark_node; converted_operand = error_mark_node;
} }
...@@ -1051,7 +1051,7 @@ finish_named_return_value (return_id, init) ...@@ -1051,7 +1051,7 @@ finish_named_return_value (return_id, init)
DECL_NAME (decl) = return_id; DECL_NAME (decl) = return_id;
else else
{ {
cp_error ("return identifier `%D' already in place", return_id); error ("return identifier `%D' already in place", return_id);
return; return;
} }
} }
...@@ -1126,7 +1126,7 @@ finish_mem_initializers (init_list) ...@@ -1126,7 +1126,7 @@ finish_mem_initializers (init_list)
base != last_base_warned_about; base != last_base_warned_about;
base = TREE_CHAIN (base)) base = TREE_CHAIN (base))
{ {
cp_warning ("base initializer for `%T'", warning ("base initializer for `%T'",
TREE_PURPOSE (base)); TREE_PURPOSE (base));
warning (" will be re-ordered to precede member initializations"); warning (" will be re-ordered to precede member initializations");
} }
...@@ -1444,7 +1444,7 @@ finish_object_call_expr (fn, object, args) ...@@ -1444,7 +1444,7 @@ finish_object_call_expr (fn, object, args)
fn = DECL_NAME (fn); fn = DECL_NAME (fn);
else else
{ {
cp_error ("calling type `%T' like a method", fn); error ("calling type `%T' like a method", fn);
return error_mark_node; return error_mark_node;
} }
} }
...@@ -1480,13 +1480,13 @@ finish_pseudo_destructor_call_expr (object, scope, destructor) ...@@ -1480,13 +1480,13 @@ finish_pseudo_destructor_call_expr (object, scope, destructor)
return build_min_nt (PSEUDO_DTOR_EXPR, object, scope, destructor); return build_min_nt (PSEUDO_DTOR_EXPR, object, scope, destructor);
if (scope && 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); scope, destructor);
if ((scope == NULL_TREE || IDENTIFIER_GLOBAL_VALUE (destructor)) if ((scope == NULL_TREE || IDENTIFIER_GLOBAL_VALUE (destructor))
&& (TREE_CODE (TREE_TYPE (object)) != && (TREE_CODE (TREE_TYPE (object)) !=
TREE_CODE (TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (destructor))))) 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); return cp_convert (void_type_node, object);
} }
...@@ -1757,7 +1757,7 @@ begin_class_definition (t) ...@@ -1757,7 +1757,7 @@ begin_class_definition (t)
if (processing_template_parmlist) 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; return error_mark_node;
} }
...@@ -1773,7 +1773,7 @@ begin_class_definition (t) ...@@ -1773,7 +1773,7 @@ begin_class_definition (t)
This is erroneous. */ This is erroneous. */
else if (TREE_CODE (t) == TYPENAME_TYPE) 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; t = error_mark_node;
} }
...@@ -2125,7 +2125,7 @@ finish_base_specifier (access_specifier, base_class) ...@@ -2125,7 +2125,7 @@ finish_base_specifier (access_specifier, base_class)
{ {
if (cp_type_quals (base_class) != 0) 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); base_class = TYPE_MAIN_VARIANT (base_class);
} }
result = build_tree_list (access_specifier, base_class); result = build_tree_list (access_specifier, base_class);
...@@ -2158,7 +2158,7 @@ check_multiple_declarators () ...@@ -2158,7 +2158,7 @@ check_multiple_declarators ()
if (PROCESSING_REAL_TEMPLATE_DECL_P () if (PROCESSING_REAL_TEMPLATE_DECL_P ()
|| processing_explicit_instantiation || processing_explicit_instantiation
|| processing_specialization) || 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 /* Implement the __typeof keyword: Return the type of EXPR, suitable for
......
...@@ -1432,7 +1432,7 @@ replace_defarg (arg, init) ...@@ -1432,7 +1432,7 @@ replace_defarg (arg, init)
{ {
if (! processing_template_decl if (! processing_template_decl
&& ! can_convert_arg (TREE_VALUE (arg), TREE_TYPE (init), init)) && ! 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)); TREE_TYPE (init), TREE_VALUE (arg));
if (!defarg_depfns) if (!defarg_depfns)
TREE_PURPOSE (arg) = init; TREE_PURPOSE (arg) = init;
......
...@@ -533,7 +533,7 @@ cp_build_qualified_type_real (type, type_quals, complain) ...@@ -533,7 +533,7 @@ cp_build_qualified_type_real (type, type_quals, complain)
|| TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)) || TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE))
{ {
if (complain) if (complain)
cp_error ("`%T' cannot be `restrict'-qualified", type); error ("`%T' cannot be `restrict'-qualified", type);
else else
return error_mark_node; return error_mark_node;
...@@ -544,7 +544,7 @@ cp_build_qualified_type_real (type, type_quals, complain) ...@@ -544,7 +544,7 @@ cp_build_qualified_type_real (type, type_quals, complain)
&& TREE_CODE (type) == FUNCTION_TYPE) && TREE_CODE (type) == FUNCTION_TYPE)
{ {
if (complain) if (complain)
cp_error ("`%T' cannot be `const'-, `volatile'-, or `restrict'-qualified", type); error ("`%T' cannot be `const'-, `volatile'-, or `restrict'-qualified", type);
else else
return error_mark_node; return error_mark_node;
type_quals = TYPE_UNQUALIFIED; type_quals = TYPE_UNQUALIFIED;
......
...@@ -51,7 +51,7 @@ error_not_base_type (basetype, type) ...@@ -51,7 +51,7 @@ error_not_base_type (basetype, type)
{ {
if (TREE_CODE (basetype) == FUNCTION_DECL) if (TREE_CODE (basetype) == FUNCTION_DECL)
basetype = DECL_CONTEXT (basetype); 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; return error_mark_node;
} }
...@@ -83,9 +83,9 @@ readonly_error (arg, string, soft) ...@@ -83,9 +83,9 @@ readonly_error (arg, string, soft)
void (*fn) PARAMS ((const char *, ...)); void (*fn) PARAMS ((const char *, ...));
if (soft) if (soft)
fn = cp_pedwarn; fn = pedwarn;
else else
fn = cp_error; fn = error;
if (TREE_CODE (arg) == COMPONENT_REF) if (TREE_CODE (arg) == COMPONENT_REF)
{ {
...@@ -148,22 +148,22 @@ abstract_virtuals_error (decl, type) ...@@ -148,22 +148,22 @@ abstract_virtuals_error (decl, type)
return 0; return 0;
if (TREE_CODE (decl) == VAR_DECL) 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); decl, type);
else if (TREE_CODE (decl) == PARM_DECL) 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); decl, type);
else if (TREE_CODE (decl) == FIELD_DECL) 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); decl, type);
else if (TREE_CODE (decl) == FUNCTION_DECL else if (TREE_CODE (decl) == FUNCTION_DECL
&& TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE) && 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) 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 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. */ /* Only go through this once. */
if (TREE_PURPOSE (u) == NULL_TREE) if (TREE_PURPOSE (u) == NULL_TREE)
...@@ -175,7 +175,7 @@ abstract_virtuals_error (decl, type) ...@@ -175,7 +175,7 @@ abstract_virtuals_error (decl, type)
cp_error_at ("\t%#D", TREE_VALUE (tu)); cp_error_at ("\t%#D", TREE_VALUE (tu));
} }
else else
cp_error (" since type `%T' has abstract virtual functions", type); error (" since type `%T' has abstract virtual functions", type);
return 1; return 1;
} }
...@@ -210,12 +210,12 @@ retry: ...@@ -210,12 +210,12 @@ retry:
case UNION_TYPE: case UNION_TYPE:
case ENUMERAL_TYPE: case ENUMERAL_TYPE:
if (!decl) 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); cp_error_at ("forward declaration of `%#T'", type);
break; break;
case VOID_TYPE: case VOID_TYPE:
cp_error ("invalid use of `%T'", type); error ("invalid use of `%T'", type);
break; break;
case ARRAY_TYPE: case ARRAY_TYPE:
...@@ -224,27 +224,27 @@ retry: ...@@ -224,27 +224,27 @@ retry:
type = TREE_TYPE (type); type = TREE_TYPE (type);
goto retry; goto retry;
} }
cp_error ("invalid use of array with unspecified bounds"); error ("invalid use of array with unspecified bounds");
break; break;
case OFFSET_TYPE: case OFFSET_TYPE:
bad_member: bad_member:
cp_error ("invalid use of member (did you forget the `&' ?)"); error ("invalid use of member (did you forget the `&' ?)");
break; break;
case TEMPLATE_TYPE_PARM: case TEMPLATE_TYPE_PARM:
cp_error ("invalid use of template type parameter"); error ("invalid use of template type parameter");
break; break;
case UNKNOWN_TYPE: case UNKNOWN_TYPE:
if (value && TREE_CODE (value) == COMPONENT_REF) if (value && TREE_CODE (value) == COMPONENT_REF)
goto bad_member; goto bad_member;
else if (value && TREE_CODE (value) == ADDR_EXPR) 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) 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 else
cp_error ("insufficient contextual information to determine type"); error ("insufficient contextual information to determine type");
break; break;
default: default:
...@@ -322,7 +322,7 @@ store_init_value (decl, init) ...@@ -322,7 +322,7 @@ store_init_value (decl, init)
if (TREE_CODE (init) == TREE_LIST) 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)); init = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (init));
} }
#if 0 #if 0
...@@ -576,10 +576,10 @@ digest_init (type, init, tail) ...@@ -576,10 +576,10 @@ digest_init (type, init, tail)
} }
while (TREE_CODE (init) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (init)) 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); init = CONSTRUCTOR_ELTS (init);
if (TREE_CHAIN (init)) if (TREE_CHAIN (init))
cp_pedwarn ("ignoring extra initializers for `%T'", type); pedwarn ("ignoring extra initializers for `%T'", type);
init = TREE_VALUE (init); init = TREE_VALUE (init);
} }
...@@ -591,7 +591,7 @@ digest_init (type, init, tail) ...@@ -591,7 +591,7 @@ digest_init (type, init, tail)
if (COMPLETE_TYPE_P (type) && ! TREE_CONSTANT (TYPE_SIZE (type))) 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); type);
return error_mark_node; return error_mark_node;
} }
...@@ -601,7 +601,7 @@ digest_init (type, init, tail) ...@@ -601,7 +601,7 @@ digest_init (type, init, tail)
if (raw_constructor && TYPE_NON_AGGREGATE_CLASS (type) if (raw_constructor && TYPE_NON_AGGREGATE_CLASS (type)
&& TREE_HAS_CONSTRUCTOR (init)) && 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); type, init);
return error_mark_node; return error_mark_node;
} }
...@@ -839,24 +839,24 @@ process_init_constructor (type, init, elts) ...@@ -839,24 +839,24 @@ process_init_constructor (type, init, elts)
/* Warn when some struct elements are implicitly initialized. */ /* Warn when some struct elements are implicitly initialized. */
if (extra_warnings if (extra_warnings
&& (!init || TREE_HAS_CONSTRUCTOR (init))) && (!init || TREE_HAS_CONSTRUCTOR (init)))
cp_warning ("missing initializer for member `%D'", field); warning ("missing initializer for member `%D'", field);
} }
else else
{ {
if (TREE_READONLY (field)) 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)) else if (TYPE_LANG_SPECIFIC (TREE_TYPE (field))
&& CLASSTYPE_READONLY_FIELDS_NEED_INIT (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); field);
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE) 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 /* Warn when some struct elements are implicitly initialized
to zero. */ to zero. */
if (extra_warnings if (extra_warnings
&& (!init || TREE_HAS_CONSTRUCTOR (init))) && (!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 /* The default zero-initialization is fine for us; don't
add anything to the CONSTRUCTOR. */ add anything to the CONSTRUCTOR. */
...@@ -905,7 +905,7 @@ process_init_constructor (type, init, elts) ...@@ -905,7 +905,7 @@ process_init_constructor (type, init, elts)
if (temp) if (temp)
field = temp, win = 1; field = temp, win = 1;
else else
cp_error ("no field `%D' in union being initialized", error ("no field `%D' in union being initialized",
TREE_PURPOSE (tail)); TREE_PURPOSE (tail));
} }
if (!win) if (!win)
...@@ -913,7 +913,7 @@ process_init_constructor (type, init, elts) ...@@ -913,7 +913,7 @@ process_init_constructor (type, init, elts)
} }
else if (field == 0) 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); type);
TREE_VALUE (tail) = error_mark_node; TREE_VALUE (tail) = error_mark_node;
} }
...@@ -1067,7 +1067,7 @@ build_x_arrow (datum) ...@@ -1067,7 +1067,7 @@ build_x_arrow (datum)
if (last_rval == NULL_TREE) 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; return error_mark_node;
} }
...@@ -1131,15 +1131,15 @@ build_m_component_ref (datum, component) ...@@ -1131,15 +1131,15 @@ build_m_component_ref (datum, component)
} }
else 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)); component, TREE_TYPE (component));
return error_mark_node; return error_mark_node;
} }
if (! IS_AGGR_TYPE (objtype)) if (! IS_AGGR_TYPE (objtype))
{ {
cp_error ("cannot apply member pointer `%E' to `%E'", component, datum); error ("cannot apply member pointer `%E' to `%E'", component, datum);
cp_error ("which is of non-aggregate type `%T'", objtype); error ("which is of non-aggregate type `%T'", objtype);
return error_mark_node; return error_mark_node;
} }
...@@ -1147,7 +1147,7 @@ build_m_component_ref (datum, component) ...@@ -1147,7 +1147,7 @@ build_m_component_ref (datum, component)
ba_check, NULL); ba_check, NULL);
if (!binfo) 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); TYPE_METHOD_BASETYPE (type), objtype);
return error_mark_node; return error_mark_node;
} }
...@@ -1201,7 +1201,7 @@ build_functional_cast (exp, parms) ...@@ -1201,7 +1201,7 @@ build_functional_cast (exp, parms)
type = lookup_name (exp, 1); type = lookup_name (exp, 1);
if (!type || TREE_CODE (type) != TYPE_DECL) 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; return error_mark_node;
} }
type = TREE_TYPE (type); type = TREE_TYPE (type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment