diff options
author | Sami Wagiaalla <swagiaal@redhat.com> | 2010-10-19 20:53:15 +0000 |
---|---|---|
committer | Sami Wagiaalla <swagiaal@redhat.com> | 2010-10-19 20:53:15 +0000 |
commit | 79afc5ef5d41c629c2e26eee37aaceac4320b8d6 (patch) | |
tree | e5f34b6aea162a5e90b100321fa14c9340a9f287 /gdb/valarith.c | |
parent | cca56ac7aecdfc4ba5db742e6505e80d79e28931 (diff) | |
download | gdb-79afc5ef5d41c629c2e26eee37aaceac4320b8d6.zip gdb-79afc5ef5d41c629c2e26eee37aaceac4320b8d6.tar.gz gdb-79afc5ef5d41c629c2e26eee37aaceac4320b8d6.tar.bz2 |
Support overloading of 'operator->'.
2010-10-19 Sami Wagiaalla <swagiaal@redhat.com>
PR C++/11500:
* valarith.c (value_x_unop): Handle STRUCTOP_PTR.
* eval.c (evaluate_subexp_standard): Check for overload of
'operator->'.
* valarith.c (value_x_binop): Throw NOT_FOUND_ERROR.
(value_x_unop): Ditto.
* valops.c: Include "exceptions.h".
(find_overload_match): Throw NOT_FOUND_ERROR.
(value_struct_elt): Ditto.
2010-10-19 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/smartp.exp: New test.
* gdb.cp/smartp.cc : New test.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r-- | gdb/valarith.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c index 554c4ff..88f1448 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -541,7 +541,8 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op, } return call_function_by_hand (argvec[0], 2 - static_memfuncp, argvec + 1); } - error (_("member function %s not found"), tstr); + throw_error (NOT_FOUND_ERROR, + _("member function %s not found"), tstr); #ifdef lint return call_function_by_hand (argvec[0], 2 - static_memfuncp, argvec + 1); #endif @@ -616,6 +617,9 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside) case UNOP_IND: strcpy (ptr, "*"); break; + case STRUCTOP_PTR: + strcpy (ptr, "->"); + break; default: error (_("Invalid unary operation specified.")); } @@ -641,7 +645,9 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside) } return call_function_by_hand (argvec[0], nargs, argvec + 1); } - error (_("member function %s not found"), tstr); + throw_error (NOT_FOUND_ERROR, + _("member function %s not found"), tstr); + return 0; /* For lint -- never reached */ } |