summaryrefslogtreecommitdiff
path: root/gdb/cp-support.c
diff options
context:
space:
mode:
authorswagiaal <swagiaal>2010-06-07 16:11:26 +0000
committerswagiaal <swagiaal>2010-06-07 16:11:26 +0000
commit2b089485f568b64ace7a8910ea43843c9f7b2fb9 (patch)
tree3ef2932a0aa9d178e2b5d0d30ddfbabd6946a297 /gdb/cp-support.c
parentd2489d897948c4948f40f16b6c27fd3da1409188 (diff)
downloadgdb-2b089485f568b64ace7a8910ea43843c9f7b2fb9.tar.gz
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.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 799b7076daa..d9a59f31e32 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);