aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorSami Wagiaalla <swagiaal@redhat.com>2010-07-21 14:59:05 +0000
committerSami Wagiaalla <swagiaal@redhat.com>2010-07-21 14:59:05 +0000
commit883df6ddea77e818a9d516c3d1b34467c71a7b3d (patch)
tree8e626c3c5314011f3d130e97d5aca9414de8c50e /gdb/eval.c
parent269b11a298661a350ca79807544d0b58b7d18a3d (diff)
downloadgdb-883df6ddea77e818a9d516c3d1b34467c71a7b3d.zip
gdb-883df6ddea77e818a9d516c3d1b34467c71a7b3d.tar.gz
gdb-883df6ddea77e818a9d516c3d1b34467c71a7b3d.tar.bz2
Corrected pre-overload-resolution function evaluation.
2010-07-21 Sami Wagiaalla <swagiaal@redhat.com> * eval.c (evaluate_subexp_standard): Disabled evaluation of C++ function symbols before overload resolution. 2010-07-21 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/fpointer.cc: New test. * gdb.cp/fpointer.exp: New test.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index ff17c34..2694781 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1570,19 +1570,29 @@ evaluate_subexp_standard (struct type *expect_type,
{
/* Non-method function call */
save_pos1 = *pos;
- argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
tem = 1;
- type = value_type (argvec[0]);
- if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
- type = TYPE_TARGET_TYPE (type);
- if (type && TYPE_CODE (type) == TYPE_CODE_FUNC)
+
+ /* If this is a C++ function wait until overload resolution. */
+ if (op == OP_VAR_VALUE
+ && overload_resolution
+ && (exp->language_defn->la_language == language_cplus))
{
- for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
+ (*pos) += 4; /* Skip the evaluation of the symbol. */
+ argvec[0] = NULL;
+ }
+ else
+ {
+ argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
+ type = value_type (argvec[0]);
+ if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
+ type = TYPE_TARGET_TYPE (type);
+ if (type && TYPE_CODE (type) == TYPE_CODE_FUNC)
{
- /* pai: FIXME This seems to be coercing arguments before
- * overload resolution has been done! */
- argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem - 1),
- exp, pos, noside);
+ for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
+ {
+ argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem - 1),
+ exp, pos, noside);
+ }
}
}
}