From da096638ca5fcd2fdb2ff8aff9e545c9b0cee478 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Fri, 14 Oct 2011 20:22:17 +0000 Subject: PR c++/13225 * eval.c (evaluate_subexp_standard): Do not construct an array of types; pass the value array directly to find_overload_match. * gdbtypes.h (NULL_POINTER_CONVERSION_BADNESS): Declare. (rank_function): Take an array of values instead of types. (rank_one_type): Add struct value * parameter. * gdbtypes.c (NULL_POINTER_CONVERSION_BADNESS): Define. (rank_function): For each argument, pass the argument's value to rank_one_type. (rank_one_type): Add VALUE parameter. If the parameter type is a pointer and the argument type is an integer, return NULL_POINTER_CONVERSION_BADNESS if VALUE is zero. Update all calls to rank_one_type, passing NULL for new VALUE parameter. * valarith.c (value_user_defined_cpp_op): Do not construct an array of types; pass the value array directly to find_overload_match. * valops.c (find_overload_method_list): Take an array of values instead of types. Save the type of OBJP for later use. Update calls to find_oload_champ, and find_oload_champ_namespace. (find_oload_champ_namespace): Take an array of values instead of types. (find_oload_champ_namespace_loop): Likewise. (find_oload_champ): Likewise. (classify_oload_match): Inspect all arguments until INCOMPATIBLE is found. Return the worst badness found otherwise. (compare_parameters): Update call to rank_one_type. * value.h (find_overload_match): Take an array of values instead of types. --- gdb/valarith.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'gdb/valarith.c') diff --git a/gdb/valarith.c b/gdb/valarith.c index 68f649f..3250cc7 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -335,15 +335,8 @@ value_user_defined_cpp_op (struct value **args, int nargs, char *operator, struct symbol *symp = NULL; struct value *valp = NULL; - struct type **arg_types; - int i; - arg_types = (struct type **) alloca (nargs * (sizeof (struct type *))); - /* Prepare list of argument types for overload resolution. */ - for (i = 0; i < nargs; i++) - arg_types[i] = value_type (args[i]); - - find_overload_match (arg_types, nargs, operator, BOTH /* could be method */, + find_overload_match (args, nargs, operator, BOTH /* could be method */, 0 /* strict match */, &args[0], /* objp */ NULL /* pass NULL symbol since symbol is unknown */, &valp, &symp, static_memfuncp, 0); -- cgit v1.1