commit 9ae843b0376c83096f8d2d0fad5c94142209e8c3 Author: Sami Wagiaalla Date: Tue Jun 22 12:19:08 2010 -0400 Corrected pre-overload-resolution function evaluation. 2010-07-12 Sami Wagiaalla * eval.c (evaluate_subexp_standard): Disabled evaluation of C++ function symbols before overload resolution. diff --git a/gdb/eval.c b/gdb/eval.c index 9a60616..ea3d8a0 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1491,19 +1491,28 @@ 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 (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); + } } } }