diff options
author | Sami Wagiaalla <swagiaal@redhat.com> | 2010-06-07 16:11:35 +0000 |
---|---|---|
committer | Sami Wagiaalla <swagiaal@redhat.com> | 2010-06-07 16:11:35 +0000 |
commit | 4c3376c84943b8102da4237141dab7f1595912ca (patch) | |
tree | fc4936a3a61d60b2a60379e534e7081099969bb2 /gdb/cp-support.c | |
parent | 0f32ea4ce3309801590068305e7c8d7aeb495f2f (diff) | |
download | gdb-4c3376c84943b8102da4237141dab7f1595912ca.zip gdb-4c3376c84943b8102da4237141dab7f1595912ca.tar.gz gdb-4c3376c84943b8102da4237141dab7f1595912ca.tar.bz2 |
Test and support all cpp operator types.
2010-06-07 Sami Wagiaalla <swagiaal@redhat.com>
* value.h: Created oload_search_type enum.
(find_overload_match): Use oload_search_type enum.
* valops.c (find_overload_match): Support combined member and
non-member search.
* eval.c (evaluate_subexp_standard): Calls to
find_overload_match now use oload_search_type enum.
(oload_method_static): Verify index is a proper value.
* valarith.c (value_user_defined_cpp_op): Search for and handle
both member and non-member operators.
(value_user_defined_cpp_op): New function.
(value_user_defined_op): New function.
(value_x_unop): Use value_user_defined_op.
(value_x_binop): Ditto.
* cp-support.c (make_symbol_overload_list_using): Added block
iteration.
Add check for namespace aliases and imported declarations.
2010-06-07 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/koenig.exp: Test for ADL operators.
* gdb.cp/koenig.cc: Added ADL operators.
* gdb.cp/operator.exp: New test.
* gdb.cp/operator.cc: New test.
Diffstat (limited to 'gdb/cp-support.c')
-rw-r--r-- | gdb/cp-support.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 799b707..d9a59f3 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -803,21 +803,26 @@ make_symbol_overload_list_using (const char *func_name, const char *namespace) { const struct using_direct *current; + const struct block *block; /* First, go through the using directives. If any of them apply, look in the appropriate namespaces for new functions to match on. */ - for (current = block_using (get_selected_block (0)); - current != NULL; - current = current->next) - { - if (strcmp (namespace, current->import_dest) == 0) - { - make_symbol_overload_list_using (func_name, - current->import_src); - } - } + for (block = get_selected_block (0); + block != NULL; + block = BLOCK_SUPERBLOCK (block)) + for (current = block_using (block); + current != NULL; + current = current->next) + { + /* If this is a namespace alias or imported declaration ignore it. */ + if (current->alias != NULL || current->declaration != NULL) + continue; + + if (strcmp (namespace, current->import_dest) == 0) + make_symbol_overload_list_using (func_name, current->import_src); + } /* Now, add names for this namespace. */ make_symbol_overload_list_namespace (func_name, namespace); |