-extern int inhibit_warnings;
-
-static tree build_new_method_call PARAMS ((tree, tree, tree, tree, int));
-
-static tree build_field_call PARAMS ((tree, tree, tree, tree));
-static struct z_candidate * tourney PARAMS ((struct z_candidate *));
-static int equal_functions PARAMS ((tree, tree));
-static int joust PARAMS ((struct z_candidate *, struct z_candidate *, int));
-static int compare_ics PARAMS ((tree, tree));
-static tree build_over_call PARAMS ((struct z_candidate *, tree, int));
-static tree build_java_interface_fn_ref PARAMS ((tree, tree));
-#define convert_like(CONV, EXPR) \
- convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0)
-#define convert_like_with_context(CONV, EXPR, FN, ARGNO) \
- convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0)
-static tree convert_like_real PARAMS ((tree, tree, tree, int, int));
-static void op_error PARAMS ((enum tree_code, enum tree_code, tree, tree,
- tree, const char *));
-static tree build_object_call PARAMS ((tree, tree));
-static tree resolve_args PARAMS ((tree));
-static struct z_candidate * build_user_type_conversion_1
- PARAMS ((tree, tree, int));
-static void print_z_candidates PARAMS ((struct z_candidate *));
-static tree build_this PARAMS ((tree));
-static struct z_candidate * splice_viable PARAMS ((struct z_candidate *));
-static int any_viable PARAMS ((struct z_candidate *));
-static struct z_candidate * add_template_candidate
- PARAMS ((struct z_candidate *, tree, tree, tree, tree, tree, int,
- unification_kind_t));
-static struct z_candidate * add_template_candidate_real
- PARAMS ((struct z_candidate *, tree, tree, tree, tree, tree, int,
- tree, unification_kind_t));
-static struct z_candidate * add_template_conv_candidate
- PARAMS ((struct z_candidate *, tree, tree, tree, tree));
-static struct z_candidate * add_builtin_candidates
- PARAMS ((struct z_candidate *, enum tree_code, enum tree_code,
- tree, tree *, int));
-static struct z_candidate * add_builtin_candidate
- PARAMS ((struct z_candidate *, enum tree_code, enum tree_code,
- tree, tree, tree, tree *, tree *, int));
-static int is_complete PARAMS ((tree));
-static struct z_candidate * build_builtin_candidate
- PARAMS ((struct z_candidate *, tree, tree, tree, tree *, tree *,
- int));
-static struct z_candidate * add_conv_candidate
- PARAMS ((struct z_candidate *, tree, tree, tree));
-static struct z_candidate * add_function_candidate
- PARAMS ((struct z_candidate *, tree, tree, tree, int));
-static tree implicit_conversion PARAMS ((tree, tree, tree, int));
-static tree standard_conversion PARAMS ((tree, tree, tree));
-static tree reference_binding PARAMS ((tree, tree, tree, int));
-static tree non_reference PARAMS ((tree));
-static tree build_conv PARAMS ((enum tree_code, tree, tree));
-static int is_subseq PARAMS ((tree, tree));
-static tree maybe_handle_ref_bind PARAMS ((tree*));
-static void maybe_handle_implicit_object PARAMS ((tree*));
-static struct z_candidate * add_candidate PARAMS ((struct z_candidate *,
- tree, tree, int));
-static tree source_type PARAMS ((tree));
-static void add_warning PARAMS ((struct z_candidate *, struct z_candidate *));
-static int reference_related_p PARAMS ((tree, tree));
-static int reference_compatible_p PARAMS ((tree, tree));
-static tree convert_class_to_reference PARAMS ((tree, tree, tree));
-static tree direct_reference_binding PARAMS ((tree, tree));
-static int promoted_arithmetic_type_p PARAMS ((tree));
-static tree conditional_conversion PARAMS ((tree, tree));
-static tree call_builtin_trap PARAMS ((void));
-
-tree
-build_vfield_ref (datum, type)
- tree datum, type;
-{
- tree rval;
-
- if (datum == error_mark_node)
- return error_mark_node;
-
- if (TREE_CODE (TREE_TYPE (datum)) == REFERENCE_TYPE)
- datum = convert_from_reference (datum);
-
- if (! TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (type))
- rval = build (COMPONENT_REF, TREE_TYPE (TYPE_VFIELD (type)),
- datum, TYPE_VFIELD (type));
- else
- rval = build_component_ref (datum, DECL_NAME (TYPE_VFIELD (type)), NULL_TREE, 0);
-
- return rval;
-}
-
-/* Build a call to a member of an object. I.e., one that overloads
- operator ()(), or is a pointer-to-function or pointer-to-method. */
-
-static tree
-build_field_call (basetype_path, instance_ptr, name, parms)
- tree basetype_path, instance_ptr, name, parms;
-{
- tree field, instance;
-
- if (IDENTIFIER_CTOR_OR_DTOR_P (name))
- return NULL_TREE;
-
- /* Speed up the common case. */
- if (instance_ptr == current_class_ptr
- && IDENTIFIER_CLASS_VALUE (name) == NULL_TREE)
- return NULL_TREE;
-
- field = lookup_field (basetype_path, name, 1, 0);
-
- if (field == error_mark_node || field == NULL_TREE)
- return field;
-
- if (TREE_CODE (field) == FIELD_DECL || TREE_CODE (field) == VAR_DECL)
- {
- /* If it's a field, try overloading operator (),
- or calling if the field is a pointer-to-function. */
- instance = build_indirect_ref (instance_ptr, NULL);
- instance = build_component_ref_1 (instance, field, 0);
-
- if (instance == error_mark_node)
- return error_mark_node;
-
- if (IS_AGGR_TYPE (TREE_TYPE (instance)))
- return build_opfncall (CALL_EXPR, LOOKUP_NORMAL,
- instance, parms, NULL_TREE);
- else if (TREE_CODE (TREE_TYPE (instance)) == FUNCTION_TYPE
- || (TREE_CODE (TREE_TYPE (instance)) == POINTER_TYPE
- && (TREE_CODE (TREE_TYPE (TREE_TYPE (instance)))
- == FUNCTION_TYPE)))
- return build_function_call (instance, parms);
- }
-
- return NULL_TREE;
-}
-
-/* Returns nonzero iff the destructor name specified in NAME
- (a BIT_NOT_EXPR) matches BASETYPE. The operand of NAME can take many
- forms... */
-
-int
-check_dtor_name (basetype, name)
- tree basetype, name;
+#define CONVERSION_RANK(NODE) \
+ ((NODE)->bad_p ? cr_bad \
+ : (NODE)->ellipsis_p ? cr_ellipsis \
+ : (NODE)->user_conv_p ? cr_user \
+ : (NODE)->rank)
+
+static struct obstack conversion_obstack;
+static bool conversion_obstack_initialized;
+
+static struct z_candidate * tourney (struct z_candidate *);
+static int equal_functions (tree, tree);
+static int joust (struct z_candidate *, struct z_candidate *, bool);
+static int compare_ics (conversion *, conversion *);
+static tree build_over_call (struct z_candidate *, int, tsubst_flags_t);
+static tree build_java_interface_fn_ref (tree, tree);
+#define convert_like(CONV, EXPR, COMPLAIN) \
+ convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \
+ /*issue_conversion_warnings=*/true, \
+ /*c_cast_p=*/false, (COMPLAIN))
+#define convert_like_with_context(CONV, EXPR, FN, ARGNO, COMPLAIN ) \
+ convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \
+ /*issue_conversion_warnings=*/true, \
+ /*c_cast_p=*/false, (COMPLAIN))
+static tree convert_like_real (conversion *, tree, tree, int, int, bool,
+ bool, tsubst_flags_t);
+static void op_error (enum tree_code, enum tree_code, tree, tree,
+ tree, const char *);
+static tree build_object_call (tree, tree, tsubst_flags_t);
+static tree resolve_args (tree);
+static struct z_candidate *build_user_type_conversion_1 (tree, tree, int);
+static void print_z_candidate (const char *, struct z_candidate *);
+static void print_z_candidates (struct z_candidate *);
+static tree build_this (tree);
+static struct z_candidate *splice_viable (struct z_candidate *, bool, bool *);
+static bool any_strictly_viable (struct z_candidate *);
+static struct z_candidate *add_template_candidate
+ (struct z_candidate **, tree, tree, tree, tree, tree,
+ tree, tree, int, unification_kind_t);
+static struct z_candidate *add_template_candidate_real
+ (struct z_candidate **, tree, tree, tree, tree, tree,
+ tree, tree, int, tree, unification_kind_t);
+static struct z_candidate *add_template_conv_candidate
+ (struct z_candidate **, tree, tree, tree, tree, tree, tree);
+static void add_builtin_candidates
+ (struct z_candidate **, enum tree_code, enum tree_code,
+ tree, tree *, int);
+static void add_builtin_candidate
+ (struct z_candidate **, enum tree_code, enum tree_code,
+ tree, tree, tree, tree *, tree *, int);
+static bool is_complete (tree);
+static void build_builtin_candidate
+ (struct z_candidate **, tree, tree, tree, tree *, tree *,
+ int);
+static struct z_candidate *add_conv_candidate
+ (struct z_candidate **, tree, tree, tree, tree, tree);
+static struct z_candidate *add_function_candidate
+ (struct z_candidate **, tree, tree, tree, tree, tree, int);
+static conversion *implicit_conversion (tree, tree, tree, bool, int);
+static conversion *standard_conversion (tree, tree, tree, bool, int);
+static conversion *reference_binding (tree, tree, tree, bool, int);
+static conversion *build_conv (conversion_kind, tree, conversion *);
+static conversion *build_list_conv (tree, tree, int);
+static bool is_subseq (conversion *, conversion *);
+static conversion *maybe_handle_ref_bind (conversion **);
+static void maybe_handle_implicit_object (conversion **);
+static struct z_candidate *add_candidate
+ (struct z_candidate **, tree, tree, size_t,
+ conversion **, tree, tree, int);
+static tree source_type (conversion *);
+static void add_warning (struct z_candidate *, struct z_candidate *);
+static bool reference_related_p (tree, tree);
+static bool reference_compatible_p (tree, tree);
+static conversion *convert_class_to_reference (tree, tree, tree);
+static conversion *direct_reference_binding (tree, conversion *);
+static bool promoted_arithmetic_type_p (tree);
+static conversion *conditional_conversion (tree, tree);
+static char *name_as_c_string (tree, tree, bool *);
+static tree call_builtin_trap (void);
+static tree prep_operand (tree);
+static void add_candidates (tree, tree, tree, bool, tree, tree,
+ int, struct z_candidate **);
+static conversion *merge_conversion_sequences (conversion *, conversion *);
+static bool magic_varargs_p (tree);
+static tree build_temp (tree, tree, int, diagnostic_t *);
+
+/* Returns nonzero iff the destructor name specified in NAME matches BASETYPE.
+ NAME can take many forms... */
+
+bool
+check_dtor_name (tree basetype, tree name)