Commit 94be8403 by Gabriel Dos Reis Committed by Gabriel Dos Reis

* call.c (tourney, build_field_call, equal_functions, joust)

	(compare_ics, build_over_call, build_java_interface_fn_ref)
	(convert_like_real, op_error, build_object_call, resolve_args)
	(build_vfield_ref, check_dtor_name, build_scoped_method_call)
	(build_addr_func, build_call, build_method_call, null_ptr_cst_p)
	(sufficient_parms_p, build_conv, non_reference, strip_top_quals)
	(standard_conversion, reference_related_p)
	(reference_compatible_p, convert_class_to_reference)
	(direct_reference_binding, reference_binding)
	(implicit_conversion, is_complete, promoted_arithmetic_type_p)
	(add_template_conv_candidate, any_viable, any_strictly_viable)
	(build_this, splice_viable, print_z_candidates)
	(build_user_type_conversion, build_new_function_call)
	(conditional_conversion, build_conditional_expr, build_new_op)
	(build_op_delete_call, enforce_access, call_builtin_trap)
	(convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to)
	(convert_default_arg, type_passed_as, convert_for_arg_passing)
	(in_charge_arg_for_name, is_properly_derived_from)
	(maybe_handle_implicit_object, maybe_handle_ref_bind)
	(source_type, add_warning, can_convert, can_convert_arg)
	(perform_implicit_conversion, can_convert_arg_bad)
	(initialize_reference, add_conv_candidate)
	(add_template_candidate_real, add_template_candidate): Ansify.

