This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] support argument dependent lookup (ADL)


>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> writes:

Sami>    2010-03-22  Sami Wagiaalla  <swagiaal@redhat.com>
Sami>     	PR C++/7943:

This looks pretty good.  I have a few nits.

Sami> +static void make_symbol_overload_list_adl_namespace (struct type *type,
Sami> +						     const char *func_name)

Newline after 'void'.

Sami> +  if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF
Sami> +      || TYPE_CODE (type) == TYPE_CODE_ARRAY)
Sami> +    return make_symbol_overload_list_adl_namespace (TYPE_TARGET_TYPE (type),
Sami> +                                                    func_name);

Rather than a recursive call here, just use a loop to strip off the
outer types.

Also, it is a bit weird to use 'return' like this in a void function.

Sami> +  /* Check public base type */
Sami> +  if (TYPE_CODE(type) == TYPE_CODE_CLASS)

Space between TYPE_CODE and the open paren.

Sami> +
Sami> +}

Spurious newline at the end of this function.

Sami> +  /* If we have reached the deepesst level perform argument

Typo: should be "deepest".

Sami> +  if (!searched_deeper)
Sami> +    make_symbol_overload_list_adl (arg_types, nargs, func_name);

Something I don't understand is how this code excludes qualified names,
or method names, from ADL lookup.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]