From c04da66c264162e6efc37686c0e4ee46c5b048ab Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 15 Mar 2021 06:23:12 -0600 Subject: Implement Ada operator overloading In the expression rewrite, I neglected to carry over support for Ada operator overloading. It turns out that there were no tests for this in-tree. This patch adds support for operator overloading, and adds the missing test. gdb/ChangeLog 2021-03-15 Tom Tromey * ada-lang.c (numeric_type_p, integer_type_p): Return true for fixed-point. * ada-exp.y (maybe_overload): New function. (ada_wrap_overload): New function. (ada_un_wrap2, ada_wrap2, ada_wrap_op): Use maybe_overload. (exp1, simple_exp, relation, and_exp, and_then_exp, or_exp) (or_else_exp, xor_exp, primary): Update. gdb/testsuite/ChangeLog 2021-03-15 Tom Tromey * gdb.ada/operator_call/twovecs.ads: New file. * gdb.ada/operator_call/twovecs.adb: New file. * gdb.ada/operator_call/opcall.adb: New file. * gdb.ada/operator_call.exp: New file. --- gdb/ada-lang.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gdb/ada-lang.c') diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 07958e7..a74f540 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3690,6 +3690,7 @@ numeric_type_p (struct type *type) { case TYPE_CODE_INT: case TYPE_CODE_FLT: + case TYPE_CODE_FIXED_POINT: return 1; case TYPE_CODE_RANGE: return (type == TYPE_TARGET_TYPE (type) @@ -3737,6 +3738,7 @@ scalar_type_p (struct type *type) case TYPE_CODE_RANGE: case TYPE_CODE_ENUM: case TYPE_CODE_FLT: + case TYPE_CODE_FIXED_POINT: return 1; default: return 0; -- cgit v1.1