From-SVN: r60458
parent c9693e96
2002-12-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
* call.c (tourney, build_field_call, equal_functions, joust)
(compare_ics, build_over_call, build_java_interface_fn_ref)
(convert_like_real, op_error, build_object_call, resolve_args)
(build_vfield_ref, check_dtor_name, build_scoped_method_call)
(build_addr_func, build_call, build_method_call, null_ptr_cst_p)
(sufficient_parms_p, build_conv, non_reference, strip_top_quals)
(standard_conversion, reference_related_p)
(reference_compatible_p, convert_class_to_reference)
(direct_reference_binding, reference_binding)
(implicit_conversion, is_complete, promoted_arithmetic_type_p)
(add_template_conv_candidate, any_viable, any_strictly_viable)
(build_this, splice_viable, print_z_candidates)
(build_user_type_conversion, build_new_function_call)
(conditional_conversion, build_conditional_expr, build_new_op)
(build_op_delete_call, enforce_access, call_builtin_trap)
(convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to)
(convert_default_arg, type_passed_as, convert_for_arg_passing)
(in_charge_arg_for_name, is_properly_derived_from)
(maybe_handle_implicit_object, maybe_handle_ref_bind)
(source_type, add_warning, can_convert, can_convert_arg)
(perform_implicit_conversion, can_convert_arg_bad)
(initialize_reference, add_conv_candidate)
(add_template_candidate_real, add_template_candidate): Ansify.
2002-12-22 Nathan Sidwell <nathan@codesourcery.com> 2002-12-22 Nathan Sidwell <nathan@codesourcery.com>
PR c++/8572 PR c++/8572
......
...@@ -40,74 +40,72 @@ Boston, MA 02111-1307, USA. */ ...@@ -40,74 +40,72 @@ Boston, MA 02111-1307, USA. */
extern int inhibit_warnings; extern int inhibit_warnings;
static tree build_field_call PARAMS ((tree, tree, tree)); static tree build_field_call (tree, tree, tree);
static struct z_candidate * tourney PARAMS ((struct z_candidate *)); static struct z_candidate * tourney (struct z_candidate *);
static int equal_functions PARAMS ((tree, tree)); static int equal_functions (tree, tree);
static int joust PARAMS ((struct z_candidate *, struct z_candidate *, int)); static int joust (struct z_candidate *, struct z_candidate *, bool);
static int compare_ics PARAMS ((tree, tree)); static int compare_ics (tree, tree);
static tree build_over_call PARAMS ((struct z_candidate *, tree, int)); static tree build_over_call (struct z_candidate *, tree, int);
static tree build_java_interface_fn_ref PARAMS ((tree, tree)); static tree build_java_interface_fn_ref (tree, tree);
#define convert_like(CONV, EXPR) \ #define convert_like(CONV, EXPR) \
convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0) convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0)
#define convert_like_with_context(CONV, EXPR, FN, ARGNO) \ #define convert_like_with_context(CONV, EXPR, FN, ARGNO) \
convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0) convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0)
static tree convert_like_real PARAMS ((tree, tree, tree, int, int)); static tree convert_like_real (tree, tree, tree, int, int);
static void op_error PARAMS ((enum tree_code, enum tree_code, tree, tree, static void op_error (enum tree_code, enum tree_code, tree, tree,
tree, const char *)); tree, const char *);
static tree build_object_call PARAMS ((tree, tree)); static tree build_object_call (tree, tree);
static tree resolve_args PARAMS ((tree)); static tree resolve_args (tree);
static struct z_candidate * build_user_type_conversion_1 static struct z_candidate *build_user_type_conversion_1 (tree, tree, int);
PARAMS ((tree, tree, int)); static void print_z_candidates (struct z_candidate *);
static void print_z_candidates PARAMS ((struct z_candidate *)); static tree build_this (tree);
static tree build_this PARAMS ((tree)); static struct z_candidate *splice_viable (struct z_candidate *);
static struct z_candidate * splice_viable PARAMS ((struct z_candidate *)); static bool any_viable (struct z_candidate *);
static int any_viable PARAMS ((struct z_candidate *)); static bool any_strictly_viable (struct z_candidate *);
static int any_strictly_viable PARAMS ((struct z_candidate *)); static struct z_candidate *add_template_candidate
static struct z_candidate * add_template_candidate (struct z_candidate *, tree, tree, tree, tree, tree,
PARAMS ((struct z_candidate *, tree, tree, tree, tree, tree, tree, tree, int, unification_kind_t);
tree, tree, int, unification_kind_t)); static struct z_candidate *add_template_candidate_real
static struct z_candidate * add_template_candidate_real (struct z_candidate *, tree, tree, tree, tree, tree,
PARAMS ((struct z_candidate *, tree, tree, tree, tree, tree, tree, tree, int, tree, unification_kind_t);
tree, tree, int, tree, unification_kind_t)); static struct z_candidate *add_template_conv_candidate
static struct z_candidate * add_template_conv_candidate (struct z_candidate *, tree, tree, tree, tree, tree, tree);
PARAMS ((struct z_candidate *, tree, tree, tree, tree, tree, tree)); static struct z_candidate *add_builtin_candidates
static struct z_candidate * add_builtin_candidates (struct z_candidate *, enum tree_code, enum tree_code,
PARAMS ((struct z_candidate *, enum tree_code, enum tree_code, tree, tree *, int);
tree, tree *, int)); static struct z_candidate *add_builtin_candidate
static struct z_candidate * add_builtin_candidate (struct z_candidate *, enum tree_code, enum tree_code,
PARAMS ((struct z_candidate *, enum tree_code, enum tree_code, tree, tree, tree, tree *, tree *, int);
tree, tree, tree, tree *, tree *, int)); static bool is_complete (tree);
static int is_complete PARAMS ((tree)); static struct z_candidate *build_builtin_candidate
static struct z_candidate * build_builtin_candidate (struct z_candidate *, tree, tree, tree, tree *, tree *,
PARAMS ((struct z_candidate *, tree, tree, tree, tree *, tree *, int);
int)); static struct z_candidate *add_conv_candidate
static struct z_candidate * add_conv_candidate (struct z_candidate *, tree, tree, tree, tree, tree);
PARAMS ((struct z_candidate *, tree, tree, tree, tree, tree)); static struct z_candidate *add_function_candidate
static struct z_candidate * add_function_candidate
(struct z_candidate *, tree, tree, tree, tree, tree, int); (struct z_candidate *, tree, tree, tree, tree, tree, int);
static tree implicit_conversion PARAMS ((tree, tree, tree, int)); static tree implicit_conversion (tree, tree, tree, int);
static tree standard_conversion PARAMS ((tree, tree, tree)); static tree standard_conversion (tree, tree, tree);
static tree reference_binding PARAMS ((tree, tree, tree, int)); static tree reference_binding (tree, tree, tree, int);
static tree non_reference PARAMS ((tree)); static tree non_reference (tree);
static tree build_conv PARAMS ((enum tree_code, tree, tree)); static tree build_conv (enum tree_code, tree, tree);
static int is_subseq PARAMS ((tree, tree)); static bool is_subseq (tree, tree);
static tree maybe_handle_ref_bind PARAMS ((tree*)); static tree maybe_handle_ref_bind (tree *);
static void maybe_handle_implicit_object PARAMS ((tree*)); static void maybe_handle_implicit_object (tree *);
static struct z_candidate *add_candidate static struct z_candidate *add_candidate
(struct z_candidate *, tree, tree, tree, tree, int); (struct z_candidate *, tree, tree, tree, tree, int);
static tree source_type PARAMS ((tree)); static tree source_type (tree);
static void add_warning PARAMS ((struct z_candidate *, struct z_candidate *)); static void add_warning (struct z_candidate *, struct z_candidate *);
static int reference_related_p PARAMS ((tree, tree)); static bool reference_related_p (tree, tree);
static int reference_compatible_p PARAMS ((tree, tree)); static bool reference_compatible_p (tree, tree);
static tree convert_class_to_reference PARAMS ((tree, tree, tree)); static tree convert_class_to_reference (tree, tree, tree);
static tree direct_reference_binding PARAMS ((tree, tree)); static tree direct_reference_binding (tree, tree);
static int promoted_arithmetic_type_p PARAMS ((tree)); static bool promoted_arithmetic_type_p (tree);
static tree conditional_conversion PARAMS ((tree, tree)); static tree conditional_conversion (tree, tree);
static tree call_builtin_trap PARAMS ((void)); static tree call_builtin_trap (void);
tree tree
build_vfield_ref (datum, type) build_vfield_ref (tree datum, tree type)
tree datum, type;
{ {
if (datum == error_mark_node) if (datum == error_mark_node)
return error_mark_node; return error_mark_node;
...@@ -163,15 +161,14 @@ build_field_call (tree instance_ptr, tree decl, tree parms) ...@@ -163,15 +161,14 @@ build_field_call (tree instance_ptr, tree decl, tree parms)
(a BIT_NOT_EXPR) matches BASETYPE. The operand of NAME can take many (a BIT_NOT_EXPR) matches BASETYPE. The operand of NAME can take many
forms... */ forms... */
int bool
check_dtor_name (basetype, name) check_dtor_name (tree basetype, tree name)
tree basetype, name;
{ {
name = TREE_OPERAND (name, 0); name = TREE_OPERAND (name, 0);
/* Just accept something we've already complained about. */ /* Just accept something we've already complained about. */
if (name == error_mark_node) if (name == error_mark_node)
return 1; return true;
if (TREE_CODE (name) == TYPE_DECL) if (TREE_CODE (name) == TYPE_DECL)
name = TREE_TYPE (name); name = TREE_TYPE (name);
...@@ -194,21 +191,20 @@ check_dtor_name (basetype, name) ...@@ -194,21 +191,20 @@ check_dtor_name (basetype, name)
NAME will be a class template. */ NAME will be a class template. */
else if (DECL_CLASS_TEMPLATE_P (name)) else if (DECL_CLASS_TEMPLATE_P (name))
return 0; return false;
else else
abort (); abort ();
if (name && TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (name)) if (name && TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (name))
return 1; return true;
return 0; return false;
} }
/* Build a method call of the form `EXP->SCOPES::NAME (PARMS)'. /* Build a method call of the form `EXP->SCOPES::NAME (PARMS)'.
This is how virtual function calls are avoided. */ This is how virtual function calls are avoided. */
tree tree
build_scoped_method_call (exp, basetype, name, parms) build_scoped_method_call (tree exp, tree basetype, tree name, tree parms)
tree exp, basetype, name, parms;
{ {
/* Because this syntactic form does not allow /* Because this syntactic form does not allow
a pointer to a base class to be `stolen', a pointer to a base class to be `stolen',
...@@ -315,8 +311,7 @@ build_scoped_method_call (exp, basetype, name, parms) ...@@ -315,8 +311,7 @@ build_scoped_method_call (exp, basetype, name, parms)
pointer-to-member function. */ pointer-to-member function. */
tree tree
build_addr_func (function) build_addr_func (tree function)
tree function;
{ {
tree type = TREE_TYPE (function); tree type = TREE_TYPE (function);
...@@ -351,8 +346,7 @@ build_addr_func (function) ...@@ -351,8 +346,7 @@ build_addr_func (function)
(TYPE_PTRMEMFUNC_P) must be handled by our callers. */ (TYPE_PTRMEMFUNC_P) must be handled by our callers. */
tree tree
build_call (function, parms) build_call (tree function, tree parms)
tree function, parms;
{ {
int is_constructor = 0; int is_constructor = 0;
int nothrow; int nothrow;
...@@ -464,9 +458,8 @@ extern int n_build_method_call; ...@@ -464,9 +458,8 @@ extern int n_build_method_call;
#endif #endif
tree tree
build_method_call (instance, name, parms, basetype_path, flags) build_method_call (tree instance, tree name, tree parms,
tree instance, name, parms, basetype_path; tree basetype_path, int flags)
int flags;
{ {
tree fn; tree fn;
tree object_type; tree object_type;
...@@ -635,9 +628,8 @@ struct z_candidate GTY(()) { ...@@ -635,9 +628,8 @@ struct z_candidate GTY(()) {
#define USER_CONV_CAND(NODE) WRAPPER_ZC (TREE_OPERAND (NODE, 1)) #define USER_CONV_CAND(NODE) WRAPPER_ZC (TREE_OPERAND (NODE, 1))
#define USER_CONV_FN(NODE) (USER_CONV_CAND (NODE)->fn) #define USER_CONV_FN(NODE) (USER_CONV_CAND (NODE)->fn)
int bool
null_ptr_cst_p (t) null_ptr_cst_p (tree t)
tree t;
{ {
/* [conv.ptr] /* [conv.ptr]
...@@ -645,29 +637,26 @@ null_ptr_cst_p (t) ...@@ -645,29 +637,26 @@ null_ptr_cst_p (t)
(_expr.const_) rvalue of integer type that evaluates to zero. */ (_expr.const_) rvalue of integer type that evaluates to zero. */
if (t == null_node if (t == null_node
|| (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)) && integer_zerop (t))) || (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)) && integer_zerop (t)))
return 1; return true;
return 0; return false;
} }
/* Returns nonzero if PARMLIST consists of only default parms and/or /* Returns nonzero if PARMLIST consists of only default parms and/or
ellipsis. */ ellipsis. */
int bool
sufficient_parms_p (parmlist) sufficient_parms_p (tree parmlist)
tree parmlist;
{ {
for (; parmlist && parmlist != void_list_node; for (; parmlist && parmlist != void_list_node;
parmlist = TREE_CHAIN (parmlist)) parmlist = TREE_CHAIN (parmlist))
if (!TREE_PURPOSE (parmlist)) if (!TREE_PURPOSE (parmlist))
return 0; return false;
return 1; return true;
} }
static tree static tree
build_conv (code, type, from) build_conv (enum tree_code code, tree type, tree from)
enum tree_code code;
tree type, from;
{ {
tree t; tree t;
int rank = ICS_STD_RANK (from); int rank = ICS_STD_RANK (from);
...@@ -706,8 +695,7 @@ build_conv (code, type, from) ...@@ -706,8 +695,7 @@ build_conv (code, type, from)
Otherwise, return T itself. */ Otherwise, return T itself. */
static tree static tree
non_reference (t) non_reference (tree t)
tree t;
{ {
if (TREE_CODE (t) == REFERENCE_TYPE) if (TREE_CODE (t) == REFERENCE_TYPE)
t = TREE_TYPE (t); t = TREE_TYPE (t);
...@@ -715,8 +703,7 @@ non_reference (t) ...@@ -715,8 +703,7 @@ non_reference (t)
} }
tree tree
strip_top_quals (t) strip_top_quals (tree t)
tree t;
{ {
if (TREE_CODE (t) == ARRAY_TYPE) if (TREE_CODE (t) == ARRAY_TYPE)
return t; return t;
...@@ -728,18 +715,17 @@ strip_top_quals (t) ...@@ -728,18 +715,17 @@ strip_top_quals (t)
also pass the expression EXPR to convert from. */ also pass the expression EXPR to convert from. */
static tree static tree
standard_conversion (to, from, expr) standard_conversion (tree to, tree from, tree expr)
tree to, from, expr;
{ {
enum tree_code fcode, tcode; enum tree_code fcode, tcode;
tree conv; tree conv;
int fromref = 0; bool fromref = false;
if (TREE_CODE (to) == REFERENCE_TYPE) if (TREE_CODE (to) == REFERENCE_TYPE)
to = TREE_TYPE (to); to = TREE_TYPE (to);
if (TREE_CODE (from) == REFERENCE_TYPE) if (TREE_CODE (from) == REFERENCE_TYPE)
{ {
fromref = 1; fromref = true;
from = TREE_TYPE (from); from = TREE_TYPE (from);
} }
to = strip_top_quals (to); to = strip_top_quals (to);
...@@ -943,10 +929,8 @@ standard_conversion (to, from, expr) ...@@ -943,10 +929,8 @@ standard_conversion (to, from, expr)
/* Returns nonzero if T1 is reference-related to T2. */ /* Returns nonzero if T1 is reference-related to T2. */
static int static bool
reference_related_p (t1, t2) reference_related_p (tree t1, tree t2)
tree t1;
tree t2;
{ {
t1 = TYPE_MAIN_VARIANT (t1); t1 = TYPE_MAIN_VARIANT (t1);
t2 = TYPE_MAIN_VARIANT (t2); t2 = TYPE_MAIN_VARIANT (t2);
...@@ -963,10 +947,8 @@ reference_related_p (t1, t2) ...@@ -963,10 +947,8 @@ reference_related_p (t1, t2)
/* Returns nonzero if T1 is reference-compatible with T2. */ /* Returns nonzero if T1 is reference-compatible with T2. */
static int static bool
reference_compatible_p (t1, t2) reference_compatible_p (tree t1, tree t2)
tree t1;
tree t2;
{ {
/* [dcl.init.ref] /* [dcl.init.ref]
...@@ -981,10 +963,7 @@ reference_compatible_p (t1, t2) ...@@ -981,10 +963,7 @@ reference_compatible_p (t1, t2)
converted to T as in [over.match.ref]. */ converted to T as in [over.match.ref]. */
static tree static tree
convert_class_to_reference (t, s, expr) convert_class_to_reference (tree t, tree s, tree expr)
tree t;
tree s;
tree expr;
{ {
tree conversions; tree conversions;
tree arglist; tree arglist;
...@@ -1095,9 +1074,7 @@ convert_class_to_reference (t, s, expr) ...@@ -1095,9 +1074,7 @@ convert_class_to_reference (t, s, expr)
Return a conversion sequence for this binding. */ Return a conversion sequence for this binding. */
static tree static tree
direct_reference_binding (type, conv) direct_reference_binding (tree type, tree conv)
tree type;
tree conv;
{ {
tree t = TREE_TYPE (type); tree t = TREE_TYPE (type);
...@@ -1136,15 +1113,13 @@ direct_reference_binding (type, conv) ...@@ -1136,15 +1113,13 @@ direct_reference_binding (type, conv)
the conversion returned. */ the conversion returned. */
static tree static tree
reference_binding (rto, rfrom, expr, flags) reference_binding (tree rto, tree rfrom, tree expr, int flags)
tree rto, rfrom, expr;
int flags;
{ {
tree conv = NULL_TREE; tree conv = NULL_TREE;
tree to = TREE_TYPE (rto); tree to = TREE_TYPE (rto);
tree from = rfrom; tree from = rfrom;
int related_p; bool related_p;
int compatible_p; bool compatible_p;
cp_lvalue_kind lvalue_p = clk_none; cp_lvalue_kind lvalue_p = clk_none;
if (TREE_CODE (to) == FUNCTION_TYPE && expr && type_unknown_p (expr)) if (TREE_CODE (to) == FUNCTION_TYPE && expr && type_unknown_p (expr))
...@@ -1289,9 +1264,7 @@ reference_binding (rto, rfrom, expr, flags) ...@@ -1289,9 +1264,7 @@ reference_binding (rto, rfrom, expr, flags)
significant. */ significant. */
static tree static tree
implicit_conversion (to, from, expr, flags) implicit_conversion (tree to, tree from, tree expr, int flags)
tree to, from, expr;
int flags;
{ {
tree conv; tree conv;
struct z_candidate *cand; struct z_candidate *cand;
...@@ -1498,12 +1471,8 @@ add_function_candidate (struct z_candidate *candidates, ...@@ -1498,12 +1471,8 @@ add_function_candidate (struct z_candidate *candidates,
instead of the function. */ instead of the function. */
static struct z_candidate * static struct z_candidate *
add_conv_candidate (candidates, fn, obj, arglist, access_path, add_conv_candidate (struct z_candidate *candidates, tree fn, tree obj,
conversion_path) tree arglist, tree access_path, tree conversion_path)
struct z_candidate *candidates;
tree fn, obj, arglist;
tree access_path;
tree conversion_path;
{ {
tree totype = TREE_TYPE (TREE_TYPE (fn)); tree totype = TREE_TYPE (TREE_TYPE (fn));
int i, len, viable, flags; int i, len, viable, flags;
...@@ -1568,12 +1537,9 @@ add_conv_candidate (candidates, fn, obj, arglist, access_path, ...@@ -1568,12 +1537,9 @@ add_conv_candidate (candidates, fn, obj, arglist, access_path,
} }
static struct z_candidate * static struct z_candidate *
build_builtin_candidate (candidates, fnname, type1, type2, build_builtin_candidate (struct z_candidate *candidates, tree fnname,
args, argtypes, flags) tree type1, tree type2, tree *args, tree *argtypes,
struct z_candidate *candidates; int flags)
tree fnname, type1, type2, *args, *argtypes;
int flags;
{ {
tree t, convs; tree t, convs;
int viable = 1, i; int viable = 1, i;
...@@ -1619,18 +1585,16 @@ build_builtin_candidate (candidates, fnname, type1, type2, ...@@ -1619,18 +1585,16 @@ build_builtin_candidate (candidates, fnname, type1, type2,
viable); viable);
} }
static int static bool
is_complete (t) is_complete (tree t)
tree t;
{ {
return COMPLETE_TYPE_P (complete_type (t)); return COMPLETE_TYPE_P (complete_type (t));
} }
/* Returns nonzero if TYPE is a promoted arithmetic type. */ /* Returns nonzero if TYPE is a promoted arithmetic type. */
static int static bool
promoted_arithmetic_type_p (type) promoted_arithmetic_type_p (tree type)
tree type;
{ {
/* [over.built] /* [over.built]
...@@ -1655,12 +1619,9 @@ promoted_arithmetic_type_p (type) ...@@ -1655,12 +1619,9 @@ promoted_arithmetic_type_p (type)
CODE (TYPE1, TYPE1) and CODE (TYPE2, TYPE2). */ CODE (TYPE1, TYPE1) and CODE (TYPE2, TYPE2). */
static struct z_candidate * static struct z_candidate *
add_builtin_candidate (candidates, code, code2, fnname, type1, type2, add_builtin_candidate (struct z_candidate *candidates, enum tree_code code,
args, argtypes, flags) enum tree_code code2, tree fnname, tree type1,
struct z_candidate *candidates; tree type2, tree *args, tree *argtypes, int flags)
enum tree_code code, code2;
tree fnname, type1, type2, *args, *argtypes;
int flags;
{ {
switch (code) switch (code)
{ {
...@@ -2054,8 +2015,7 @@ add_builtin_candidate (candidates, code, code2, fnname, type1, type2, ...@@ -2054,8 +2015,7 @@ add_builtin_candidate (candidates, code, code2, fnname, type1, type2,
} }
tree tree
type_decays_to (type) type_decays_to (tree type)
tree type;
{ {
if (TREE_CODE (type) == ARRAY_TYPE) if (TREE_CODE (type) == ARRAY_TYPE)
return build_pointer_type (TREE_TYPE (type)); return build_pointer_type (TREE_TYPE (type));
...@@ -2078,11 +2038,9 @@ type_decays_to (type) ...@@ -2078,11 +2038,9 @@ type_decays_to (type)
filter out the invalid set. */ filter out the invalid set. */
static struct z_candidate * static struct z_candidate *
add_builtin_candidates (candidates, code, code2, fnname, args, flags) add_builtin_candidates (struct z_candidate *candidates, enum tree_code code,
struct z_candidate *candidates; enum tree_code code2, tree fnname, tree *args,
enum tree_code code, code2; int flags)
tree fnname, *args;
int flags;
{ {
int ref1, i; int ref1, i;
int enum_p = 0; int enum_p = 0;
...@@ -2253,16 +2211,11 @@ add_builtin_candidates (candidates, code, code2, fnname, args, flags) ...@@ -2253,16 +2211,11 @@ add_builtin_candidates (candidates, code, code2, fnname, args, flags)
add_conv_candidate. */ add_conv_candidate. */
static struct z_candidate* static struct z_candidate*
add_template_candidate_real (candidates, tmpl, ctype, explicit_targs, add_template_candidate_real (struct z_candidate *candidates, tree tmpl,
arglist, return_type, access_path, tree ctype, tree explicit_targs, tree arglist,
conversion_path, flags, obj, strict) tree return_type, tree access_path,
struct z_candidate *candidates; tree conversion_path, int flags, tree obj,
tree tmpl, ctype, explicit_targs, arglist, return_type; unification_kind_t strict)
tree access_path;
tree conversion_path;
int flags;
tree obj;
unification_kind_t strict;
{ {
int ntparms = DECL_NTPARMS (tmpl); int ntparms = DECL_NTPARMS (tmpl);
tree targs = make_tree_vec (ntparms); tree targs = make_tree_vec (ntparms);
...@@ -2357,15 +2310,10 @@ add_template_candidate_real (candidates, tmpl, ctype, explicit_targs, ...@@ -2357,15 +2310,10 @@ add_template_candidate_real (candidates, tmpl, ctype, explicit_targs,
static struct z_candidate * static struct z_candidate *
add_template_candidate (candidates, tmpl, ctype, explicit_targs, add_template_candidate (struct z_candidate *candidates, tree tmpl, tree ctype,
arglist, return_type, access_path, tree explicit_targs, tree arglist, tree return_type,
conversion_path, flags, strict) tree access_path, tree conversion_path, int flags,
struct z_candidate *candidates; unification_kind_t strict)
tree tmpl, ctype, explicit_targs, arglist, return_type;
tree access_path;
tree conversion_path;
int flags;
unification_kind_t strict;
{ {
return return
add_template_candidate_real (candidates, tmpl, ctype, add_template_candidate_real (candidates, tmpl, ctype,
...@@ -2376,12 +2324,9 @@ add_template_candidate (candidates, tmpl, ctype, explicit_targs, ...@@ -2376,12 +2324,9 @@ add_template_candidate (candidates, tmpl, ctype, explicit_targs,
static struct z_candidate * static struct z_candidate *
add_template_conv_candidate (candidates, tmpl, obj, arglist, return_type, add_template_conv_candidate (struct z_candidate *candidates, tree tmpl,
access_path, conversion_path) tree obj, tree arglist, tree return_type,
struct z_candidate *candidates; tree access_path, tree conversion_path)
tree tmpl, obj, arglist, return_type;
tree access_path;
tree conversion_path;
{ {
return return
add_template_candidate_real (candidates, tmpl, NULL_TREE, NULL_TREE, add_template_candidate_real (candidates, tmpl, NULL_TREE, NULL_TREE,
...@@ -2390,29 +2335,26 @@ add_template_conv_candidate (candidates, tmpl, obj, arglist, return_type, ...@@ -2390,29 +2335,26 @@ add_template_conv_candidate (candidates, tmpl, obj, arglist, return_type,
} }
static int static bool
any_viable (cands) any_viable (struct z_candidate *cands)
struct z_candidate *cands;
{ {
for (; cands; cands = cands->next) for (; cands; cands = cands->next)
if (pedantic ? cands->viable == 1 : cands->viable) if (pedantic ? cands->viable == 1 : cands->viable)
return 1; return true;
return 0; return false;
} }
static int static bool
any_strictly_viable (cands) any_strictly_viable (struct z_candidate *cands)
struct z_candidate *cands;
{ {
for (; cands; cands = cands->next) for (; cands; cands = cands->next)
if (cands->viable == 1) if (cands->viable == 1)
return 1; return true;
return 0; return false;
} }
static struct z_candidate * static struct z_candidate *
splice_viable (cands) splice_viable (struct z_candidate *cands)
struct z_candidate *cands;
{ {
struct z_candidate **p = &cands; struct z_candidate **p = &cands;
...@@ -2428,16 +2370,14 @@ splice_viable (cands) ...@@ -2428,16 +2370,14 @@ splice_viable (cands)
} }
static tree static tree
build_this (obj) build_this (tree obj)
tree obj;
{ {
/* Fix this to work on non-lvalues. */ /* Fix this to work on non-lvalues. */
return build_unary_op (ADDR_EXPR, obj, 0); return build_unary_op (ADDR_EXPR, obj, 0);
} }
static void static void
print_z_candidates (candidates) print_z_candidates (struct z_candidate *candidates)
struct z_candidate *candidates;
{ {
const char *str = "candidates are:"; const char *str = "candidates are:";
for (; candidates; candidates = candidates->next) for (; candidates; candidates = candidates->next)
...@@ -2473,9 +2413,7 @@ print_z_candidates (candidates) ...@@ -2473,9 +2413,7 @@ print_z_candidates (candidates)
per [dcl.init.ref], so we ignore temporary bindings. */ per [dcl.init.ref], so we ignore temporary bindings. */
static struct z_candidate * static struct z_candidate *
build_user_type_conversion_1 (totype, expr, flags) build_user_type_conversion_1 (tree totype, tree expr, int flags)
tree totype, expr;
int flags;
{ {
struct z_candidate *candidates, *cand; struct z_candidate *candidates, *cand;
tree fromtype = TREE_TYPE (expr); tree fromtype = TREE_TYPE (expr);
...@@ -2645,9 +2583,7 @@ build_user_type_conversion_1 (totype, expr, flags) ...@@ -2645,9 +2583,7 @@ build_user_type_conversion_1 (totype, expr, flags)
} }
tree tree
build_user_type_conversion (totype, expr, flags) build_user_type_conversion (tree totype, tree expr, int flags)
tree totype, expr;
int flags;
{ {
struct z_candidate *cand struct z_candidate *cand
= build_user_type_conversion_1 (totype, expr, flags); = build_user_type_conversion_1 (totype, expr, flags);
...@@ -2664,8 +2600,7 @@ build_user_type_conversion (totype, expr, flags) ...@@ -2664,8 +2600,7 @@ build_user_type_conversion (totype, expr, flags)
/* Do any initial processing on the arguments to a function call. */ /* Do any initial processing on the arguments to a function call. */
static tree static tree
resolve_args (args) resolve_args (tree args)
tree args;
{ {
tree t; tree t;
for (t = args; t; t = TREE_CHAIN (t)) for (t = args; t; t = TREE_CHAIN (t))
...@@ -2691,8 +2626,7 @@ resolve_args (args) ...@@ -2691,8 +2626,7 @@ resolve_args (args)
with the ARGS. */ with the ARGS. */
tree tree
build_new_function_call (fn, args) build_new_function_call (tree fn, tree args)
tree fn, args;
{ {
struct z_candidate *candidates = 0, *cand; struct z_candidate *candidates = 0, *cand;
tree explicit_targs = NULL_TREE; tree explicit_targs = NULL_TREE;
...@@ -2775,8 +2709,7 @@ build_new_function_call (fn, args) ...@@ -2775,8 +2709,7 @@ build_new_function_call (fn, args)
} }
static tree static tree
build_object_call (obj, args) build_object_call (tree obj, tree args)
tree obj, args;
{ {
struct z_candidate *candidates = 0, *cand; struct z_candidate *candidates = 0, *cand;
tree fns, convs, mem_args = NULL_TREE; tree fns, convs, mem_args = NULL_TREE;
...@@ -2886,10 +2819,8 @@ build_object_call (obj, args) ...@@ -2886,10 +2819,8 @@ build_object_call (obj, args)
} }
static void static void
op_error (code, code2, arg1, arg2, arg3, problem) op_error (enum tree_code code, enum tree_code code2,
enum tree_code code, code2; tree arg1, tree arg2, tree arg3, const char *problem)
tree arg1, arg2, arg3;
const char *problem;
{ {
const char *opname; const char *opname;
...@@ -2925,9 +2856,7 @@ op_error (code, code2, arg1, arg2, arg3, problem) ...@@ -2925,9 +2856,7 @@ op_error (code, code2, arg1, arg2, arg3, problem)
convert E1 to E2 in [expr.cond]. */ convert E1 to E2 in [expr.cond]. */
static tree static tree
conditional_conversion (e1, e2) conditional_conversion (tree e1, tree e2)
tree e1;
tree e2;
{ {
tree t1 = non_reference (TREE_TYPE (e1)); tree t1 = non_reference (TREE_TYPE (e1));
tree t2 = non_reference (TREE_TYPE (e2)); tree t2 = non_reference (TREE_TYPE (e2));
...@@ -2987,16 +2916,13 @@ conditional_conversion (e1, e2) ...@@ -2987,16 +2916,13 @@ conditional_conversion (e1, e2)
arguments to the conditional expression. */ arguments to the conditional expression. */
tree tree
build_conditional_expr (arg1, arg2, arg3) build_conditional_expr (tree arg1, tree arg2, tree arg3)
tree arg1;
tree arg2;
tree arg3;
{ {
tree arg2_type; tree arg2_type;
tree arg3_type; tree arg3_type;
tree result; tree result;
tree result_type = NULL_TREE; tree result_type = NULL_TREE;
int lvalue_p = 1; bool lvalue_p = true;
struct z_candidate *candidates = 0; struct z_candidate *candidates = 0;
struct z_candidate *cand; struct z_candidate *cand;
...@@ -3071,7 +2997,7 @@ build_conditional_expr (arg1, arg2, arg3) ...@@ -3071,7 +2997,7 @@ build_conditional_expr (arg1, arg2, arg3)
return error_mark_node; return error_mark_node;
} }
lvalue_p = 0; lvalue_p = false;
goto valid_operands; goto valid_operands;
} }
/* [expr.cond] /* [expr.cond]
...@@ -3145,7 +3071,7 @@ build_conditional_expr (arg1, arg2, arg3) ...@@ -3145,7 +3071,7 @@ build_conditional_expr (arg1, arg2, arg3)
cv-qualified) class type, overload resolution is used to cv-qualified) class type, overload resolution is used to
determine the conversions (if any) to be applied to the operands determine the conversions (if any) to be applied to the operands
(_over.match.oper_, _over.built_). */ (_over.match.oper_, _over.built_). */
lvalue_p = 0; lvalue_p = false;
if (!same_type_p (arg2_type, arg3_type) if (!same_type_p (arg2_type, arg3_type)
&& (CLASS_TYPE_P (arg2_type) || CLASS_TYPE_P (arg3_type))) && (CLASS_TYPE_P (arg2_type) || CLASS_TYPE_P (arg3_type)))
{ {
...@@ -3320,10 +3246,7 @@ build_conditional_expr (arg1, arg2, arg3) ...@@ -3320,10 +3246,7 @@ build_conditional_expr (arg1, arg2, arg3)
} }
tree tree
build_new_op (code, flags, arg1, arg2, arg3) build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3)
enum tree_code code;
int flags;
tree arg1, arg2, arg3;
{ {
struct z_candidate *candidates = 0, *cand; struct z_candidate *candidates = 0, *cand;
tree fns, mem_arglist = NULL_TREE, arglist, fnname; tree fns, mem_arglist = NULL_TREE, arglist, fnname;
...@@ -3714,10 +3637,8 @@ builtin: ...@@ -3714,10 +3637,8 @@ builtin:
PLACEMENT is the corresponding placement new call, or NULL_TREE. */ PLACEMENT is the corresponding placement new call, or NULL_TREE. */
tree tree
build_op_delete_call (code, addr, size, flags, placement) build_op_delete_call (enum tree_code code, tree addr, tree size,
enum tree_code code; int flags, tree placement)
tree addr, size, placement;
int flags;
{ {
tree fn = NULL_TREE; tree fn = NULL_TREE;
tree fns, fnname, fntype, argtypes, args, type; tree fns, fnname, fntype, argtypes, args, type;
...@@ -3853,15 +3774,10 @@ build_op_delete_call (code, addr, size, flags, placement) ...@@ -3853,15 +3774,10 @@ build_op_delete_call (code, addr, size, flags, placement)
BASETYPE_PATH, give an error. The most derived class in BASETYPE_PATH, give an error. The most derived class in
BASETYPE_PATH is the one used to qualify DECL. */ BASETYPE_PATH is the one used to qualify DECL. */
int bool
enforce_access (basetype_path, decl) enforce_access (tree basetype_path, tree decl)
tree basetype_path;
tree decl;
{ {
int accessible; if (!accessible_p (basetype_path, decl))
accessible = accessible_p (basetype_path, decl);
if (!accessible)
{ {
if (TREE_PRIVATE (decl)) if (TREE_PRIVATE (decl))
cp_error_at ("`%+#D' is private", decl); cp_error_at ("`%+#D' is private", decl);
...@@ -3870,10 +3786,10 @@ enforce_access (basetype_path, decl) ...@@ -3870,10 +3786,10 @@ enforce_access (basetype_path, decl)
else else
cp_error_at ("`%+#D' is inaccessible", decl); cp_error_at ("`%+#D' is inaccessible", decl);
error ("within this context"); error ("within this context");
return 0; return false;
} }
return 1; return true;
} }
/* Perform the conversions in CONVS on the expression EXPR. /* Perform the conversions in CONVS on the expression EXPR.
...@@ -3883,11 +3799,7 @@ enforce_access (basetype_path, decl) ...@@ -3883,11 +3799,7 @@ enforce_access (basetype_path, decl)
reference binding will be applied, positive otherwise. */ reference binding will be applied, positive otherwise. */
static tree static tree
convert_like_real (convs, expr, fn, argnum, inner) convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner)
tree convs, expr;
tree fn;
int argnum;
int inner;
{ {
int savew, savee; int savew, savee;
...@@ -4104,7 +4016,7 @@ convert_like_real (convs, expr, fn, argnum, inner) ...@@ -4104,7 +4016,7 @@ convert_like_real (convs, expr, fn, argnum, inner)
/* Build a call to __builtin_trap which can be used in an expression. */ /* Build a call to __builtin_trap which can be used in an expression. */
static tree static tree
call_builtin_trap () call_builtin_trap (void)
{ {
tree fn = get_identifier ("__builtin_trap"); tree fn = get_identifier ("__builtin_trap");
if (IDENTIFIER_GLOBAL_VALUE (fn)) if (IDENTIFIER_GLOBAL_VALUE (fn))
...@@ -4122,8 +4034,7 @@ call_builtin_trap () ...@@ -4122,8 +4034,7 @@ call_builtin_trap ()
Return the converted value. */ Return the converted value. */
tree tree
convert_arg_to_ellipsis (arg) convert_arg_to_ellipsis (tree arg)
tree arg;
{ {
if (TREE_CODE (TREE_TYPE (arg)) == REAL_TYPE if (TREE_CODE (TREE_TYPE (arg)) == REAL_TYPE
&& (TYPE_PRECISION (TREE_TYPE (arg)) && (TYPE_PRECISION (TREE_TYPE (arg))
...@@ -4153,9 +4064,7 @@ call will abort at runtime", ...@@ -4153,9 +4064,7 @@ call will abort at runtime",
/* va_arg (EXPR, TYPE) is a builtin. Make sure it is not abused. */ /* va_arg (EXPR, TYPE) is a builtin. Make sure it is not abused. */
tree tree
build_x_va_arg (expr, type) build_x_va_arg (tree expr, tree type)
tree expr;
tree type;
{ {
if (processing_template_decl) if (processing_template_decl)
return build_min (VA_ARG_EXPR, type, expr); return build_min (VA_ARG_EXPR, type, expr);
...@@ -4180,8 +4089,7 @@ build_x_va_arg (expr, type) ...@@ -4180,8 +4089,7 @@ build_x_va_arg (expr, type)
type, or the passed type if there is no change. */ type, or the passed type if there is no change. */
tree tree
cxx_type_promotes_to (type) cxx_type_promotes_to (tree type)
tree type;
{ {
tree promote; tree promote;
...@@ -4203,11 +4111,7 @@ cxx_type_promotes_to (type) ...@@ -4203,11 +4111,7 @@ cxx_type_promotes_to (type)
conversions. Return the converted value. */ conversions. Return the converted value. */
tree tree
convert_default_arg (type, arg, fn, parmnum) convert_default_arg (tree type, tree arg, tree fn, int parmnum)
tree type;
tree arg;
tree fn;
int parmnum;
{ {
if (TREE_CODE (arg) == DEFAULT_ARG) if (TREE_CODE (arg) == DEFAULT_ARG)
{ {
...@@ -4258,8 +4162,7 @@ convert_default_arg (type, arg, fn, parmnum) ...@@ -4258,8 +4162,7 @@ convert_default_arg (type, arg, fn, parmnum)
type TYPE. */ type TYPE. */
tree tree
type_passed_as (type) type_passed_as (tree type)
tree type;
{ {
/* Pass classes with copy ctors by invisible reference. */ /* Pass classes with copy ctors by invisible reference. */
if (TREE_ADDRESSABLE (type)) if (TREE_ADDRESSABLE (type))
...@@ -4275,8 +4178,7 @@ type_passed_as (type) ...@@ -4275,8 +4178,7 @@ type_passed_as (type)
/* Actually perform the appropriate conversion. */ /* Actually perform the appropriate conversion. */
tree tree
convert_for_arg_passing (type, val) convert_for_arg_passing (tree type, tree val)
tree type, val;
{ {
if (val == error_mark_node) if (val == error_mark_node)
; ;
...@@ -4296,10 +4198,7 @@ convert_for_arg_passing (type, val) ...@@ -4296,10 +4198,7 @@ convert_for_arg_passing (type, val)
bitmask of various LOOKUP_* flags which apply to the call itself. */ bitmask of various LOOKUP_* flags which apply to the call itself. */
static tree static tree
build_over_call (cand, args, flags) build_over_call (struct z_candidate *cand, tree args, int flags)
struct z_candidate *cand;
tree args;
int flags;
{ {
tree fn = cand->fn; tree fn = cand->fn;
tree convs = cand->convs; tree convs = cand->convs;
...@@ -4551,8 +4450,7 @@ static GTY(()) tree java_iface_lookup_fn; ...@@ -4551,8 +4450,7 @@ static GTY(()) tree java_iface_lookup_fn;
_Jv_LookupInterfaceMethodIdx(). */ _Jv_LookupInterfaceMethodIdx(). */
static tree static tree
build_java_interface_fn_ref (fn, instance) build_java_interface_fn_ref (tree fn, tree instance)
tree fn, instance;
{ {
tree lookup_args, lookup_fn, method, idx; tree lookup_args, lookup_fn, method, idx;
tree klass_ref, iface, iface_ref; tree klass_ref, iface, iface_ref;
...@@ -4613,8 +4511,7 @@ build_java_interface_fn_ref (fn, instance) ...@@ -4613,8 +4511,7 @@ build_java_interface_fn_ref (fn, instance)
call to a function with the indicated NAME. */ call to a function with the indicated NAME. */
tree tree
in_charge_arg_for_name (name) in_charge_arg_for_name (tree name)
tree name;
{ {
if (name == base_ctor_identifier if (name == base_ctor_identifier
|| name == base_dtor_identifier) || name == base_dtor_identifier)
...@@ -4915,12 +4812,11 @@ build_new_method_call (tree instance, tree fns, tree args, ...@@ -4915,12 +4812,11 @@ build_new_method_call (tree instance, tree fns, tree args,
return call; return call;
} }
/* Returns nonzero iff standard conversion sequence ICS1 is a proper /* Returns true iff standard conversion sequence ICS1 is a proper
subsequence of ICS2. */ subsequence of ICS2. */
static int static bool
is_subseq (ics1, ics2) is_subseq (tree ics1, tree ics2)
tree ics1, ics2;
{ {
/* We can assume that a conversion of the same code /* We can assume that a conversion of the same code
between the same types indicates a subsequence since we only get between the same types indicates a subsequence since we only get
...@@ -4943,7 +4839,7 @@ is_subseq (ics1, ics2) ...@@ -4943,7 +4839,7 @@ is_subseq (ics1, ics2)
ICS2. We can get a USER_CONV when we are comparing the ICS2. We can get a USER_CONV when we are comparing the
second standard conversion sequence of two user conversion second standard conversion sequence of two user conversion
sequences. */ sequences. */
return 0; return false;
ics2 = TREE_OPERAND (ics2, 0); ics2 = TREE_OPERAND (ics2, 0);
...@@ -4951,21 +4847,19 @@ is_subseq (ics1, ics2) ...@@ -4951,21 +4847,19 @@ is_subseq (ics1, ics2)
&& same_type_p (TREE_TYPE (ics2), TREE_TYPE (ics1)) && same_type_p (TREE_TYPE (ics2), TREE_TYPE (ics1))
&& same_type_p (TREE_TYPE (TREE_OPERAND (ics2, 0)), && same_type_p (TREE_TYPE (TREE_OPERAND (ics2, 0)),
TREE_TYPE (TREE_OPERAND (ics1, 0)))) TREE_TYPE (TREE_OPERAND (ics1, 0))))
return 1; return true;
} }
} }
/* Returns nonzero iff DERIVED is derived from BASE. The inputs may /* Returns nonzero iff DERIVED is derived from BASE. The inputs may
be any _TYPE nodes. */ be any _TYPE nodes. */
int bool
is_properly_derived_from (derived, base) is_properly_derived_from (tree derived, tree base)
tree derived;
tree base;
{ {
if (!IS_AGGR_TYPE_CODE (TREE_CODE (derived)) if (!IS_AGGR_TYPE_CODE (TREE_CODE (derived))
|| !IS_AGGR_TYPE_CODE (TREE_CODE (base))) || !IS_AGGR_TYPE_CODE (TREE_CODE (base)))
return 0; return false;
/* We only allow proper derivation here. The DERIVED_FROM_P macro /* We only allow proper derivation here. The DERIVED_FROM_P macro
considers every class derived from itself. */ considers every class derived from itself. */
...@@ -4980,8 +4874,7 @@ is_properly_derived_from (derived, base) ...@@ -4980,8 +4874,7 @@ is_properly_derived_from (derived, base)
modify it accordingly. */ modify it accordingly. */
static void static void
maybe_handle_implicit_object (ics) maybe_handle_implicit_object (tree *ics)
tree* ics;
{ {
if (ICS_THIS_FLAG (*ics)) if (ICS_THIS_FLAG (*ics))
{ {
...@@ -5016,8 +4909,7 @@ maybe_handle_implicit_object (ics) ...@@ -5016,8 +4909,7 @@ maybe_handle_implicit_object (ics)
leave *ICS unchanged and return NULL_TREE. */ leave *ICS unchanged and return NULL_TREE. */
static tree static tree
maybe_handle_ref_bind (ics) maybe_handle_ref_bind (tree *ics)
tree* ics;
{ {
if (TREE_CODE (*ics) == REF_BIND) if (TREE_CODE (*ics) == REF_BIND)
{ {
...@@ -5040,8 +4932,7 @@ maybe_handle_ref_bind (ics) ...@@ -5040,8 +4932,7 @@ maybe_handle_ref_bind (ics)
0: ics1 and ics2 are indistinguishable */ 0: ics1 and ics2 are indistinguishable */
static int static int
compare_ics (ics1, ics2) compare_ics (tree ics1, tree ics2)
tree ics1, ics2;
{ {
tree from_type1; tree from_type1;
tree from_type2; tree from_type2;
...@@ -5377,8 +5268,7 @@ compare_ics (ics1, ics2) ...@@ -5377,8 +5268,7 @@ compare_ics (ics1, ics2)
/* The source type for this standard conversion sequence. */ /* The source type for this standard conversion sequence. */
static tree static tree
source_type (t) source_type (tree t)
tree t;
{ {
for (;; t = TREE_OPERAND (t, 0)) for (;; t = TREE_OPERAND (t, 0))
{ {
...@@ -5395,8 +5285,7 @@ source_type (t) ...@@ -5395,8 +5285,7 @@ source_type (t)
is actually used. */ is actually used. */
static void static void
add_warning (winner, loser) add_warning (struct z_candidate *winner, struct z_candidate *loser)
struct z_candidate *winner, *loser;
{ {
winner->warnings = tree_cons (NULL_TREE, winner->warnings = tree_cons (NULL_TREE,
build_zc_wrapper (loser), build_zc_wrapper (loser),
...@@ -5408,9 +5297,7 @@ add_warning (winner, loser) ...@@ -5408,9 +5297,7 @@ add_warning (winner, loser)
both are extern "C". */ both are extern "C". */
static inline int static inline int
equal_functions (fn1, fn2) equal_functions (tree fn1, tree fn2)
tree fn1;
tree fn2;
{ {
if (DECL_LOCAL_FUNCTION_P (fn1) || DECL_LOCAL_FUNCTION_P (fn2) if (DECL_LOCAL_FUNCTION_P (fn1) || DECL_LOCAL_FUNCTION_P (fn2)
|| DECL_EXTERN_C_FUNCTION_P (fn1)) || DECL_EXTERN_C_FUNCTION_P (fn1))
...@@ -5426,9 +5313,7 @@ equal_functions (fn1, fn2) ...@@ -5426,9 +5313,7 @@ equal_functions (fn1, fn2)
0: cand1 and cand2 are indistinguishable */ 0: cand1 and cand2 are indistinguishable */
static int static int
joust (cand1, cand2, warn) joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
struct z_candidate *cand1, *cand2;
int warn;
{ {
int winner = 0; int winner = 0;
int i, off1 = 0, off2 = 0, len; int i, off1 = 0, off2 = 0, len;
...@@ -5702,8 +5587,7 @@ tweak: ...@@ -5702,8 +5587,7 @@ tweak:
algorithm. */ algorithm. */
static struct z_candidate * static struct z_candidate *
tourney (candidates) tourney (struct z_candidate *candidates)
struct z_candidate *candidates;
{ {
struct z_candidate *champ = candidates, *challenger; struct z_candidate *champ = candidates, *challenger;
int fate; int fate;
...@@ -5754,18 +5638,16 @@ tourney (candidates) ...@@ -5754,18 +5638,16 @@ tourney (candidates)
/* Returns nonzero if things of type FROM can be converted to TO. */ /* Returns nonzero if things of type FROM can be converted to TO. */
int bool
can_convert (to, from) can_convert (tree to, tree from)
tree to, from;
{ {
return can_convert_arg (to, from, NULL_TREE); return can_convert_arg (to, from, NULL_TREE);
} }
/* Returns nonzero if ARG (of type FROM) can be converted to TO. */ /* Returns nonzero if ARG (of type FROM) can be converted to TO. */
int bool
can_convert_arg (to, from, arg) can_convert_arg (tree to, tree from, tree arg)
tree to, from, arg;
{ {
tree t = implicit_conversion (to, from, arg, LOOKUP_NORMAL); tree t = implicit_conversion (to, from, arg, LOOKUP_NORMAL);
return (t && ! ICS_BAD_FLAG (t)); return (t && ! ICS_BAD_FLAG (t));
...@@ -5773,12 +5655,10 @@ can_convert_arg (to, from, arg) ...@@ -5773,12 +5655,10 @@ can_convert_arg (to, from, arg)
/* Like can_convert_arg, but allows dubious conversions as well. */ /* Like can_convert_arg, but allows dubious conversions as well. */
int bool
can_convert_arg_bad (to, from, arg) can_convert_arg_bad (tree to, tree from, tree arg)
tree to, from, arg;
{ {
tree t = implicit_conversion (to, from, arg, LOOKUP_NORMAL); return implicit_conversion (to, from, arg, LOOKUP_NORMAL) != 0;
return !!t;
} }
/* Convert EXPR to TYPE. Return the converted expression. /* Convert EXPR to TYPE. Return the converted expression.
...@@ -5788,9 +5668,7 @@ can_convert_arg_bad (to, from, arg) ...@@ -5788,9 +5668,7 @@ can_convert_arg_bad (to, from, arg)
doing a bad conversion, convert_like will complain. */ doing a bad conversion, convert_like will complain. */
tree tree
perform_implicit_conversion (type, expr) perform_implicit_conversion (tree type, tree expr)
tree type;
tree expr;
{ {
tree conv; tree conv;
...@@ -5812,9 +5690,7 @@ perform_implicit_conversion (type, expr) ...@@ -5812,9 +5690,7 @@ perform_implicit_conversion (type, expr)
expression. */ expression. */
tree tree
initialize_reference (type, expr) initialize_reference (tree type, tree expr)
tree type;
tree expr;
{ {
tree conv; tree conv;
......
...@@ -3535,39 +3535,40 @@ extern operator_name_info_t operator_name_info[]; ...@@ -3535,39 +3535,40 @@ extern operator_name_info_t operator_name_info[];
extern operator_name_info_t assignment_operator_name_info[]; extern operator_name_info_t assignment_operator_name_info[];
/* in call.c */ /* in call.c */
extern int check_dtor_name PARAMS ((tree, tree)); extern bool check_dtor_name (tree, tree);
extern int get_arglist_len_in_bytes PARAMS ((tree)); extern int get_arglist_len_in_bytes PARAMS ((tree));
extern tree build_vfield_ref PARAMS ((tree, tree)); extern tree build_vfield_ref PARAMS ((tree, tree));
extern tree build_scoped_method_call PARAMS ((tree, tree, tree, tree)); extern tree build_scoped_method_call (tree, tree, tree, tree);
extern tree build_conditional_expr PARAMS ((tree, tree, tree)); extern tree build_conditional_expr PARAMS ((tree, tree, tree));
extern tree build_addr_func PARAMS ((tree)); extern tree build_addr_func (tree);
extern tree build_call PARAMS ((tree, tree)); extern tree build_call (tree, tree);
extern tree build_method_call PARAMS ((tree, tree, tree, tree, int)); extern tree build_method_call (tree, tree, tree, tree, int);
extern int null_ptr_cst_p PARAMS ((tree)); extern bool null_ptr_cst_p (tree);
extern int sufficient_parms_p PARAMS ((tree)); extern bool sufficient_parms_p (tree);
extern tree type_decays_to PARAMS ((tree)); extern tree type_decays_to (tree);
extern tree build_user_type_conversion PARAMS ((tree, tree, int)); extern tree build_user_type_conversion (tree, tree, int);
extern tree build_new_function_call PARAMS ((tree, tree)); extern tree build_new_function_call (tree, tree);
extern tree build_new_method_call (tree, tree, tree, tree, int); extern tree build_new_method_call (tree, tree, tree, tree, int);
extern tree build_special_member_call (tree, tree, tree, tree, int); extern tree build_special_member_call (tree, tree, tree, tree, int);
extern tree build_new_op PARAMS ((enum tree_code, int, tree, tree, tree)); extern tree build_new_op (enum tree_code, int, tree, tree, tree);
extern tree build_op_delete_call PARAMS ((enum tree_code, tree, tree, int, tree)); extern tree build_op_delete_call (enum tree_code, tree, tree, int, tree);
extern int can_convert PARAMS ((tree, tree)); extern bool can_convert (tree, tree);
extern int can_convert_arg PARAMS ((tree, tree, tree)); extern bool can_convert_arg (tree, tree, tree);
extern int can_convert_arg_bad PARAMS ((tree, tree, tree)); extern bool can_convert_arg_bad (tree, tree, tree);
extern int enforce_access PARAMS ((tree, tree)); extern bool enforce_access (tree, tree);
extern tree convert_default_arg PARAMS ((tree, tree, tree, int)); extern tree convert_default_arg (tree, tree, tree, int);
extern tree convert_arg_to_ellipsis PARAMS ((tree)); extern tree convert_arg_to_ellipsis (tree);
extern tree build_x_va_arg PARAMS ((tree, tree)); extern tree build_x_va_arg (tree, tree);
extern tree cxx_type_promotes_to PARAMS ((tree)); extern tree cxx_type_promotes_to (tree);
extern tree type_passed_as PARAMS ((tree)); extern tree type_passed_as (tree);
extern tree convert_for_arg_passing PARAMS ((tree, tree)); extern tree convert_for_arg_passing (tree, tree);
extern tree cp_convert_parm_for_inlining PARAMS ((tree, tree, tree)); extern tree cp_convert_parm_for_inlining PARAMS ((tree, tree, tree));
extern int is_properly_derived_from PARAMS ((tree, tree)); extern bool is_properly_derived_from (tree, tree);
extern tree initialize_reference PARAMS ((tree, tree)); extern tree initialize_reference (tree, tree);
extern tree strip_top_quals PARAMS ((tree)); extern tree strip_top_quals (tree);
extern tree perform_implicit_conversion PARAMS ((tree, tree)); extern tree perform_implicit_conversion (tree, tree);
extern tree in_charge_arg_for_name (tree);
/* in class.c */ /* in class.c */
extern tree build_base_path PARAMS ((enum tree_code, tree, tree, int)); extern tree build_base_path PARAMS ((enum tree_code, tree, tree, int));
...@@ -3611,7 +3612,6 @@ extern void invalidate_class_lookup_cache PARAMS ((void)); ...@@ -3611,7 +3612,6 @@ extern void invalidate_class_lookup_cache PARAMS ((void));
extern void maybe_note_name_used_in_class PARAMS ((tree, tree)); extern void maybe_note_name_used_in_class PARAMS ((tree, tree));
extern void note_name_declared_in_class PARAMS ((tree, tree)); extern void note_name_declared_in_class PARAMS ((tree, tree));
extern tree get_vtbl_decl_for_binfo PARAMS ((tree)); extern tree get_vtbl_decl_for_binfo PARAMS ((tree));
extern tree in_charge_arg_for_name PARAMS ((tree));
extern tree get_vtt_name PARAMS ((tree)); extern tree get_vtt_name PARAMS ((tree));
extern tree get_primary_binfo PARAMS ((tree)); extern tree get_primary_binfo PARAMS ((tree));
......
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