From 36e9969cac95317f057b47509cf63271bccd98b0 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 8 Mar 2005 14:35:20 +0000 Subject: * ax-gdb.c (gen_expr): Add UNOP_PLUS case. * c-exp.y (exp): Add unary plus. * eval.c (evaluate_subexp_standard): Add UNOP_PLUS case. * valarith.c (value_x_unop): Add UNOP_PLUS case. (value_pos): New. * value.h (value_pos): Declare. * gdb.cp/userdef.cc (A1::operator+): New unary plus. (A2): New class. (main): Test operator+. * gdb.cp/userdef.exp: Test unary plus. Use A2::operator+ for breakpoint test. --- gdb/eval.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/eval.c') diff --git a/gdb/eval.c b/gdb/eval.c index a25ff46..98f5580 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1855,6 +1855,15 @@ evaluate_subexp_standard (struct type *expect_type, evaluate_subexp (NULL_TYPE, exp, pos, noside); return evaluate_subexp (NULL_TYPE, exp, pos, noside); + case UNOP_PLUS: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (unop_user_defined_p (op, arg1)) + return value_x_unop (arg1, op, noside); + else + return value_pos (arg1); + case UNOP_NEG: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -- cgit v1.1